LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-24-2008, 01:14 PM   #1
pchernik
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
Question 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
 
Old 06-24-2008, 05:24 PM   #2
gopherq
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Rep: Reputation: 0
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.
 
Old 06-25-2008, 09:35 AM   #3
pchernik
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by gopherq View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dumb question about gdb nc3b Programming 6 05-29-2007 08:36 AM
gdb c++ question markhod Programming 3 04-25-2007 02:45 PM
fortran debugging question with g77 and gdb miasmak Programming 1 08-16-2006 08:03 AM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 04:02 AM
a question about gdb captainstorm Programming 5 10-07-2003 12:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration