Date: Wed, 16 May 2001 14:27:58 -0700 (PDT) From: Ken Marx <kmarx@bigshed.com> To: freebsd-questions@FreeBSD.ORG (questions freeBSD) Cc: kmarx@ankimo.bigshed.com (Kenneth J Marx) Subject: mproff/c++ Message-ID: <200105162127.OAA14331@ankimo.bigshed.com>
next in thread | raw e-mail | index | archive | help
Hi, Is there some reason why mprof barfs on c++ binaries? See below for reproduction. (The man page does reference problems with using valloc and memalign, but I put my test binary in gdb with breakpoints for these and they never got hit. Both these symbols are defined in the binary even if I take out the c++ code.) thanks, k. -- Ken Marx, kmarx@bigshed.com OK. This is a tough pill to swallow but we must recognize who our customers are and motivate the troops for the solution space. - http://cgi.bigshed.com/~kmarx/cgi-bin/speak.cgi ------------------------------------------------------------------------------- The source: [sploot] /tmp <356> cat jnk.c #include "stdlib.h" class dog { public: dog(); ~dog(); }; dog::dog() { } dog::~dog() { } main() { int i=3; static char *s = "fyuc"; char *m = (char *)malloc( 10 ); dog *breath = new dog(); } ----------------------------------<snip>--------------------------------------- the compile, run, mprof phases: [sploot] /tmp <357> g++ -g jnk.c -lc_mp [sploot] /tmp <358> a.out [sploot] /tmp <359> mprof -verbose a.out --c20+--v3.0+--m3+--+--+--+--+--+--+--+--+ MPROF +--+--+--+--+--+--+--s0+--f0+--d0+--l0+ --------- Allocation Bins with possible Types ------------ size: allocs bytes (%) frees kept (%) types 1 1 1 (9) 0 1 (9) dog 10 1 10 (90) 0 10 (90) > 1024 0 0 0 0 <TOTAL> 2 11 1 11 --------- Partial Dynamic Call Paths for Memory Leaks ------------ Total bytes not freed: 11 kept bytes (%) allocs bytes (%) path 10 (90) 1 10 (90) || > _start > main Segmentation fault (core dumped) ------------------------------------------------------------------------------- [sploot] /tmp <365> wc mprof.data 2083 2176 4507 mprof.data To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105162127.OAA14331>