Re: [committed][gdb/testsuite] Make gdb.base/dbx.exp more robust

Simon Marchi
2020-06-11T14:59:10Z

On 2020-06-11 10:52 a.m., Tom de Vries wrote:
> On 11-06-2020 16:39, Simon Marchi wrote:
>> On 2020-06-11 8:11 a.m., Tom de Vries wrote:
>>> [ was: Re: [PATCH 3/3][gdb/testsuite] Warn about leaked global array ]
>>>
>>> On 04-06-2020 13:40, Tom de Vries wrote:
>>>>> BTW, global variables alone aren't the full scope of the
>>>>> bleeding between testcases. There's also the case of
>>>>> testcases overriding procedures, like gdb.base/dbx.exp,
>>>>> but those are perhaps rare enough that we can continue
>>>>> handling it "manually" as before.
>>>> AFAICT, that test-case does an effort to undo the override, though I'm
>>>> not sure how certain it is that the undo will be executed.
>>>
>>> I've committed patch below to make sure the undo is executed (and
>>> similar for GDBFLAGS).
>>>
>>> Thanks,
>>> - Tom
>>>
>>
>> Ah! That reminded me that I had a patch I had forgotten about that did something
>> similar:
>>
>> https://sourceware.org/pipermail/gdb-patches/2020-May/169109.html
>>
>
> Sorry, didn't notice that one.

No problem, I had forgotten about it and it would probably have fallen
through the cracks actually... we (at least I) really need a way to track
patches.

> So, I'm not sure why you say that it's not necessary.

Ahh sorry, it's early. I misread the code as:

+ # Return as appropriate.
+ if { $code == 1 } {
+ global errorInfo errorCode
+ return -code error -errorinfo $errorInfo -errorcode $errorCode $result
+ } else {
+ return -code $code $result
+ }
+
+ return $result

All is good then :).

Simon