This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-ifort-parameter failure on ARM
- From: Pedro Alves <palves at redhat dot com>
- To: Omair Javaid <omair dot javaid at linaro dot org>
- Cc: Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Thu, 16 Jan 2014 12:35:46 +0000
- Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-ifort-parameter failure on ARM
- Authentication-results: sourceware.org; auth=none
- References: <CANW4E-2bQYjx6YdR3qGyKUsQa_KOrtmkWsZYqKzcuQBF==RPpw at mail dot gmail dot com> <CANW4E-25HdXYKMk258iO=GZ=PNM=Zu4jMbstpkSoMgE9wFpmkQ at mail dot gmail dot com> <51E4B587 dot 70007 at codesourcery dot com> <CANW4E-0vd51dTvd5qxUbeDn7ebXV-cf+WS4+VpyyGyD0MYGk8Q at mail dot gmail dot com> <5280A528 dot 8040308 at codesourcery dot com> <52D7A05F dot 6070304 at linaro dot org> <52D7AAF1 dot 80501 at redhat dot com> <52D7B3C5 dot 1000702 at linaro dot org>
On 01/16/2014 10:26 AM, Omair Javaid wrote:
>
>
> On 01/16/2014 02:48 PM, Pedro Alves wrote:
>> On 01/16/2014 09:03 AM, Omair Javaid wrote:
>>
>>> There seemed no problem with how breakpoint addresses were being adjusted.
>>> This test requires to build dwarf info by hand in dw2-ifort-parameter-debug.S
>>> using compile time addresses so in case of arm (thumb mode) the least
>>> significant bits of compile time address are set to 1. For that reason
>>> 0x000083bd was being used as a breakpoint address func.
>>
>> OOC, what does the compiler debug info usually do instead to avoid this?
>>
>
> Here is what compiler generates when there are thumb functions to handle:
> .thumb_func
> .type func, %function
> func:
> .LFB0:
>
> func is marked as thumb function and thus this func pointer will have the
> lower bit set. While .LFB0: non thumb label will be used to mark function
> start address. Like this: .4byte .LFB0 @ DW_AT_low_pc
Ah. I wonder if this works for you (and everyone).
---
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S | 4 ++--
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S
index c7dd9be..6b08cb2 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S
@@ -35,8 +35,8 @@
.uleb128 2 /* Abbrev: DW_TAG_subprogram */
.byte 1 /* DW_AT_external */
.ascii "func\0" /* DW_AT_name */
- .4byte func /* DW_AT_low_pc */
- .4byte main /* DW_AT_high_pc */
+ .4byte func_addr /* DW_AT_low_pc */
+ .4byte main_addr /* DW_AT_high_pc */
.uleb128 3 /* Abbrev: DW_TAG_formal_parameter */
.ascii "param\0" /* DW_AT_name */
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c
index 361c44d..c866b0f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c
@@ -29,3 +29,9 @@ main (void)
func ();
return 0;
}
+
+/* Addresses represented as data symbols, thus without Thumb (etc.)
+ mode bits. The dw2-ifort-parameter-debug.S file uses this as
+ func's low_pc/high_pc. */
+extern void *func_addr __attribute__ ((alias ("func")));
+extern void *main_addr __attribute__ ((alias ("main")));
--
1.7.11.7