diff options
author | Pedro Alves <palves@redhat.com> | 2011-02-16 12:59:05 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-02-16 12:59:05 +0000 |
commit | 08807d5afd29a5dba40d31cd28a78af64e4fae15 (patch) | |
tree | 10e476c3c3af128b54a77341cec87444a5fab9fd /gdb/testsuite/gdb.trace/collection.exp | |
parent | fb68ae733b393f6a6b1b9b92f2118f55908e7171 (diff) | |
download | binutils-gdb-08807d5afd29a5dba40d31cd28a78af64e4fae15.tar.gz |
2011-02-16 Pedro Alves <pedro@codesourcery.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
gdb/
* tracepoint.c (memrange_sortmerge): Fix list A's end calculation.
2011-02-16 Pedro Alves <pedro@codesourcery.com>
gdb/testsuite/
* collection.c (globalarr2): New global.
(main): Initialize it before collecting, and and clear it
afterwards.
* collection.exp (gdb_collect_globals_test): Test collecting
overlapping memory ranges.
Diffstat (limited to 'gdb/testsuite/gdb.trace/collection.exp')
-rw-r--r-- | gdb/testsuite/gdb.trace/collection.exp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp index 4e0a30d4902..c966f2f129d 100644 --- a/gdb/testsuite/gdb.trace/collection.exp +++ b/gdb/testsuite/gdb.trace/collection.exp @@ -457,13 +457,29 @@ proc gdb_collect_globals_test { } { } } + # Use use this to test collecting overlapping memory ranges + # (making use of UNOP_MEMVAL, as objects don't usually overlap + # other objects). Note that globalarr2 should not be collected in + # any other way so that a regression test below can be effective. + + set globalarr2_addr "" + set test "get address of globalarr2" + gdb_test_multiple "p /x &globalarr2" $test { + -re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" { + set globalarr2_addr $expect_out(1,string) + pass $test + } + } + gdb_test "trace $testline" \ "Tracepoint \[0-9\]+ at .*" \ "collect globals: set tracepoint" gdb_trace_setactions "collect globals: define actions" \ "" \ "collect globalc, globali, globalf, globald" "^$" \ - "collect globalstruct, globalp, globalarr" "^$" + "collect globalstruct, globalp, globalarr" "^$" \ + "collect \{int \[4\]\}$globalarr2_addr" "^$" \ + "collect \{int \[2\]\}$globalarr2_addr" "^$" # Begin the test. run_trace_experiment "globals" globals_test_func @@ -508,6 +524,12 @@ proc gdb_collect_globals_test { } { "\\$\[0-9\]+ = 3$cr" \ "collect globals: collected global array element #3" + # Check that we didn't mess up sort&merging memory ranges to + # collect. + gdb_test "print globalarr2" \ + "\\$\[0-9\]+ = \\{0, 1, 2, 3\\}$cr" \ + "collect globals: collected global array 2" + gdb_test "tfind none" \ "#0 end .*" \ "collect globals: cease trace debugging" |