mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
add a test + assert for GDB bug bypassed in r13472
* modify mcwatchpoints to print a 50000 char array * add an assert to check the max allowed size git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13476
This commit is contained in:
parent
f79c9ac8c5
commit
d4d5d3790b
@ -697,6 +697,8 @@ int putpkt_binary (char *buf, int cnt)
|
||||
|
||||
buf2 = malloc (PBUFSIZ+POVERHSIZ);
|
||||
// should malloc PBUFSIZ, but bypass GDB bug (see gdbserver_init in server.c)
|
||||
vg_assert (5 == POVERHSIZ);
|
||||
vg_assert (cnt <= PBUFSIZ); // be tolerant for GDB bug.
|
||||
|
||||
/* Copy the packet into buffer BUF2, encapsulating it
|
||||
and giving it a checksum. */
|
||||
|
||||
@ -16,10 +16,11 @@ before rewriting 0
|
||||
before rewriting 4
|
||||
before rewriting 8
|
||||
value 0nde4ine8
|
||||
value of k50[1000] p
|
||||
|
||||
HEAP SUMMARY:
|
||||
in use at exit: 0 bytes in 0 blocks
|
||||
total heap usage: 0 allocs, 0 frees, 0 bytes allocated
|
||||
total heap usage: 1 allocs, 1 frees, 50,000 bytes allocated
|
||||
|
||||
For a detailed leak analysis, rerun with: --leak-check=full
|
||||
|
||||
|
||||
@ -24,5 +24,10 @@ continue
|
||||
continue
|
||||
continue
|
||||
del
|
||||
break watchpoints.c:70
|
||||
# continue till //break2:
|
||||
continue
|
||||
# trigger gdb reading data with big packets:
|
||||
p *(k50)@50000
|
||||
continue
|
||||
quit
|
||||
|
||||
@ -31,5 +31,10 @@ New value = 68 'D'
|
||||
main (argc=1, argv=0x........) at watchpoints.c:49
|
||||
49 fprintf(stderr, "after writing 8\n");
|
||||
Delete all breakpoints? (y or n) [answered Y; input not from terminal]
|
||||
Breakpoint 8 at 0x........: file watchpoints.c, line 70.
|
||||
Continuing.
|
||||
Breakpoint 8, main (argc=1, argv=0x........) at watchpoints.c:70
|
||||
70 free(k50); //break2
|
||||
$1 = 'p' <repeats 50000 times>
|
||||
Continuing.
|
||||
Program exited normally.
|
||||
|
||||
@ -63,5 +63,12 @@ int main (int argc, char *argv[])
|
||||
|
||||
fprintf(stderr, "value %s\n", undefined);
|
||||
|
||||
{
|
||||
char *k50 = malloc(50000);
|
||||
memset (k50, 'p', 50000);
|
||||
fprintf(stderr, "value of k50[1000] %c\n", k50[1000]);
|
||||
free(k50); //break2
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user