Re: [PATCH] gdb/python: smarter symbol lookup for gdb.lookup_static_symbol

Eli Zaretskii
2019-09-23T17:18:50Z

> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Cc: Christian Biesinger <cbiesinger@google.com>, Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Mon, 23 Sep 2019 17:46:38 +0100
>
> +There can be multiple global symbols with static linkage with the same
> +name. This function will only return the first matching symbol that
> +it finds. Which symbol is found depends on where @value{GDBN} is
> +currently stopped, as @value{GDBN} will first search for matching
> +symbols in the current object file, and then search all other object
> +files. If the application is not yet running then @value{GDBN} will
> +search all object files.

I don't understand the last sentence: AFAIU, GDB will search "all"
object files even if the program runs, it just will start from the
current object file. So the last sentence should instead explain in
which order will GDB search the object files when the debuggee is not
yet running, i.e. what will be the first examined object file. Am I
missing something?

Otherwise, the documentation part is approved.

Thanks.