LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gdb / pstack question (https://www.linuxquestions.org/questions/linux-software-2/gdb-pstack-question-651322/)

pchernik 06-24-2008 01:14 PM

gdb / pstack question
 
Hi All,

On Solaris platform, when using dbx (or pstack) on a core file w/o symbol info I get back the function argument addresses. On the other hand, when using gdb on the same core file, the only thing shown is the function name, followed by ().

Example:
dbx: [1] strlen(0x0, 0x0, 0x5, 0x7efefeff, 0x81010100, 0xffbee178), at 0xff1332ec
gdb: #0 0xff1332ec in strlen () from /usr/lib/libc.so.1

Question: is it possible to achieve the same thing with gdb (ability to see function argument addresses)? If not, is there another utility that can be used?

We're planning to move to the Linux platform... I've been trying to figure out a Linux equivalent for Solaris version of pstack to produce stack traces for a core file, but so far I haven't been able to find ANYTHING. Linux version of pstack only works on a running process. I compiled "lsstack", but that also only operated only on a process (contrary to what several sources say).

Full stack trace for both:

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
current thread: t@1
[1] strlen(0x0, 0x0, 0x5, 0x7efefeff, 0x81010100, 0xffbee178), at 0xff1332ec
[2] gethostbyname_r(0x0, 0x251d4, 0x251e8, 0x920, 0x251d4, 0xff31ef68), at 0xff2b61c8
[3] fm_ptd_pol_check_ldap(0x62678, 0x5fb50, 0x62740, 0xffbeee70, 0x0, 0xffbeee70), at 0xfd406ea0
[4] op_ptd_login_exist(0xfe7dd13c, 0x186e0, 0x0, 0x5fb50, 0x62740, 0xffbeee70), at 0xfd4054e8
[5] cm_custom(0xfe7dd13c, 0x22f58, 0x186e0, 0x0, 0x0, 0xffbef120), at 0xfe75285c
[6] cm_child(0x9, 0xfe000044, 0xfe7dd13c, 0xffbef534, 0x22f58, 0xfe000071), at 0xfe74f210
[7] main(0x1, 0xffbef734, 0xff1be5d8, 0xff11bc20, 0xff3b0000, 0x0), at 0xfe745210
=>[8] main(argc = 1, argv = 0xffbef734), line 33 in "cm.c"

(gdb) where
#0 0xff1332ec in strlen () from /usr/lib/libc.so.1
#1 0xff2b61d0 in gethostbyname_r () from /usr/lib/libnsl.so.1
#2 0xfd406ea8 in fm_ptd_pol_check_ldap () from /global/opt/portal/6.2/pin4/lib/fm_ptd.so
#3 0xfd4054f0 in op_ptd_login_exist () from /global/opt/portal/6.2/pin4/lib/fm_ptd.so
#4 0xfe752864 in cm_custom () from /global/opt/portal/6.2/pin4/lib/libcm_main.so
#5 0xfe74f218 in cm_child () from /global/opt/portal/6.2/pin4/lib/libcm_main.so
#6 0xfe745218 in main () from /global/opt/portal/6.2/pin4/lib/libcm_main.so
#7 0x10cb0 in main (argc=1, argv=0xffbef734) at /pinbuild/cc_builds/6.2_SP4_idc_0912.1300/solaris/legacy_vob/continuus/All_Server~continuus/All_Server/cm:33

Thank you in advance for any ideas / suggestions.
-Pavel

gopherq 06-24-2008 05:24 PM

Doesn't "info args" in gdb help?
It should give you the argument information for the current frame.
If you need more info, you can do "return" and "info args" repeatedly to get the information for the whole stack.

pchernik 06-25-2008 09:35 AM

Quote:

Originally Posted by gopherq (Post 3193962)
Doesn't "info args" in gdb help?
It should give you the argument information for the current frame.
If you need more info, you can do "return" and "info args" repeatedly to get the information for the whole stack.

Thanks for the reply!

gdb "info args" doesn't show anything where there is no symbol table found.

Solaris dbx (or pstack) always shows argument addresses (even if it doesn't know anything else about the arguments)...

(gdb) up
#3 0xf7eba789 in cm_pre_pcm_op ()
from /global/opt/portal/user/prj/7.3/lib/libcmpin.so
(gdb) info args
No symbol table info available.

Thanks,
-Pavel


All times are GMT -5. The time now is 09:30 AM.