This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Dwarf assembler: handle one instruction function
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 26 Feb 2015 14:21:57 -0000
- Subject: [binutils-gdb] Dwarf assembler: handle one instruction function
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=03eddd80d7c9b406109c43c07741c9991520954b
commit 03eddd80d7c9b406109c43c07741c9991520954b
Author: Yao Qi <yao.qi@linaro.org>
Date: Thu Feb 26 14:21:19 2015 +0000
Dwarf assembler: handle one instruction function
On aarch64, we got the following fail:
(gdb) disassemble func
Dump of assembler code for function func:
0x0000000000400730 <+0>: ret
End of assembler dump.^M
(gdb) x/2i func+0^M
0x400730 <func>: ret^M
0x400734 <main>: stp x29, x30, [sp,#-16]!^M
(gdb) FAIL: gdb.dwarf2/dw2-ifort-parameter.exp: x/2i func+0
the pattern in proc function_range expects to match <func+0>, however,
GDB doesn't display the offset when it is zero. This patch is to
adjust the pattern when $func_length is zero.
gdb/testsuite:
2015-02-26 Yao Qi <yao.qi@linaro.org>
* lib/dwarf.exp (function_range): Adjust pattern when $func_length
is zero.
Diff:
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/lib/dwarf.exp | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 504e2f0..d06b5e5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-26 Yao Qi <yao.qi@linaro.org>
+
+ * lib/dwarf.exp (function_range): Adjust pattern when $func_length
+ is zero.
+
2015-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/cordic.ko.bz2: New file.
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 8ea7a0f..19963c4 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -146,9 +146,14 @@ proc function_range { func src } {
}
# Compute the size of the last instruction.
+ if { $func_length == 0 } then {
+ set func_pattern "$func"
+ } else {
+ set func_pattern "$func\\+$func_length"
+ }
set test "x/2i $func+$func_length"
gdb_test_multiple $test $test {
- -re ".*($hex) <$func\\+$func_length>:\[^\r\n\]+\r\n\[ \]+($hex).*\.\r\n$gdb_prompt $" {
+ -re ".*($hex) <$func_pattern>:\[^\r\n\]+\r\n\[ \]+($hex).*\.\r\n$gdb_prompt $" {
set start $expect_out(1,string)
set end $expect_out(2,string)