From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [OBV] Clean up gdb.trace/entry-values.exp
Date: Mon, 29 Dec 2014 07:42:00 -0000 [thread overview]
Message-ID: <1419838912-8732-1-git-send-email-yao@codesourcery.com> (raw)
This patch is to clean up gdb.trace/entry-values.exp as a preparation
of the next patch. It updates the comments to reflect the code.
One DIE generated in dwarf assembler is
GNU_call_site {
{low_pc "$bar_start + $bar_call_foo" addr}
{abstract_origin :$foo_label}
the DW_AT_low_pc attribute is the return address after the call, so I
rename variable bar_call_foo to returned_from_foo.
It is obvious, and I've pushed it in.
gdb/testsuite:
2014-12-29 Yao Qi <yao@codesourcery.com>
* gdb.trace/entry-values.exp: Update comments. Rename variable
bar_call_foo to returned_from_foo.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.trace/entry-values.exp | 18 +++++++++---------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1f08d80..b8cfe33 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-29 Yao Qi <yao@codesourcery.com>
+
+ * gdb.trace/entry-values.exp: Update comments. Rename variable
+ bar_call_foo to returned_from_foo.
+
2014-12-20 Mihail-Marian Nistor <mihail.nistor@freescale.com>
PR gdb/17394
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index 1b4d5cd..6bb0514 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -26,16 +26,16 @@ if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
return -1
}
-# Start GDB and load object file, compute the function length and
-# the offset of branch instruction in function. They are needed
-# in the Dwarf Assembler below.
+# Start GDB and load object file, compute the offset of the
+# instruction in bar returned from foo. It is needed in the Dwarf
+# Assembler.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}1.o
-set bar_call_foo ""
+set returned_from_foo ""
if { [istarget "arm*-*-*"] || [istarget "aarch64*-*-*"] } {
set call_insn "bl"
@@ -47,18 +47,18 @@ if { [istarget "arm*-*-*"] || [istarget "aarch64*-*-*"] } {
set call_insn "call"
}
-# Calculate the offset of the instruction bar calls foo.
+# Calculate the offset of the instruction in bar returned from foo.
set test "disassemble bar"
gdb_test_multiple $test $test {
-re ".*$hex <\\+$decimal>:\[ \t\]+$call_insn\[^\r\n\]+\r\n\[ \]+$hex <\\+($decimal)>:.*$gdb_prompt $" {
- set bar_call_foo $expect_out(1,string)
+ set returned_from_foo $expect_out(1,string)
}
-re ".*$gdb_prompt $" {
fail $test
}
}
-if { [string equal $bar_call_foo ""] } {
+if { [string equal $returned_from_foo ""] } {
fail "Find the call or branch instruction offset in bar"
# The following test makes no sense if the offset is unknown. We need
# to update the pattern above to match call or branch instruction for
@@ -72,7 +72,7 @@ gdb_exit
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
declare_labels int_label foo_label
- global bar_call_foo
+ global returned_from_foo
global srcdir subdir srcfile
set bar_result [function_range bar ${srcdir}/${subdir}/${srcfile}]
@@ -116,7 +116,7 @@ Dwarf::assemble $asm_file {
}
GNU_call_site {
- {low_pc "$bar_start + $bar_call_foo" addr}
+ {low_pc "$bar_start + $returned_from_foo" addr}
{abstract_origin :$foo_label}
} {
# Faked entry values are reference to variables 'global1'
--
1.9.3
reply other threads:[~2014-12-29 7:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1419838912-8732-1-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).