Solved

Tracing Utility

Posted on 1998-05-19
4
159 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

756 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