diff options
author | John Gilmore <gnu@cygnus> | 1991-07-21 13:02:48 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-07-21 13:02:48 +0000 |
commit | ef98d5ac064fde1ac8467067fbc639b9d84dfd17 (patch) | |
tree | eba27af98fb721b83cfd7319845cb615905688a9 /gdb/mtrace.c | |
parent | eb752e4e4efce02ce4a86fc4e5a8278d65e844b8 (diff) | |
download | gdb-ef98d5ac064fde1ac8467067fbc639b9d84dfd17.zip gdb-ef98d5ac064fde1ac8467067fbc639b9d84dfd17.tar.gz gdb-ef98d5ac064fde1ac8467067fbc639b9d84dfd17.tar.bz2 |
Mostly MIPS symbol-reading and general symbol-reading fixups.
Diffstat (limited to 'gdb/mtrace.c')
-rwxr-xr-x | gdb/mtrace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/mtrace.c b/gdb/mtrace.c index 06268c4..82e7f03 100755 --- a/gdb/mtrace.c +++ b/gdb/mtrace.c @@ -118,14 +118,19 @@ DEFUN(tr_reallochook, (ptr, size), PTR ptr AND size_t size) return hdr; } +/* We enable tracing if either the environment variable MALLOC_TRACE + is set, or if the variable mallwatch has been patched to an address + that the debugging user wants us to stop on. When patching mallwatch, + don't forget to set a breakpoint on tr_break! */ + void mtrace() { char *mallfile; mallfile = getenv (mallenv); - if (mallfile) { - mallstream = fopen (mallfile, "w"); + if (mallfile || mallwatch) { + mallstream = fopen (mallfile? mallfile: "/dev/null", "w"); if (mallstream) { /* Be sure it doesn't malloc its buffer! */ setbuf (mallstream, mallbuf); |