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]

Breakpoint conditional on the OS


I have a question for the scripting wizards: how do I write in
.gdbinit something that will set a breakpoint on a function that is
present only in the version of the program compiled for a specific
platform?

Details: Emacs compiled for MS-Windows replaces the calls to `abort'
to its own function `w32_abort' (so that it could pop up a dialog
asking whether the user would like to debug the session being
aborted).  The file .gdbinit distributed with Emacs sets a breakpoint
on `abort', so naturally I'd like to do the same for `w32_abort'.  But
I'd like to avoid the annoying message on other platforms saying that
there's no such function.  The question is, how to do that?

I tried conditioning on some OS-specific function/variable (take its
address into a convenience variable and use that in an `if' test), but
that's catch-22: the variable exists only on Windows, so taking its
address on other platforms produces similarly annoying messages.

Ideas welcome, thanks in advance.

Btw, I noticed that GDB 6.1 doesn't display such warning messages for
commands in .gdbinit it reads at startup.  Can someone remind me why
we changed this behavior, and perhaps point me to a relevant
discussion and/or patch?  TIA


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