Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* info files' Entry point on ppc64
@ 2010-09-08 16:37 Edjunior Barbosa Machado
  2010-09-09 14:05 ` [patch] [ppc64] testsuite: break-interp.exp [Re: info files' Entry point on ppc64] Jan Kratochvil
       [not found] ` <20100909140513.GA20677__33509.653612464$1284041144$gmane$org@host1.dyn.jankratochvil.net>
  0 siblings, 2 replies; 6+ messages in thread
From: Edjunior Barbosa Machado @ 2010-09-08 16:37 UTC (permalink / raw)
  To: gdb

Hi,

checking the log from break-interp.exp testcase on ppc64, noticed that gdb is not properly setting a break at the entry point:

info files
Unix child process:
         Using the running image of child process 22491.
         While running this, GDB does not access memory from...
Local exec file:
         `/home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES', file type elf64-powerpc.
         Entry point: 0x251c11e0
         0x00000000251b0200 - 0x00000000251b0250 @ 0x00000200 is .interp
...skipping...
(gdb) PASS: gdb.base/break-interp.exp: LDprelinkNOdebugNO: BINprelinkNOdebugNOpieYES: symbol-less: info files
break *0x251c11e0
Breakpoint 2 at 0x251c11e0
(gdb) PASS: gdb.base/break-interp.exp: LDprelinkNOdebugNO: BINprelinkNOdebugNOpieYES: symbol-less: break at entry point
continue
Continuing.
Reading symbols from /home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES.d/break-interp.so...done.
Loaded symbols for /home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES.d/break-interp.so
Reading symbols from /home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES.d/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES.d/libm.so.6
Reading symbols from /home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES.d/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /home/emachado/build-7.2/gdb/testsuite/gdb.base/break-interp-BINprelinkNOdebugNOpieYES.d/libc.so.6

Program received signal SIGSEGV, Segmentation fault.
0x7d821008251b0a90 in ?? ()
(gdb) FAIL: gdb.base/break-interp.exp: LDprelinkNOdebugNO: BINprelinkNOdebugNOpieYES: symbol-less: entry point reached

In fact, the entry point address from 'info files' points to the function descriptor structure existing on ppc64 arch. If we check the first doubleword of this structure, then we have the correct entry point address. I've also noticed that ppc-linux-tdep.c implements gdbarch_convert_from_func_ptr_addr function for ppc64, so I was wondering if adding support for adjust_breakpoint_address on ppc64 wouldn't be a solution for this case. Also, for what it's worth, I checked the entry point address using readelf and it reports the same as 'info files' does.

Any suggestions are welcome.

Thanks,
-- 
Edjunior Barbosa Machado
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch] [ppc64] testsuite: break-interp.exp  [Re: info files' Entry point on ppc64]
  2010-09-08 16:37 info files' Entry point on ppc64 Edjunior Barbosa Machado
@ 2010-09-09 14:05 ` Jan Kratochvil
  2010-09-10 14:55   ` Edjunior Barbosa Machado
       [not found] ` <20100909140513.GA20677__33509.653612464$1284041144$gmane$org@host1.dyn.jankratochvil.net>
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Kratochvil @ 2010-09-09 14:05 UTC (permalink / raw)
  To: Edjunior Barbosa Machado; +Cc: gdb, gdb-patches

On Wed, 08 Sep 2010 18:36:55 +0200, Edjunior Barbosa Machado wrote:
>         Entry point: 0x251c11e0
> break *0x251c11e0
> Program received signal SIGSEGV, Segmentation fault.
> 0x7d821008251b0a90 in ?? ()

OK, thanks for the bugreport, fix attached.

OTOH still both ppc64->ppc32 and ppc64->ppc64 produce a lot of FAILs which
I do not see obvious (such as some `seen displacement message as ZERO' which
should have 0 displacement as being prelinked); I can check them later.


Regards,
Jan


gdb/testsuite/
2010-09-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/break-interp.exp (reach): Permit leading . for ppc64.
	(test_ld) <powerpc64-*>: New.

--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -136,10 +136,10 @@ proc reach {func command displacement} {
 		}
 		exp_continue
 	    }
-	    -re "Breakpoint \[0-9\]+, $func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
+	    -re "Breakpoint \[0-9\]+, \\.?$func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
 		pass $test
 	    }
-	    -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in $func \\(\\).*\r\n$gdb_prompt $" {
+	    -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in \\.?$func \\(\\).*\r\n$gdb_prompt $" {
 		pass $test
 	    }
 	}
@@ -399,6 +399,17 @@ proc test_ld {file ifmain trynosym displacement} {
 		pass $test
 	    }
 	}
+	# `info sym' cannot be tested for .opd as the binary may not have
+	# symbols.
+	if [istarget powerpc64-*] {
+	    set test "convert entry point"
+	    gdb_test_multiple "p *(void(*)(void) *) 0x$entrynohex" $test {
+		-re " =( \\(\[^0-9\]*\\))? 0x(\[0-9a-f\]+)( < \[^\r\n\]*)?\r\n$gdb_prompt $" {
+		    set entrynohex $expect_out(2,string)
+		    pass $test
+		}
+	    }
+	}
 	if {$entrynohex != ""} {
 	    gdb_test "break *0x$entrynohex" "" "break at entry point"
 	    gdb_test "continue" "\r\nBreakpoint \[0-9\]+, 0x0*$entrynohex in .*" "entry point reached"


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] [ppc64] testsuite: break-interp.exp  [Re: info files' Entry point on ppc64]
       [not found] ` <20100909140513.GA20677__33509.653612464$1284041144$gmane$org@host1.dyn.jankratochvil.net>
@ 2010-09-09 19:56   ` Tom Tromey
  2010-09-09 20:01     ` Jan Kratochvil
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2010-09-09 19:56 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Edjunior Barbosa Machado, gdb, gdb-patches

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> OK, thanks for the bugreport, fix attached.

Jan> 2010-09-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan> 	* gdb.base/break-interp.exp (reach): Permit leading . for ppc64.
Jan> 	(test_ld) <powerpc64-*>: New.

This is ok.

Tom


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] [ppc64] testsuite: break-interp.exp  [Re: info files' Entry point on ppc64]
  2010-09-09 19:56   ` Tom Tromey
@ 2010-09-09 20:01     ` Jan Kratochvil
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kratochvil @ 2010-09-09 20:01 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Edjunior Barbosa Machado, gdb, gdb-patches

On Thu, 09 Sep 2010 21:56:32 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> Jan> 2010-09-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
> Jan> 	* gdb.base/break-interp.exp (reach): Permit leading . for ppc64.
> Jan> 	(test_ld) <powerpc64-*>: New.
> 
> This is ok.

Checked-in:
	http://sourceware.org/ml/gdb-cvs/2010-09/msg00070.html


Thanks,
Jan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] [ppc64] testsuite: break-interp.exp  [Re: info files' Entry point on ppc64]
  2010-09-09 14:05 ` [patch] [ppc64] testsuite: break-interp.exp [Re: info files' Entry point on ppc64] Jan Kratochvil
@ 2010-09-10 14:55   ` Edjunior Barbosa Machado
  2010-09-10 15:51     ` Jan Kratochvil
  0 siblings, 1 reply; 6+ messages in thread
From: Edjunior Barbosa Machado @ 2010-09-10 14:55 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb, gdb-patches



On 09/09/2010 11:05 AM, Jan Kratochvil wrote:
> On Wed, 08 Sep 2010 18:36:55 +0200, Edjunior Barbosa Machado wrote:
>>          Entry point: 0x251c11e0
>> break *0x251c11e0
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x7d821008251b0a90 in ?? ()
>
> OK, thanks for the bugreport, fix attached.
>
> OTOH still both ppc64->ppc32 and ppc64->ppc64 produce a lot of FAILs which
> I do not see obvious (such as some `seen displacement message as ZERO' which
> should have 0 displacement as being prelinked); I can check them later.
>
Hi Jan,

thanks for the patch, but it seems it doesn't work properly when testing 32-bit gdb in a 64-bit environment. Using is_lp64_target should avoid this issue.

Thanks,
--
Edjunior Barbosa Machado
IBM Linux Technology Center




gdb/testsuite/

2010-09-10  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>



	* gdb.base/break-interp.exp: add is_lp64_target to check 64bit target



--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -401,7 +401,7 @@ proc test_ld {file ifmain trynosym displacement} {
  	}
  	# `info sym' cannot be tested for .opd as the binary may not have
  	# symbols.
-	if [istarget powerpc64-*] {
+	if {[istarget powerpc64-*] && [is_lp64_target]} {
  	    set test "convert entry point"
  	    gdb_test_multiple "p *(void(*)(void) *) 0x$entrynohex" $test {
  		-re " =( \\(\[^0-9\]*\\))? 0x(\[0-9a-f\]+)( < \[^\r\n\]*)?\r\n$gdb_prompt $" {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] [ppc64] testsuite: break-interp.exp  [Re: info files' Entry point on ppc64]
  2010-09-10 14:55   ` Edjunior Barbosa Machado
@ 2010-09-10 15:51     ` Jan Kratochvil
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kratochvil @ 2010-09-10 15:51 UTC (permalink / raw)
  To: Edjunior Barbosa Machado; +Cc: gdb

On Fri, 10 Sep 2010 16:54:52 +0200, Edjunior Barbosa Machado wrote:
> thanks for the patch, but it seems it doesn't work properly when testing
> 32-bit gdb in a 64-bit environment. Using is_lp64_target should avoid this
> issue.

True, thanks.  But I made this mistake as this testcase does not work anyway.
I haven't checked it more but at least part of it seems to unexpected behavior
of ppc64 kernel to the PIE executables placement.

kernel-2.6.32-70.el6.ppc64

With your patch:
-m64 target:
# of expected passes		2536
# of unexpected failures	254

-m32 target:
# of expected passes		1731
# of unexpected failures	114



Thanks,
Jan


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-10 15:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 16:37 info files' Entry point on ppc64 Edjunior Barbosa Machado
2010-09-09 14:05 ` [patch] [ppc64] testsuite: break-interp.exp [Re: info files' Entry point on ppc64] Jan Kratochvil
2010-09-10 14:55   ` Edjunior Barbosa Machado
2010-09-10 15:51     ` Jan Kratochvil
     [not found] ` <20100909140513.GA20677__33509.653612464$1284041144$gmane$org@host1.dyn.jankratochvil.net>
2010-09-09 19:56   ` Tom Tromey
2010-09-09 20:01     ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox