LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   AIX - gdb - command "info sh" stopped working between 7.4.1 and 7.5 (https://www.linuxquestions.org/questions/aix-43/aix-gdb-command-info-sh-stopped-working-between-7-4-1-and-7-5-a-4175492709/)

NevemTeve 01-27-2014 03:34 AM

AIX - gdb - command "info sh" stopped working between 7.4.1 and 7.5
 
I have compiled a few versions of gdb to find out when command "info sh" stopped working.

Test #1 with gdb-7.4.1
Code:

$ gdb-7.4.1 hello32
GNU gdb (GDB) 7.4.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.2.0.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/projects/proba/hello32...done.
(gdb) break main
Breakpoint 1 at 0x100003e4: file hello.c, line 7.
(gdb) run
Starting program: /home/projects/proba/hello32

Breakpoint 1, main () at hello.c:7
7          printf ("Hello, world\n");
(gdb) info sh
Text Range              Data Range              Syms    Shared Object Library
0xd007b21c-0xd007b93e  0xf02d8508-0xf02d8630  Yes    /usr/lib/libcrypt.a(shr.o)
0xd01e6f60-0xd03e7681  0xf0241b20-0xf02d7d30  Yes    /usr/lib/libc.a(shr.o)

Test #2 with gdb-7.5
Code:

$ gdb-7.5 hello32
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.2.0.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/projects/proba/hello32...done.
(gdb) break main
Breakpoint 1 at 0x100003e4: file hello.c, line 7.
(gdb) run
Starting program: /home/projects/proba/hello32

Breakpoint 1, main () at hello.c:7
7          printf ("Hello, world\n");
(gdb) info sh
No shared libraries loaded at this time.

So it works with 7.4.1, doesn't work with 7.5
Notes:
- it was the very same hello32 executable (compiled with gcc, linked with AIX ld)
- the same result with 64-bit version (-maix64)
- it does use shared lib: /usr/lib/libc.a(shr.o)
- both gdb version was compiled locally
- tested AIX versions: 5.2, 6.1

NevemTeve 01-28-2014 05:57 AM

file gdb-vvv/gdb/xcoffsolib.c might have something to do with the problem.

Code:

$ ls -l gdb*/gdb/xcoffsolib.c
-rw-rw-rw- 1    9176 65490 5052 Jan 12  2011 gdb-7.3.1/gdb/xcoffsolib.c
-rw-rw-rw- 1    9176 65490 5024 Jan  6  2012 gdb-7.4.1/gdb/xcoffsolib.c
-rw-rw-rw- 1    9176 65490 5061 Mar 12  2012 gdb-7.5/gdb/xcoffsolib.c
-rw-rw-rw- 1 projects ipsec 5028 Dec  8 05:33 gdb-7.6.2/gdb/xcoffsolib.c


NevemTeve 01-29-2014 10:26 AM

First result of examination:
both /gdb-7.5/gdb/solib.c:info_sharedlibrary_command and /gdb-7.5/gdb/xcoffsolib.c:solib_info implements command info sh, and (most likely) the former hides the latter.

NevemTeve 02-11-2014 10:04 AM

In gdb-7.6.2 it is solib.c:info_sharedlibrary_command function. Now I will try to comment this out and see what happens.

Edit: Here is the patch that makes "info sh" again:
Code:

--- solib.cold  2013-12-08 05:33:14 +0100
+++ solib.c    2014-02-11 17:01:38 +0100
@@ -946,6 +946,7 @@
    library matching PATTERN.  If PATTERN is elided, print them
    all.  */
 
+#ifndef _AIX
 static void
 info_sharedlibrary_command (char *pattern, int from_tty)
 {
@@ -1055,6 +1056,7 @@
                          "debugging information.\n"));
    }
 }
+#endif
 
 /* Return 1 if ADDRESS lies within SOLIB.  */
 
@@ -1457,8 +1459,10 @@
 
  add_com ("sharedlibrary", class_files, sharedlibrary_command,
          _("Load shared object library symbols for files matching REGEXP."));
+#ifndef _AIX
  add_info ("sharedlibrary", info_sharedlibrary_command,
            _("Status of loaded shared object libraries."));
+#endif
  add_com ("nosharedlibrary", class_files, no_shared_libraries,
          _("Unload all shared object library symbols."));

Edit: filed a bugreport: https://sourceware.org/bugzilla/show_bug.cgi?id=16556

NevemTeve 02-12-2014 01:51 PM

It works in gdb-7.7


All times are GMT -5. The time now is 03:53 PM.