[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-devtools
Subject:    Re: HPUX-DEVTOOLS: GDB:  set heap-check on
From:       srikanth <srikanth () cup ! hp ! com>
Date:       2001-03-28 19:22:56
[Download RAW message or body]

Terry Gin wrote:

> Hello all,
>
> I am attempting to use GDB's heap-check support to detect whether my app
> has any heap leaks.  I am able to run "info leaks" at a breakpoint to
> determine if there are any outstanding leaks at a given point during
> execution.  However, I'd like to just run my app, have it terminate
> normally, and have GDB give me a list of heap leaks.

    Set a breakpoint on exit() and let the program run full swing. The
advantage to setting a breakpoint in some other procedure is that you get a
sense of when a leak happened. However if you don't care for this, setting a
breakpoint on exit is the way to go.


> The documentation
> seems to indicate that GDB will do this if my app terminates with a call
> to exit ().  However, GDB does not give me a heap report after my app
> exits.

    This is only for the batch mode. As you point out the batch mode is
really very primitive. It is useful in cases where you can run your program
against a testsuite to see what cases cause a memory leak. Afterwards you
need to run it in interactive mode with the same input to see the stack
trace and such much.


Thanks
Srikanth


 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE hpux-devtools
 _________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic