From owner-freebsd-questions Wed May 16 14:19:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ankimo.bigshed.com (dnai-216-15-97-193.cust.dnai.com [216.15.97.193]) by hub.freebsd.org (Postfix) with ESMTP id 393A037B422 for ; Wed, 16 May 2001 14:19:43 -0700 (PDT) (envelope-from kmarx@bigshed.com) Received: (from kmarx@localhost) by ankimo.bigshed.com (8.8.8/8.8.8) id OAA14331; Wed, 16 May 2001 14:27:58 -0700 (PDT) (envelope-from kmarx) Message-Id: <200105162127.OAA14331@ankimo.bigshed.com> Subject: mproff/c++ To: freebsd-questions@FreeBSD.ORG (questions freeBSD) Date: Wed, 16 May 2001 14:27:58 -0700 (PDT) Cc: kmarx@ankimo.bigshed.com (Kenneth J Marx) From: Ken Marx Reply-To: Ken Marx X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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(); } ------------------------------------------------------------------------- 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 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