This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: set sysroot command on AIX has no effect.


Hi,

Please review the attached patch and let me know the comments.

Thanks & Regards,
-Sangamesh
AIX BOS Development



From:   Sangamesh Mallayya/India/IBM
To:     gdb-patches@sourceware.org
Date:   09/13/2016 02:34 PM
Subject:        set sysroot command on AIX has no effect.


set sysroot command on AIX has no effect if a program depends on shared 
library archives (.a).

This is the original behaviour if we use "set sysroot" command.

(gdb) set sysroot /tmp
warning: while parsing aix library list: no element found
(gdb) file /home/sysroot/testApp
Reading symbols from /home/sysroot/testApp...done.
(gdb) core-file /home/sysroot/core
warning: core file may not match specified executable file.
warning: Unexpected size of section `.reg' in core file.
warning: Could not open `/home/sysroot/libTest.a' as an executable file: A 
file or directory in the path name does not exist.
warning: Could not load shared library symbols for 
/home/sysroot/libTest.a(func.o).
Do you need "set solib-search-path" or "set sysroot"?
Program terminated with signal SIGABRT, Aborted.
warning: Unexpected size of section `.reg' in core file.
#0  0xd013a820 in raise () from /usr/lib/libc.a(shr.o)
(gdb) info sharedlibrary 
From        To          Syms Read   Shared Object Library
0xd04da240  0xd04daa3e  Yes (*)     /usr/lib/libcrypt.a(shr.o)
                                        No /home/sysroot/libTest.a(func.o)
0xd010c880  0xd049b13d  Yes (*)     /usr/lib/libc.a(shr.o)
(*): Shared library is missing debugging information.
(gdb) bt
#0  0xd013a820 in raise () from /usr/lib/libc.a(shr.o)
#1  0xd01b3088 in abort () from /usr/lib/libc.a(shr.o)
#2  0xd2fd82a4 in ?? ()
#3  0x100003a4 in main () at main.c:8
(gdb) 
 

After applying the attached patch.
Patch doesn't cause any change in original behaviour while handling shared 
library with .so names.

".a" name archives case.

(gdb) set sysroot /tmp 
warning: while parsing aix library list: no element found
(gdb) file /home/sysroot/testApp 
Reading symbols from /home/sysroot/testApp...done.
(gdb) core-file /home/sysroot/core
warning: core file may not match specified executable file.
warning: Unexpected size of section `.reg' in core file.
Program terminated with signal SIGABRT, Aborted.
warning: Unexpected size of section `.reg' in core file.
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
(gdb) inf sharedlibrary 
From             To                   Syms Read   Shared Object Library
0xd04da240  0xd04daa3e  Yes    (*)       /tmp/usr/lib/libcrypt.a(shr.o)
0xd2fd6250   0xd2fd64aa   Yes /tmp/home/sysroot/libTest.a(func.o)
0xd010c880  0xd049b13d  Yes    (*)       /tmp/usr/lib/libc.a(shr.o)
(*): Shared library is missing debugging information.
(gdb) bt
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
#1  0xd01b3088 in abort () from /tmp/usr/lib/libc.a(shr.o)
#2  0xd2fd6364 in func () from /tmp/home/sysroot/libTest.a(func.o)
#3  0x100003a4 in main () at main.c:8
(gdb) 


.a & .so library names

(gdb) set sysroot /tmp
warning: while parsing aix library list: no element found
(gdb) file /home/sysroot/testApp 
Reading symbols from /home/sysroot/testApp...done.
(gdb) core-file /home/sysroot/core
warning: core file may not match specified executable file.
warning: Unexpected size of section `.reg' in core file.
Program terminated with signal SIGABRT, Aborted.
warning: Unexpected size of section `.reg' in core file.
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
(gdb) info sharedlibrary 
From             To                   Syms Read   Shared Object Library
0xd04da240  0xd04daa3e  Yes    (*)        /tmp/usr/lib/libcrypt.a(shr.o)
0xd2536250  0xd25499fc   Yes 
/tmp/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/libgcc_s.a(shr.o)
0xd0566c80  0xd0566db6  Yes    (*)        /tmp/usr/lib/librtl.a(shr.o)
0xd010c880  0xd049b13d  Yes    (*)        /tmp/usr/lib/libc.a(shr.o)
0xd2fd7150   0xd2fd78e1   Yes               /tmp/home/sysroot/libTest.so
(*): Shared library is missing debugging information.
(gdb) bt
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
#1  0xd01b3088 in abort () from /tmp/usr/lib/libc.a(shr.o)
#2  0xd2fd749c in func () from /tmp/home/sysroot/libTest.so
#3  0x100003fc in main () at main.c:8
(gdb)


Please review and let me know the comments.

[attachment "ChangeLog" deleted by Sangamesh Mallayya/India/IBM] 
[attachment "set_sysroot.patch" deleted by Sangamesh Mallayya/India/IBM] 

Thanks & Regards,
-Sangamesh
AIX BOS Development



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]