This is the mail archive of the gdb@sourceware.org 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 X with GDB


>>>>> "Bernie" == Bernie Innocenti <bernie@codewiz.org> writes:

Bernie> 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.

Bernie> I thought we could easily do that by just setting a breakpoint on
Bernie> dlopen(), but it didn't seem to work for the X server, perhaps because
Bernie> the old, hand-crafted dynamic loader did not call dlopen() at all.
Bernie> Perhaps mmap() would have worked or, as a last resort, open().

You could try `set stop-on-solib-events on'.

This isn't as handy as a breakpoint because you can't make it conditional.
IMO, both this and `handle' would be better expressed as `catch'
subcommands (thus allowing conditions and attached commands
automatically) -- but AFAIK nobody is actively working on this.

Bernie> gdb supports setting conditional expressions on breakpoints, but I'm not
Bernie> sure they can be used on function arguments and if basic string
Bernie> manipulation is supported.

Yes to both.

Tom


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