Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Omair Javaid <omair.javaid@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-ifort-parameter failure on ARM
Date: Mon, 15 Jul 2013 10:25:00 -0000	[thread overview]
Message-ID: <CANW4E-25HdXYKMk258iO=GZ=PNM=Zu4jMbstpkSoMgE9wFpmkQ@mail.gmail.com> (raw)
In-Reply-To: <CANW4E-2bQYjx6YdR3qGyKUsQa_KOrtmkWsZYqKzcuQBF==RPpw@mail.gmail.com>

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 */


       reply	other threads:[~2013-07-15 10:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANW4E-2bQYjx6YdR3qGyKUsQa_KOrtmkWsZYqKzcuQBF==RPpw@mail.gmail.com>
2013-07-15 10:25 ` Omair Javaid [this message]
2013-07-16  2:53   ` Yao Qi
2013-09-19 15:31     ` Omair Javaid
2013-10-01  9:53       ` Omair Javaid
2013-11-11  9:53       ` Yao Qi
2014-01-16  9:09         ` Omair Javaid
2014-01-16  9:17           ` Will Newton
2014-01-16  9:48           ` Pedro Alves
2014-01-16  9:51             ` Pedro Alves
2014-01-16 10:26             ` Omair Javaid
2014-01-16 12:35               ` Pedro Alves
2014-01-16 13:55                 ` Omair Javaid
2014-01-16 14:00                   ` Pedro Alves
2014-01-16 14:17                     ` Omair Javaid
2014-01-16 16:24                       ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANW4E-25HdXYKMk258iO=GZ=PNM=Zu4jMbstpkSoMgE9wFpmkQ@mail.gmail.com' \
    --to=omair.javaid@linaro.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox