From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 4/4] Fix gdb.trace/entry-values.exp for thumb mode
Date: Thu, 03 Jul 2014 06:11:00 -0000 [thread overview]
Message-ID: <1404367792-23234-5-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1404367792-23234-1-git-send-email-yao@codesourcery.com>
We see some fails in gdb.trace/entry-values.exp in thumb mode
(-mthumb -march={armv4t,armv7-a}).
In thumb mode, the lsb of references to 'foo' and 'bar' in the assembly
(produced by dwarf assember) is set, so the generated debug
information is incorrect.
This patch copies the approach used by
[PATCH 4/4] Fix dw2-ifort-parameter.exp on PPC64
https://sourceware.org/ml/gdb-patches/2014-03/msg00202.html
to introduce new labels 'foo_start' and 'bar_start' which are about
the correct function address (without lsb set). This patch fixes
these fails we've seen. This should also fix the fails on PPC64, but
I didn't test.
gdb/testsuite:
2014-07-02 Yao Qi <yao@codesourcery.com>
* gdb.trace/entry-values.c: Define labels 'foo_start' and
'bar_start' at the beginning of functions 'foo' and 'bar'
respectively.
* gdb.trace/entry-values.exp: Use 'foo_start' and 'bar_start'
instead of 'foo' and 'bar'.
---
gdb/testsuite/gdb.trace/entry-values.c | 6 ++++++
gdb/testsuite/gdb.trace/entry-values.exp | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/gdb/testsuite/gdb.trace/entry-values.c b/gdb/testsuite/gdb.trace/entry-values.c
index 4f80eb0..11bb739 100644
--- a/gdb/testsuite/gdb.trace/entry-values.c
+++ b/gdb/testsuite/gdb.trace/entry-values.c
@@ -15,12 +15,18 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+asm (".section \".text\"");
+asm (".balign 8");
+asm ("foo_start: .globl foo_start");
+
int
foo (int i, int j)
{
return 0;
}
+asm ("bar_start: .globl bar_start");
+
int
bar (int i)
{
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index f10ffa6..3ccb4d2 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -145,8 +145,8 @@ Dwarf::assemble $asm_file {
foo_label: subprogram {
{name foo}
{decl_file 1}
- {low_pc foo addr}
- {high_pc "foo + $foo_length" addr}
+ {low_pc foo_start addr}
+ {high_pc "foo_start + $foo_length" addr}
} {
formal_parameter {
{type :$int_label}
@@ -163,8 +163,8 @@ Dwarf::assemble $asm_file {
subprogram {
{name bar}
{decl_file 1}
- {low_pc bar addr}
- {high_pc "bar + $bar_length" addr}
+ {low_pc bar_start addr}
+ {high_pc "bar_start + $bar_length" addr}
{GNU_all_call_sites 1}
} {
formal_parameter {
@@ -173,7 +173,7 @@ Dwarf::assemble $asm_file {
}
GNU_call_site {
- {low_pc "bar + $bar_call_foo" addr}
+ {low_pc "bar_start + $bar_call_foo" addr}
{abstract_origin :$foo_label}
} {
# Faked entry values are reference to variables 'global1'
--
1.9.0
next prev parent reply other threads:[~2014-07-03 6:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 6:11 [PATCH 0/4] Fix gdb.trace/entry-values.exp fails in " Yao Qi
2014-07-03 6:11 ` [PATCH 3/4] Stop prologue analysis when past the epilogue Yao Qi
2014-07-03 8:39 ` Will Newton
2014-07-11 13:39 ` Joel Brobecker
2014-07-03 6:11 ` [PATCH 2/4] Match instruction adjusts SP in thumb Yao Qi
2014-07-03 8:35 ` Will Newton
2014-07-11 13:25 ` Joel Brobecker
2014-09-24 12:56 ` Yao Qi
2014-07-03 6:11 ` Yao Qi [this message]
2014-07-07 15:15 ` [PATCH 4/4] Fix gdb.trace/entry-values.exp for thumb mode Joel Brobecker
2014-07-08 8:53 ` Yao Qi
2014-07-03 6:11 ` [PATCH 1/4] Restrict matching add/sub sp, #imm Yao Qi
2014-07-03 8:31 ` Will Newton
2014-07-07 1:38 ` Yao Qi
2014-07-11 13:25 ` Joel Brobecker
2014-07-11 13:49 ` Yao Qi
2014-07-11 7:34 ` [PATCH 0/4] Fix gdb.trace/entry-values.exp fails in thumb mode Yao Qi
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=1404367792-23234-5-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--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