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

Debugging tools

Hi all,

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?

aptitude install iraf saods9 eclipse xpa sextractor x11iraf wcstools pyraf


[1] http://lists.gnu.org/archive/html/bug-tar/2004-08/msg00004.html
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=262782

Attachment: signature.asc
Description: Digital signature

Reply to: