Re: debugging svgalib programs

Search this archive.

From: Russell Marks (russell.marks@dtn.ntl.com)
Date: Wed 22 Mar 2000 - 11:56:31 IST


I'm not sure if I should be dereferencing your `voidpointer' email
address, but what the heck. :-)

> How do I debug an svgalib program with gdb?  Every time I try, I end up with 
> a black screen and have to reboot.  Also, is there a shell command or 
> something to set the video mode back to text mode?

I usually use printf() for debugging (much as Matan suggested) or the
even more incredibly old-fashioned `think about why it's going wrong'
technique :-), but yesterday I really did need gdb. As it turned out,
I couldn't just blindly type `p vga_flip()' in gdb as someone else
suggested - the program I needed to debug uses raw mode to read the
keyboard.

It turns out that you need to login over serial or over a network
connection, and use e.g. `gdb -tty /dev/tty7 foo' for a program foo.
The program will run on the tty you suggest (be sure to switch to it
though :-)), but gdb will keep running over the serial/network login.
Then, once you're done debugging, you can use `p exit(0)' to return
the console to normal before quitting gdb.

-Rus.


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST