From: Russell Marks (russell.marks@ntlworld.com)
Date: Mon 22 Jan 2001 - 17:09:32 IST
Felix Natter wrote: > I wrote a simple svgalib-application that frequently gives me segmentation > faults. I try to debug this, [...] I responded to something similar in March last year, so I thought I'd quote that response here - hope it helps: > > 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. ------------------------------------------------------------------ Unsubscribe: To: listbot@svgalib.org Body: unsubscribe linux-svgalib
This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST