This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] testsuite/gdb.dwarf2: Fix for dw2-ifort-parameter failure on ARM


gdb.dwarf2/dw2-ifort-parameter fails on ARM because the dwarf2 debug
information being created by gdb.dwarf2/dw2-ifort-parameter-debug.S
gets corrupted because LSB of function addresses is ON in Thumb mode.
ARM instructions are word aligned and LSB of instruction address is
used to determine whether code being branched to is Thumb or ARM code.
This patch solves the problem by decrementing function address by one
in thumb mode. This patch has been tested on x86_64 and arm7 machines.

gdb/testsuite/ChangeLog:

2013-07-15  Omair Javaid  <Omair.Javaid@linaro.org>

	* gdb.dwarf2/dw2-ifort-parameter-debug.S: Updated to use correct
	function addresses while creating debug info in ARM Thumb mode.

===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S,v
retrieving revision 1.4
diff -u -p -r1.4 dw2-ifort-parameter-debug.S
--- gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S        1 Jan 2013
06:33:28 -0000  1.4
+++ gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S        19 Jun 2013
18:34:44 -0000
@@ -29,15 +29,35 @@
        .ascii  "file1.txt\0"                   /* DW_AT_name */
        .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
        .byte   1                               /* DW_AT_language (C) */
+
+#ifndef __thumb__
+
        .4byte  func                            /* DW_AT_low_pc */
        .4byte  main                            /* DW_AT_high_pc */

+#else
+
+       .4byte          func-1                  /* DW_AT_low_pc */
+       .4byte          main-1                  /* DW_AT_high_pc */
+
+#endif
+
        .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
        .byte           1                       /* DW_AT_external */
        .ascii          "func\0"                /* DW_AT_name */
+
+#ifndef __thumb__
+
        .4byte          func                    /* DW_AT_low_pc */
        .4byte          main                    /* DW_AT_high_pc */

+#else
+
+       .4byte          func-1                  /* DW_AT_low_pc */
+       .4byte          main-1                  /* DW_AT_high_pc */
+
+#endif
+
        .uleb128        3                       /* Abbrev:
DW_TAG_formal_parameter */
        .ascii          "param\0"               /* DW_AT_name */
        .byte           1                       /* DW_AT_variable_parameter */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]