Solved

Tracing Utility

Posted on 1998-05-19
4
156 Views
Last Modified: 2010-04-15
Hi,

Is there a utility for UNIX machines that acts like strace but will also show calls to your own functions, not just system calls? I have a program that works great inside GDB, but I take it out of the debugger, and suddenly a major system component starts acting strange, and I want to know where in the code this is happening, since the debuggeris of no use there.

         Jason
0
Comment
Question by:jwilcox
  • 2
4 Comments
 
LVL 3

Expert Comment

by:braveheart
ID: 1250834
It is always good practice to insert your own tracing code, at least at the beginning and end of all your functions, probably in macros, controlled by an appropriate compilation option.

For tracking array bounds errors, memory leaks, abuse of file descriptors and other such bugs, I recommend Purify. It is an essential tool for all serious code cutters.
0
 
LVL 3

Expert Comment

by:elfie
ID: 1250835
If you specify your OS, maybe someone can give hints towards some free/share ware products.

As bravehart mentioned Purify something *real-good*.

You can also try "profiling", if your compiler supports on your OS. (to be specified at compile time), and use prof, gprof afterwards(HPUX)
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1250836
As braveheart and elfie said, Purify could find such "strange behaviors" it also allows to trace your code.
0
 
LVL 3

Accepted Solution

by:
braveheart earned 50 total points
ID: 1250837
Use Purify - it isn't shareware but it is very good and not too expensive.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now