This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debug output


On Wed, 2003-07-30 at 10:35, Jeremy Godfrey wrote:
> I'm using insight with cygwin/mingw on Windows XP. I use the Win32 call
> OutputDebugString in my debug/checked build to monitor the running program.
> When using straight gdb this results in output to the gdb console but with
> insight it results in loads of message boxes that make debugging impossible.
> Is there any way to change this behaviour?

Looks like OutputDebugString was hooked up to gdb's warning mechanism.
See gdb/win32-nat.c: handle_output_debug_string.

You've got two options:

1. "Quick" and really hacky option
You'll need to add something to gdbtk_warning in
gdb/gdbtk/generic/gdbtk-hooks.c to recognize that the message is debug 
output and route it to the debug window (if open). That should be pretty
easy. The trick is diffentiating between real warnings and debug output.

If all the output is prepended with some constant message, then it would
be really easy to do this (just check if the warning message begins with
the string).If it doesn't, modify handle_output_debug_string to add
this. (Ok, this is hacky, but it will work.)

2. "Formal" solution
Add a debug output hook/event in gdb and then add the appropriate event
handler in insight. IMO, this is easier to do, but it will require much
more "formal" work: gdb group will need to approve patches and
extensions.

If you are a software hoarder and not interested in extending the
functionality of insight or gdb for others, take your pick of which
method to use. (I would still use #2, I think it would be easier and
cleaner than #1.) But please consider submitting patches and starting a
discussion on the gdb mailing list about inferior debug messages.

Keith



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]