[PATCH] Fix gdb.dwarf2/dwz.exp for thumb mode

Yao Qi yao@codesourcery.com
Sun Sep 14 14:37:00 GMT 2014


Andreas Schwab <schwab@linux-m68k.org> writes:

>> -if { $main_length == "" } {
>> +set main_label_offset ""
>> +set test "p main_label"
>> +gdb_test_multiple $test $test {
>> +    -re ".* = {.*} $hex <main\\+($decimal)>.*\r\n$gdb_prompt $" {
>> +	set main_label_offset $expect_out(1,string)
>> +    }
>> +}
>
> This will also fail to match if assembler labels are prefixed.

If you meant 'main' could be prefixed to '_main' for example, then GDB
can get rid of the prefix on display.  On mingw target, function 'foo'
is prefixed to '_foo', but GDB still shows 'foo' rather than '_foo'.

$ i686-w64-mingw32-objdump -t 2.exe | grep foo
[ 64](sec  1)(fl 0x00)(ty  20)(scl   3) (nx 1) 0x00000560 _foo

Dump of assembler code from 0x401560 to 0x401565:
   0x00401560 <foo+0>:  push   %ebp
   0x00401561 <foo+1>:  mov    %esp,%ebp
-- 
Yao (齐尧)



More information about the Gdb-patches mailing list