[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debugging tools

On Wed, Aug 04, 2004 at 11:55:09AM -0400, Justin Pryzby wrote:
> Re: recent debugging / library topics, I thought I'd share my latest
> find and ask for pointers too.  I recently read ld(1); it is not a page
> turner, at least not until I saw --wrap.  4 lines of code is a thousand
> words, so:
> 	void *__wrap_malloc (int c)
> 	{
> 		printf ("malloc called with %ld\n", c);
> 		return __real_malloc(c);
> 	}
> It lets you put a wrapper around arbitrary functions .. without playing
> tricks with #define!
> This would've helped me finding a bug in tar (!) a few days ago, instead
> of manually wrapping each occurance of free().  [1].
> Hey, does anyone know if people actually read the debian-glibc list?
> The tar bug is actually a glibc problem, [2], and nobody's commented on
> the list or on the bug.  And I don't feel like making a sources.redhat
> account to report it in upstream bugzilla..
> Now my question.  Is there a package (debian or otherwise) which will
> show me the possible function call paths?  I want something that will
> look through code and show me (graphically maybe) that X calls Y which
> calls Z which calls X, so there's recursion there, and A calls B and C
> calls D in a loop.  Maybe even smart enough to deal with conditions (E
> calls F _or_ G).  Ideas?

You're talking about distinct topics here; you might have better luck
splitting them up into separate posts.  You also replied to another, unrelated
message when posting this, which caused this post to be threaded under it.
Don't do that; post a new message, so it doesn't make a mess of threads and
cause people to miss your post.

Glenn Maynard

Reply to: