Re: [Bug win32/14529] Make gdb capable of JIT-debugging on W32

Pedro Alves
2012-09-11T18:09:13Z

On 08/31/2012 04:37 PM, LRN wrote:
>>> >> @@ -1055,6 +1065,7 @@ Options:\n\n\ --dbx DBX
>>> >> compatibility mode.\n\ --directory=DIR Search for source files
>>> >> in DIR.\n\ --epoch Output information used by epoch
>>> >> emacs-GDB interface.\n\ + --event=EVENT Signal the EVENT
>>> >> when attached to a process. W32 only.\n\
>> >
>> > And also this part.
> They were, initially. However, gdb contribution documentation said
> that gdb devs frown upon extra #ifdefs in files that are not
> platform-specific.
> The code is mostly platform independent, it's the two W32API functions
> that only work on W32 (and you can write non-W32 equivalent, if you
> figure out how to make it work). Thus, i removed extra #ifdefs in
> main.c and other files.

Please consider also cross builds. IOW, a gdb hosted on Windows,
but that is built to target something else. In that case, as is,
you will end up with the option compiled in. But if you remove any
mention that this is for Windows only, it'll be confusing.
I'd maybe go as far as renaming the option to --w32-jit-event or
--aedebug-event, or some such.

Alternatively, and perhaps it really is a better option,
get rid of the --event option, but make this a real command, implemented
in windows-nat.c, so that the user has better control of when to signal
the event, like:

gdb -ex "foo" -ex "bar" -ex "attach PID" -ex "signal-aedebug-event FOO"

--
Pedro Alves