|
#
gdb -q func
(gdb) b main
Breakpoint 1 at 0x4000880:2: file func.c, line 11.
(gdb) set heap-check on
(gdb) r
Starting program: /muthu/leak/func
Breakpoint 1, main () at func.c:11
11
host();
(gdb) s
warning: The Unwind info header section .IA_64_unwind_hdr is missing
Skipping this library /usr/lib/hpux32/libcl.so.1.
host () at test.c:17
17
testname=(char *)malloc(1024*sizeof(char));
(gdb)
18
bzero((void *)testname,1024*sizeof(char));
(gdb)
20
gethostname(hostname,sizeof(hostname));
(gdb)
21
(void)printf("\nHostname = %s\n",hostname);
(gdb)
Hostname = ntc63
23
strcpy(testname,hostname);
(gdb)
24
(void)printf("\nTestname = %s\n",testname);
(gdb)
Testname = ntc63
25
}
(gdb)
main () at func.c:12
12
}
(gdb) info leaks
Scanning for memory leaks...
1024
bytes leaked in 1 blocks
No. Total bytes
Blocks Address Function
0
1024
1 0x404054a0 host()
(gdb) s
0x20000000777abcc0:0 in main_opd_entry+0x50 () from
/usr/lib/hpux32/dld.so
(gdb)
Single stepping until exit from function main_opd_entry,
which has no line number information.
0x20000000777abc50:0 in enter_main_opd+0x40 () from
/usr/lib/hpux32/dld.so
(gdb)
Single stepping until exit from function enter_main_opd,
which has no line number information.
0x20000000777b11d0:0 in dld_main_startup+0xf50 () from
/usr/lib/hpux32/dld.so
(gdb)
Single stepping until exit from function dld_main_startup,
which has no line number information.
warning: Cannot insert breakpoint 0: in /usr/lib/hpux32/dld.so
warning: dld.so is a shared library and will never be loaded
warning: as private, so breakpoint 0 has been ignored.
warning: Temporarily disabling shared library breakpoints:
0
Program exited normally.
(gdb)
|
|