This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Debugging X with GDB
- From: Bernie Innocenti <bernie at codewiz dot org>
- To: rms at gnu dot org
- Cc: gdb at sourceware dot org
- Date: Wed, 13 Jan 2010 17:30:55 -0500
- Subject: Re: Debugging X with GDB
- References: <E1NSMSM-0000oT-51@fencepost.gnu.org> <1263170536.29695.86.camel@giskard> <E1NUPod-00026Y-78@fencepost.gnu.org> <1263243923.2695.72.camel@giskard> <E1NUq18-0000RQ-D4@fencepost.gnu.org>
On Tue, 2010-01-12 at 18:19 -0500, Richard Stallman wrote:
> That is good, but GDB knew to recognize that the driver file was being
> loaded even with old X server. Given that it could recognize the
> file, it could also offer a command to specify "stop the program after
> loading file FOO". That will be useful when strange things are
> happening.
I thought we could easily do that by just setting a breakpoint on
dlopen(), but it didn't seem to work for the X server, perhaps because
the old, hand-crafted dynamic loader did not call dlopen() at all.
Perhaps mmap() would have worked or, as a last resort, open().
gdb supports setting conditional expressions on breakpoints, but I'm not
sure they can be used on function arguments and if basic string
manipulation is supported.
Ideally, we'd want to have the moral equivalent of
break dlopen if strstr(filename, "siliconmotion_drv")
--
// Bernie Innocenti - http://codewiz.org/
\X/ Sugar Labs - http://sugarlabs.org/