Re: [Geany-Devel] debug output on win32

2015-03-24 Thread Dimitar Zhekov

On 23.3.2015 г. 13:44, Enrico Tröger wrote:


This is because on Windows you have to decide at compile time whether
you want to have a console application or a graphical application.
Console applications can print directly to the terminal but not
graphical applications.


To be precise, when started from a console application, such as the 
shell, graphical applications can attach to their parent's console:


AttachConsole(ATTACH_PARENT_PROCESS);
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), "boza", 4, &n, NULL);

It may be possible to create a file descriptor with _open_osfhandle() 
and replace stdout (and the others) with dup2(), I haven't tested.


The mpv player (a fork of MPlayer) under Windows uses it's parent 
console, if any.


--
E-gards: Jimmy
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] debug output on win32

2015-03-23 Thread Enrico Tröger
On 23/03/15 08:27, Matthew Brush wrote:
> On 15-03-22 04:30 PM, the Adib wrote:
>> Hello all,
>>
>> I have installed a buildenvironment on my Win32 virtualbox.
>> I want to investigate in the source code and have some debug output from
>> the running application.
>>
>> I tried printf as well as geany_debug. I also set G_MESSAGES_DEBUG=all.
>>
>> However starting the application from the commandshell cmd:
>> - returns immediatel to the promt, without waiting the application to
>> close,
>> - does not output any debug hint on the console.
>>
>> Could you guide me how to have some informative output from the running
>> application.
>>
> 
> Since you did not say so, I have to ask, did you run it with verbose
> messages like `geany -v`?

This is exactly the trick on Windows.
-v will open another terminal window where debug output is printed to.

This is because on Windows you have to decide at compile time whether
you want to have a console application or a graphical application.
Console applications can print directly to the terminal but not
graphical applications. Since Geany is clearly a graphical application,
there is no console output by default.
When the -v switch is used, Geany does some Windows API magic to open
that other terminal window and print output to it. This is just for
debugging/developing.

Alternatively, by using geany_debug() and/or g_message()/g_warning() you
can see the messages also in Geany itself in the Help->Debug Messages
dialog. There those messages are always available, even without the -v
switch.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc



signature.asc
Description: OpenPGP digital signature
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] debug output on win32

2015-03-23 Thread Lex Trotman
On 23 March 2015 at 10:30, the Adib  wrote:
> Hello all,
>
> I have installed a buildenvironment on my Win32 virtualbox.
> I want to investigate in the source code and have some debug output from the
> running application.
>
> I tried printf as well as geany_debug. I also set G_MESSAGES_DEBUG=all.
>
> However starting the application from the commandshell cmd:
> - returns immediatel to the promt, without waiting the application to close,

You don't have another instance running do you?  In that case Geany
will display any files specified on that display and exit immediately.

Cheers
Lex

> - does not output any debug hint on the console.
>
> Could you guide me how to have some informative output from the running
> application.
>
> Regards,
>
> Adib.
> --
>
>
>
> ___
> Devel mailing list
> Devel@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] debug output on win32

2015-03-23 Thread Matthew Brush

On 15-03-22 04:30 PM, the Adib wrote:

Hello all,

I have installed a buildenvironment on my Win32 virtualbox.
I want to investigate in the source code and have some debug output from
the running application.

I tried printf as well as geany_debug. I also set G_MESSAGES_DEBUG=all.

However starting the application from the commandshell cmd:
- returns immediatel to the promt, without waiting the application to close,
- does not output any debug hint on the console.

Could you guide me how to have some informative output from the running
application.



Since you did not say so, I have to ask, did you run it with verbose 
messages like `geany -v`?


Cheers,
Matthew Brush


___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


[Geany-Devel] debug output on win32

2015-03-22 Thread the Adib
Hello all,

I have installed a buildenvironment on my Win32 virtualbox.
I want to investigate in the source code and have some debug output from
the running application.

I tried printf as well as geany_debug. I also set G_MESSAGES_DEBUG=all.

However starting the application from the commandshell cmd:
- returns immediatel to the promt, without waiting the application to close,
- does not output any debug hint on the console.

Could you guide me how to have some informative output from the running
application.

Regards,

Adib.
--
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel