Re: [PATCH PR gdb/18071] TLS variables can't be resolved on aarch64-linux-gnu

Wei-min Pan
2018-03-22T18:18:26Z

Hi Simon,

On 3/21/2018 9:22 PM, Simon Marchi wrote:
> On 2018-03-19 15:36, Weimin Pan wrote:
>> Yes, printing of a TLS fails on all platforms, not just on aarch64.
>> How about changing the title to:
>>
>> Â Â  [PATCH PR gdb/18071] aarch64: "info" command can't resolve TLS
>> variables
>
> Maybe "info address" instead of "info"?

OK.

>
>>> Is this code equivalent to calling lookup_minimal_symbol (name,
>>> NULL, NULL) ?Â  If
>>> so, there's already lookup_bound_minimal_symbol that does the same,
>>> so maybe we
>>> can just drop lookup_minimal_symbol_and_objfile and use
>>> lookup_bound_minimal_symbol.
>>
>> Yes, it turns out lookup_minimal_symbol_and_objfile(name) is
>> equivalent to
>> calling lookup_minimal_symbol (name, NULL, NULL). We can replace the
>> call in
>> info_address_command() with either lookup_minimal_symbol (name, NULL,
>> NULL)
>> or lookup_bound_minimal_symbol(name). Calling either one looks like a
>> better fix.
>>
>>>
>>> We could also just have lookup_minimal_symbol with parameters that
>>> default to nullptr.
>>> It is not clear at all to have lookup_bound_minimal_symbol and
>>> lookup_minimal_symbol
>>> that both return a bound_minimal_symbol, that's quite misleading.
>>
>> I don't know the rational behind having these two functions which get
>> called in
>> quite a few places. Yes, having default arguments for
>> lookup_minimal_symbol()
>> will be another option.
>>
>> Thanks very much for your comments.
>
> Thanks for your patience :).Â  This refactoring can be done in a
> separate patch, to keep this one focused on fixing the bug.

Thank you very much for getting this process moving :) Would you like me
to submit a revised patch which calls
lookup_bound_minimal_symbol instead of lookup_minimal_symbol_and_objfile?

Weimin

>
> Simon