Re: [PATCH] gdb/testsuite: Add gdb_test_multiple_name variable

Keith Seitz
2019-10-02T17:17:08Z

On 10/2/19 6:03 AM, Andrew Burgess wrote:
> * Keith Seitz <keiths@redhat.com> [2019-10-01 10:41:40 -0700]:
>
>> Your patch looks good to me (but I am not a maintainer), but I wanted to
>> ask if you considered using a stack to more robustly solve the nesting
>> problem? It might be unnecessary today -- even overkill -- but I
>> would think it is much easier on the eyes.
>
> Is your suggestion that we maintain a separate global test name stack
> and push/pop the latest test name to the stack?

I am not making any suggestions, no. Given

> $gdb_test_multiple_name will only ever contain the inner most test message

I was just curious whether you considered using a stack, whether you had
any thoughts on whether we might ever want to know more than just the
innermost test name.

As I wrote in my original message, my intent was more to raise awareness that
this /could/ be a solution to the problem -- not to recommend/require/demand
any changes.

> On the question of robustness, I'd be interested to know if you've
> spotted a possible bug. My intention is that the TCL program stack
> should serve to backup any existing value of gdb_test_multiple_name,
> so there should never be a case where we have the wrong test name in
> place.

Nope, nothing pops to mind that this patch as-is shouldn't immediately serve.

I apologize if I was unclear.

Keith