×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Getting stacktrace in running program without a debugger

Getting stacktrace in running program without a debugger

Getting stacktrace in running program without a debugger

(OP)
I am looking for some help help getting a stack trace in program that is executing.  In our new logging routines we want to include that stacktrace so we are able to tell what program that called the one of library functions is having the the problem.  We are running on a system using AIX 5.1.  I able to walk the prpgram stack and get all the return addresses and I also have had sucess reading in the symbol table but the problem I am having is how to map the symbol to the return adresss to get the function name.  Any help you can give would be appreciated.  Also the software package I work is written in C so how to do this in C is what i am looking for.  I know some other languages have this functionality builtin but this version of AIX and language does not so I have to implement it myself.

Thanks,

Randy.

Randy

RE: Getting stacktrace in running program without a debugger

1) Are you using XLC or gcc?

2) Do you have strace or truss?  You can use them to attach to the process.

3) You could also try /sbin/pstack.

RE: Getting stacktrace in running program without a debugger

(OP)
1) Are you using XLC or gcc?
gcc
2) Do you have strace or truss?  You can use them to attach to the process.
strace - Yes
truss - Yes
3) You could also try /sbin/pstack.
doesn't exist ont the system.


So how would I use truss or strace from withinside my program?
 

Randy

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close