Bug 200533 - remotely PPU64 gdb does not step after breakpoint
remotely PPU64 gdb does not step after breakpoint
Status: CLOSED DUPLICATE of bug 192964
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
5
powerpc Linux
medium Severity urgent
: ---
: ---
Assigned To: Jan Kratochvil
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-28 10:34 EDT by IBM Bug Proxy
Modified: 2010-03-15 11:11 EDT (History)
1 user (show)

See Also:
Fixed In Version: gdb-6.5-5.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-25 10:32:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description IBM Bug Proxy 2006-07-28 10:34:43 EDT
LTC Owner is: gilliam@us.ibm.com
LTC Originator is: robbiew@us.ibm.com


Problem description:
- When debugging remotely a 32bit PPU application, with cross x86-ppu gdb (in
x86) and gdbserver (in Mambo cell simulator), one can´t step after reaching a
breakpoint.

Provide output from "uname -a", if possible:
- Linux (none) 2.6.16-bsc4.2cbesim #1 SMP Wed Jul 5 09:41:46 CEST 2006 ppc64
ppc64 ppc64 GNU/Linux

Hardware Environment
- Mambo simulator for cell (Fedora 5)
- SDK 1.1 20060705

Is this reproducible?
    Describe the steps:
        Host x86 

 

        # ppuxlc -O0 -g -c -q32 -ohello.o ../hello.c 

        # ppuxlc -q32 -ohello ./hello.o 



        Target Mambo



        # gdbserver :2345 hello & 



        Host x86 


        # ppu64-gdb hello 

        (gdb) target remote 172.20.0.2:2345 

        Remote debugging using 172.20.0.2:2345 

        0xf7ff80f0 in ?? () 

        warning: Unable to find dynamic linker breakpoint function. 

        GDB will be unable to debug shared library initializers 

        and track explicitly loaded dynamic code.

        (gdb) l 

        1       #include <stdio.h> 

        2

        3

        4       int main(void) { 

        5

        6               printf("Hello World!\n"); 

        7               return 0; 

        8

        9       } 

        (gdb) br 6 

        Breakpoint 1 at 0x100004c0: file ../hello.c, line 6. 

        (gdb) c 

        Continuing. 

        Error while mapping shared library sections: 

        /lib/ld.so.1: No such file or directory. 

        Error while reading shared library symbols: 

        /lib/ld.so.1: No such file or directory. 



        Breakpoint 1, main () at ../hello.c:6 

        6               printf("Hello World!\n"); 

        (gdb) s

        0x10000850 in call___do_global_ctors_aux () 

        (gdb)

Additional information:
- Local debugging is working.
- x86-ppu32 gdb also has the same problem.
- both xlc and gcc compiled binaries present the same problem
Comment 1 IBM Bug Proxy 2006-07-28 10:40:23 EDT
Paul Gilliam proposed this fix 


2006-05-12  Paul Gilliam  <pgilliam@us.ibm.com>

	* minsyms.c (lookup_minimal_symbol_by_pc_section): Don't ignore
	minimal symbols for solib trampolines just because they're in a
	different section than the PC.


Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.45
diff -a -u -r1.45 minsyms.c
--- minsyms.c   17 Dec 2005 22:34:01 -0000      1.45
+++ minsyms.c   12 May 2006 22:17:06 -0000
@@ -486,6 +486,8 @@
                          don't fill the bfd_section member, so don't
                          throw away symbols on those platforms.  */
                       && SYMBOL_BFD_SECTION (&msymbol[hi]) != NULL
+                      /* Don't ignore symbols for solib trampolines */
+                      && MSYMBOL_TYPE (&msymbol[hi]) != mst_solib_trampoline
                       && SYMBOL_BFD_SECTION (&msymbol[hi]) != section)
                  --hi;



Comment 2 IBM Bug Proxy 2006-07-28 10:41:28 EDT
------- Additional Comment #17 From Ricardo Marin Matinata 2006-07-27 15:53 EDT 

Tryed Paul's patch. It works for printf(). I'm still investigating if it works
with my own dynamic linked functions. 

------
fibo.h
------
#ifndef FIBO_H
#define FIBO_H

unsigned int fibn(unsigned int n);

#endif

------
fibo.c
------
#include "fibo.h"

unsigned int
fibn(unsigned int n)
{
    if (n <= 2)
        return 1;
    return (fibn (n-1) + fibn (n-2));
}

--------
simple.c
--------
#include <stdio.h>
#include "fibo.h"

int main(int argc, char **argv)
{
    unsigned int c;
    c = fibn (8);
    printf ("c=%d\n", c);
}

COMPILE:
>gcc -m32 -g -c fibo.c
>gcc -m32 -shared -o libfibo.so fibo.o
>gcc -m32 -g -c simple.c
>gcc -m32 -o simple simple.o -L. -lfibo

DEBUG:
>gdbserver :2345 simple &
>gdb simple
(gdb)target remote :2345
Comment 3 IBM Bug Proxy 2006-08-08 15:35:15 EDT
----- Additional Comments From robbiew@us.ibm.com  2006-08-08 15:41 EDT -------
Patch was tested successfully and our team continues to develop code, assuming
the bug will be fixed in Fedora.  If the patch is not accepted upstream and/or
by Red Hat for Fedora Core...we will have a problem. 
Comment 8 Alexandre Oliva 2006-08-24 03:13:07 EDT
gdb-6.5-5 should hit rawhide today, containing a fix for this bug.
Comment 9 Jan Kratochvil 2006-12-19 18:04:53 EST

*** This bug has been marked as a duplicate of 192964 ***
Comment 10 Jan Kratochvil 2010-03-14 19:17:29 EDT
FYI dropping this patch as it is still causing regressions and I do not see why it would be needed.  It works for me with current FSF GDB HEAD:

This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=ppc64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jkratoch/redhat/gdb-test-ppc32/gdb/hello...done.
Remote debugging using :5000
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0xf79f7d54 in ?? ()
(gdb) b main
Breakpoint 1 at 0x10000490: file hello.c, line 6.
(gdb) c
Continuing.
Error while mapping shared library sections:
`/lib/libc.so.6': not in executable format: File format is ambiguous
Error while mapping shared library sections:
/lib/ld.so.1: No such file or directory.

Breakpoint 1, main () at hello.c:6
6	  printf ("Hello World!\n");
(gdb) s
7	  return 0;
(gdb)
Comment 11 IBM Bug Proxy 2010-03-15 11:11:32 EDT
------- Comment From Ulrich.Weigand@de.ibm.com 2010-03-15 11:00 EDT-------
(In reply to comment #35)
> FYI dropping this patch as it is still causing regressions and I do not see why
> it would be needed.  It works for me with current FSF GDB HEAD:

Yes, this patch is no longer needed as the underlying problem is now fixed
cleanly in GDB mainline since about May 2008, due to:
http://sourceware.org/ml/gdb-patches/2008-05/msg00451.html
and a couple of related fixes.

Note You need to log in before you can comment on or make changes to this bug.