RE: [PATCH v5 09/15] gdb, ada: update ada_lookup_simple_minsym

Metzger, Markus T via Gdb-patches
2022-09-14T08:20:14Z

ping.

>-----Original Message-----
>From: Metzger, Markus T <markus.t.metzger@intel.com>
>Sent: Dienstag, 19. Juli 2022 09:15
>To: Tom Tromey <tom@tromey.com>
>Cc: Markus Metzger via Gdb-patches <gdb-patches@sourceware.org>
>Subject: RE: [PATCH v5 09/15] gdb, ada: update ada_lookup_simple_minsym
>
>Hello Tom,
>
>>Markus> diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
>>Markus> index 8660205809a..85569b841eb 100644
>>Markus> --- a/gdb/ada-exp.y
>>Markus> +++ b/gdb/ada-exp.y
>>Markus> @@ -1700,8 +1700,15 @@ write_var_or_type (struct parser_state
>>*par_state,
>>Markus> }
>>Markus> else if (syms.empty ())
>>Markus> {
>>Markus> + if (block == nullptr)
>>Markus> + block = get_selected_block (nullptr);
>>
>>I don't think 'block' can be null here, since it's handled at the top of
>>the function:
>>
>> if (block == NULL)
>> block = par_state->expression_context_block;
>
>It can be null. When I removed the check gdb.ada/minsyms.exp ran
>into an internal error.
>
>The question is whether calling get_selected_block (nullptr), here,
>is the right thing to do or whether we should just leave objfile null
>in that case.
>
>regards,
>markus.