[PATCH] Fix gdb.cp/typeid.exp failures for ppc64

Luis Machado lgustavo@codesourcery.com
Mon Dec 15 12:29:00 GMT 2014


Ping!

On 12/05/2014 10:37 AM, Luis Machado wrote:
> On 12/05/2014 10:36 AM, Luis Machado wrote:
>> On 12/01/2014 06:30 PM, Sergio Durigan Junior wrote:
>>> On Monday, December 01 2014, Luis Machado wrote:
>>>
>>>> This test assumes the typeid symbols are always available before
>>>> actually starting the inferior, which is not true for architectures
>>>> that place such symbols under relocatable sections.
>>>>
>>>> The following patch fixes this by conditionalizing the execution of
>>>> such tests on the accessibility of the typeid symbols before the
>>>> inferior is running.
>>>>
>>>> Regression-tested on ppc32/64.
>>>
>>> Hey Luis!
>>>
>>> Thanks for the patch.  Just a somewhat minor comment.
>>>
>>>> diff --git a/gdb/testsuite/gdb.cp/typeid.exp
>>>> b/gdb/testsuite/gdb.cp/typeid.exp
>>>> index 9963a8a..7469b2b 100644
>>>> --- a/gdb/testsuite/gdb.cp/typeid.exp
>>>> +++ b/gdb/testsuite/gdb.cp/typeid.exp
>>>> @@ -25,20 +25,35 @@ if {[prepare_for_testing $testfile.exp $testfile
>>>> $srcfile {debug c++}]} {
>>>>
>>>>   proc do_typeid_tests {started} {
>>>>       global hex
>>>> +    global gdb_prompt
>>>> +    set symbol_found 1
>>>>
>>>> -    # We might see the standard type or gdb's internal type.
>>>> -    set type_re "(std::type_info|struct gdb_gnu_v3_type_info)"
>>>> +    # Try to access one of the symbols to make sure it is
>>>> available.  Some
>>>> +    # architectures put the symbols on relocatable sections, which
>>>> means
>>>> +    # they will not be accessible before the inferior is running.
>>>> +    send_gdb "print 'typeinfo for int'\n"
>>>> +    gdb_expect {
>>>> +    -re "No symbol \"typeinfo for int\" in current
>>>> context.*$gdb_prompt" {
>>>> +        set symbol_found 0
>>>> +    }
>>>> +    -re ".*$gdb_prompt" {
>>>> +    }
>>>> +    }
>>>
>>> Any particular reason for not using gdb_test_multiple here (and
>>> everywhere else)?  This "send_gdb...gdb_expect" dialect is not used
>>> anymore in the testsuite, AFAIR.
>>>
>>
>> It looks a bit more natural when you are aiming at tests that should not
>> expose PASS/FAIL. But gdb_test_multiple can be used that way as well,
>> though with a somewhat strange empty testname parameter.
>>
>> Works the same though.
>>
>> I've updated the patch and fixed a previous gotcha in the logic.
>>
>> Ok?
>>
>>
>
> Of course, now actually attaching the patch itself!
>
>



More information about the Gdb-patches mailing list