[patch 04/15] PIE: Add from_tty to solib_create_inferior_hook

Tom Tromey tromey@redhat.com
Tue Nov 10 18:00:00 GMT 2009


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> If we would call first solib_create_inferior_hook() it calls
Jan> solib_add(0) so that loading of the libraries is not shown to the
Jan> user.  If we would call solib_add(from_tty) later again it would
Jan> print:
Jan> 	Symbols already loaded for ...
Jan> One question is whether we are interested in these progress
Jan> messages at all so that just no from_tty would be needed and no
Jan> progress messages would ever be printed.  I suggest such way but
Jan> kept this patch printing it just targeting the requirements for PIE
Jan> functionality.

I'm ambivalent about the messages, but FWIW I think you did the right
here: it is simpler to approve a patch that doesn't change messages than
it is to approve one that does.

Jan> Another question is why from_tty cannot be a global variable (or a
Jan> global getter) as it is more global than for example
Jan> current_inferior().

I'd prefer we not introduce new globals unless truly necessary.

A from_tty global would be fine for things strictly related to the CLI,
I suppose (the difficulty being enforcing such a rule), but for the core
I think parameterization is better.

Jan> SOLIB_CREATE_INFERIOR_HOOK was not modified as its only called
Jan> xcoff_relocate_symtab has no use for FROM_TTY.

It would be nice to nuke SOLIB_CREATE_INFERIOR_HOOK, given that there is
just a single definition.

Jan> 	* infcmd.c (post_create_inferior): Move solib_add after
Jan> 	solib_create_inferior_hook.  Pass from_tty to
Jan> 	solib_create_inferior_hook.  Call solib_add and SOLIB_ADD with
Jan> 	0 from_tty and comment why.
[...]

Ok.

Tom



More information about the Gdb-patches mailing list