Search the web
Sign In
New User? Sign Up
dmalloc · Debug Malloc Library (dmalloc) Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
autoconf dmalloc option   Message List  
Reply | Forward Message #128 of 529 |
[dmalloc] Re: autoconf dmalloc option

%% "Michael T. Babcock" <mikebabcock@...> writes:

mtb> If anyone out there has an example of dmalloc being used with
mtb> their program via an autoconf configure.in macro, I'd love to see
mtb> it.

mtb> ./configure --with-dmalloc

mtb> Would set the proper environment variables and link against dmalloc.

I set this up in FVWM:

In configure.in near the beginning:

AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc Enable support for the dmalloc debugging library],
[ac_cv_dmalloc="$enableval"],
[ac_cv_dmalloc="no"])

Then near the end, right before AC_OUTPUT():

dnl Allow building with dmalloc. Do this last to avoid screwing up any
dnl other checks above.

case "$ac_cv_dmalloc" in
yes) AC_CHECK_HEADERS(dmalloc.h)
AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
esac

Then in some global .h file:

/* Set up heap debugging library dmalloc. */

#ifdef HAVE_DMALLOC_H
# include <dmalloc.h>
#endif

Do it at the end of the .h file. You might also need to move this .h
file sometimes to be sure it comes after all system header files in your
source; see the dmalloc docs for this.

This is all I did, IIRC. It probably could use more sanity checking,
but...

Have fun!

--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@...> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.



Mon Mar 6, 2000 2:56 am

pausmith@...
Send Email Send Email

Forward
Message #128 of 529 |
Expand Messages Author Sort by Date

If anyone out there has an example of dmalloc being used with their program via an autoconf configure.in macro, I'd love to see it. I'm using automake/conf...
Michael T. Babcock
mikebabcock@...
Send Email
Mar 6, 2000
1:51 am

%% "Michael T. Babcock" <mikebabcock@...> writes: mtb> If anyone out there has an example of dmalloc being used with mtb> their program via an autoconf...
Paul D. Smith
pausmith@...
Send Email
Mar 6, 2000
2:56 am

I found it very useful not to modify to code or link with dmalloc, build dmalloc as a shared library, link with shared libraries, then use LD_PRELOAD before...
Marty Leisner
leisner@...
Send Email
Mar 6, 2000
2:01 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help