Re: [PATCH] Fix GDB build when using --disable-gdbmi

Tom Tromey
2019-05-10T19:11:19Z

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> That would require the mi_ui_out object to be created with that flag. However,
Simon> this option can be toggled on after the mi_ui_out object has been created (through
Simon> the MI command -fix-multi-location-breakpoint-output).

Ah, I didn't realize that.

Simon> One way to make it work would be, when the -fix-multi-location-breakpoint-output
Simon> command is issued, we go through all existing ui_out objects and set that flag.
Simon> But I don't think there's an easy way of going through all existing ui_out objects.

Simon> If you have any ideas for a more elegant way to make it work, I would be up for it,
Simon> because it's true that sprinkling #ifdefs is not the best idea.

It's maybe strange that -fix-multi-location-breakpoint-output affects
all MI channels and not just the ones associated with the request. It
seems like if there are multiple MI channels, then this could confuse
some client. But then, making it per-channel would make it not work
nicely if a new MI-out is created for a specific command (which I guess
is done by mi_load_progress, not sure about things like interpreter-exec).

I guess maybe if there's going to be a global, it could just be stuck in
breakpoint.c and then flags used for the ui-out version check currently
done in mi_multi_location_breakpoint_output_fixed. I'm not really sure
this is any better -- globals are bad, but it does avoid the #if.

Tom