Debugging Dynamic Memory Usage Errors Using HP WDB
Breakpoint 2, test_null_check () at null-check.c:19
19 printf("Out of memory scenario simulated\n");
(gdb) p i
$1 = 4
(gdb) c
Continuing.
warning: Malloc is returning simulated 0x00000000 value
0x70e78e8c in __rtc_nomem_event+0x4 () from /opt/langtools/lib/librtc.sl
(gdb) bt
#0 0x70e78e8c in __rtc_nomem_event+0x4 () from /opt/langtools/lib/librtc.sl
#1 0x70e7b554 in handle_null_check+0x134 () from /opt/langtools/lib/librtc.sl
#2 0x70e7b614 in malloc+0xb4 () from /opt/langtools/lib/librtc.sl
#3 0x2c04 in test_null_check () at null-check.c:17
#4 0x2c70 in main () at null-check.c:25
#5 0x70ee3478 in _start+0xc0 () from /usr/lib/libc.2
(gdb) c
Continuing.
Breakpoint 2, test_null_check () at null-check.c:19
19 printf("Out of memory scenario simulated\n");
(gdb) p i
$2 = 9
(gdb) c
Continuing.
Out of memory scenario simulated
Program exited normally.
34