Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] testsuite: dw2-ranges: declare function descriptors for ppc64 compatibility
Date: Wed, 16 Feb 2011 19:31:00 -0000	[thread overview]
Message-ID: <1297882017-19802-1-git-send-email-emachado@linux.vnet.ibm.com> (raw)

Hi,

when running the testcase gdb.dwarf2/dw2-ranges.exp on ppc64, noticed that the
inferior fails in the first test (runto_main) with a segfault but then the
following 5 tests pass with success:

(gdb) break main
Breakpoint 1 at 0x10000584: file dw2-ranges.S, line 1.
(gdb) run 
Starting program: /home/gdb/builds/build-64bit/gdb/testsuite/gdb.dwarf2/dw2-ranges 

Program received signal SIGSEGV, Segmentation fault.
0x7d82100800000000 in ?? ()
(gdb) FAIL: gdb.dwarf2/dw2-ranges.exp: running to main in runto
info line main
Line 1 of "dw2-ranges.S" starts at address 0x10000584 <main> and ends at 0x10000588 <main2>.
(gdb) PASS: gdb.dwarf2/dw2-ranges.exp: info line main
...

The following patch adds function descriptors declarations to the inferior
source code (dw2-ranges*.S) for ppc64 compatibility. Successfully tested on
ppc32, ppc64 and x86 (however, I'm not sure if the current state of the
testcase is compatible with other architectures).

-- 
Edjunior Barbosa Machado
IBM Linux Technology Center


2011-02-16  Edjunior Machado  <emachado@br.ibm.com>

gdb/
	* gdb.dwarf2/dw2-ranges.S: Add .opd section with function
	descriptors for ppc64 compatibility.
	* gdb.dwarf2/dw2-ranges2.S: Likewise.
	* gdb.dwarf2/dw2-ranges3.S: Likewise.
---
 gdb/testsuite/gdb.dwarf2/dw2-ranges.S  |   19 +++++++++++++++++++
 gdb/testsuite/gdb.dwarf2/dw2-ranges2.S |   18 ++++++++++++++++++
 gdb/testsuite/gdb.dwarf2/dw2-ranges3.S |    9 +++++++++
 3 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.S b/gdb/testsuite/gdb.dwarf2/dw2-ranges.S
index f87e289..0400fdc 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.S
@@ -30,9 +30,18 @@
 	.text
 
 	.globl	main
+#ifdef __powerpc64__
+	.section	".opd","aw"
+main:
+	.quad .main, .TOC.@tocbase, 0
+	.section	".text"
+	.type	main, @function
+.main:	.int	0
+#else
 	.func	main
 main:	.int	0
 	.endfunc
+#endif
 	.size	main, . - main
 
 	/* `.fini' section is here to make sure `dw2-ranges.S'
@@ -40,7 +49,17 @@ main:	.int	0
 	.section	.fini, "ax", @progbits
 
 	.globl	func
+#ifdef __powerpc64__
+	.section	".opd","aw"
+func:
+	.quad .func, .TOC.@tocbase, 0
+	.section	".text"
+	.type	func, @function
+.func:
+	.size	func, . - func
+#else
 	.func	func
 func:	.int	0
 	.endfunc
+#endif
 	.size	func, . - func
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S b/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S
index e41e5b3..1e97471 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges2.S
@@ -30,9 +30,18 @@
 	.text
 
 	.globl	main2
+#ifdef __powerpc64__
+	.section	".opd","aw"
+main2:
+	.quad .main2, .TOC.@tocbase, 0
+	.section	".text"
+	.type	main2, @function
+.main2:	.int	0
+#else
 	.func	main2
 main2:	.int	0
 	.endfunc
+#endif
 	.size	main2, . - main2
 
 	/* `.fini' section is here to make sure `dw2-ranges.S'
@@ -40,7 +49,16 @@ main2:	.int	0
 	.section	.fini, "ax", @progbits
 
 	.globl	func2
+#ifdef __powerpc64__
+	.section	".opd","aw"
+func2:
+	.quad .func2, .TOC.@tocbase, 0
+	.section	".text"
+	.type	func2, @function
+.func2:	.int	0
+#else
 	.func	func2
 func2:	.int	0
 	.endfunc
+#endif
 	.size	func2, . - func2
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S b/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S
index e1539ce..ed1831d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges3.S
@@ -30,7 +30,16 @@
 	.text
 
 	.globl	main3
+#ifdef __powerpc64__
+	.section	".opd","aw"
+main3:
+	.quad .main3, .TOC.@tocbase, 0
+	.section	".text"
+	.type	main3, @function
+.main3:	.int	0
+#else
 	.func	main3
 main3:	.int	0
 	.endfunc
+#endif
 	.size	main3, . - main3
-- 
1.7.2.3


             reply	other threads:[~2011-02-16 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 19:31 Edjunior Barbosa Machado [this message]
2011-02-17  5:59 ` Joel Brobecker
2011-02-17 21:58   ` Jan Kratochvil
2011-02-17 22:31     ` obsolete: " Jan Kratochvil

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=1297882017-19802-1-git-send-email-emachado@linux.vnet.ibm.com \
    --to=emachado@linux.vnet.ibm.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