[PATCH][gdb/testsuite] Move code from gdb_init to default_gdb_init

Tom de Vries tdevries@suse.de
Thu Jun 18 10:16:42 GMT 2020


[ was: Re: [PATCH][gdb/testsuite] Don't abort testrun for invalid
command in test-case ]
On 6/17/20 4:19 PM, Pedro Alves wrote:
> On 6/17/20 3:14 PM, Tom de Vries wrote:
>> On 6/16/20 2:47 PM, Pedro Alves wrote:
>>> On 6/11/20 11:55 PM, Tom de Vries wrote:
>>>
>>>> Hmm, what is the distinction between gdb_init and default_gdb_init?
>>>>
>>>> All the other uses in gdb.exp of pattern foo/default_foo have an
>>>> implementation:
>>>> ...
>>>> proc foo {} {
>>>>   [default_foo]
>>>> }
>>>> ...
>>>> but gdb_init is much more than that. Why is that different?
>>>>
>>>
>>> I don't know.  I guess it shouldn't.  I guess people (including me) added to
>>> gdb_init over time without realizing they were breaking the pattern.  Maybe nobody
>>> notices it because whatever is overriding gdb_init renames the original one and
>>> then calls it.
>>
>> Hmm, thanks for the explanation.  I feel we need to improve this
>> situation somehow, but I'm not sure yet how.
> 
> Move stuff in gdb_init to default_gdb_init, and add a comment to these
> functions to not add stuff in there?  That seems like the obvious.
> I'm not sure why we have that pattern in the first place though, given
> that you can rename/override functions in tcl anyhow.  This all predates me.

How about this patch then?

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdb-testsuite-Move-code-from-gdb_init-to-default_gdb_init.patch
Type: text/x-patch
Size: 11031 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200618/f2f873be/attachment-0001.bin>


More information about the Gdb-patches mailing list