This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Breakpoint conditional on the OS
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb at sources dot redhat dot com
- Date: Sun, 25 Dec 2005 08:40:19 +0200
- Subject: Breakpoint conditional on the OS
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
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