Re: RFC: hacky fix for PR 12406

Gary Benson
2012-01-12T11:25:52Z

Tom Tromey wrote:
> I would like to get some feedback on this.
>
> PR 12406 concerns what is printed when stop-on-solib-events is set:
>
> (gdb) set stop-on-solib-events 1
> (gdb) r
> Starting program: /tmp/q
> Stopped due to shared library event
>
> What is missing here is any indication of what library was loaded.
>
> This patch changes the output to:
>
> (gdb) set stop-on-solib-events 1
> (gdb) r
> Starting program: /tmp/q
> [Inferior loaded library /lib64/ld-linux-x86-64.so.2]
> Stopped due to shared library event

Could this be a separate option, trace-solib-events maybe? It seems
like this printing might also be useful when stop-on-solib-events is
off.

Also, as Jan said, it would be nice to have unload notifications too.

> I could not find a good way to get the information about what
> library was loaded from the library-loading code to the bpstat_print
> code. This approach seems like a hack to me -- so I was wondering
> if anyone has a better suggestion.

I like Joel's idea of a flag, it's what I'd try. You would probably
need to do something like that for unload notifications anyway.

Cheers,
Gary

--