This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: debugging graphics applications [GDB 5.11-doswin-djgpp-allegro]


> From: "Guido Sassmannshausen" <sassi@sedan.uni-osnabrueck.de>
> Date: Sat, 9 Mar 2002 00:45:05 +0100
> 
> to test some simple parts of a gui framework, I use the allegro gfx-library
> to fiddle with those at home. obviosly debugging is quite an important
> factor, but after 1h of scanning through GDB docs, allegro and djgpp docs, I
> still can't find any solution.
> I just want to convince gdb to switch from gfxmode to textmode when it
> returns to the prompt.

You should add the necessary code in the functions
go32_terminal_inferior and go32_terminal_ours (defined on go32-nat.c).
These are called whenever control jumps from the debuggee to GDB and
back.  The sibling functions go32_terminal_init and go32_terminal_info
might also need some change.

Beware: go32_terminal_ours and go32_terminal_inferior are sometimes
called even if you think the debuggee runs uninterrupted, for example
when GDB decides it needs to single-step the program.  So don't put
any heavy code there, or you _will_ be sorry.

The reason I didn't add mode-switching code to these routines is that
when you switch the video mode, you'd want to restore the screen
contents as well.  Unfortunately, there's no standard method to do
that, and non-standard methods need VESA functions that are poorly
implemented by some SVGA drivers (they are the reason that RHIDE
crashes or hangs with some SVGAs, or the screen goes blank: RHIDE does
try to switch modes correctly).

So if you want to add the necessary code, I'd suggest to code a
redraw-display function into your program, bind it to some hot key,
and press that key whenever you are resuming your program.  When GDB
gets control back, pressing Ctrl-L will clean-up the text-mode screen.

> one of those cases where a specific RTFM is welcome :)

Sigh.. terminal handling between GDB and the inferior is yet another
issue that's totally undocumented in gdbint.texinfo.  Andrew, please
file a bug report somewhere.


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