290a839c9a
In gdb.trace/unavailable.exp, an action is defined to collect struct_b.struct_a.array[2] and struct_b.struct_a.array[100], struct StructB { int d, ef; StructA struct_a; int s:1; static StructA static_struct_a; const char *string; }; and the other files are not collected. When GDB examine traceframe collected by the action, "struct_b" is unavailable completely, which is wrong. (gdb) p struct_b $1 = <unavailable> When GDB reads 'struct_b', it will request to read memory at struct_b's address of length LEN. Since struct_b.d is not collected, no 'M' block includes the first part of the desired range, so tfile_xfer_partial returns TARGET_XFER_UNAVAILABLE and GDB thinks the whole requested range is unavailable. In order to fix this problem, in the iteration to 'M' blocks, we record the lowest address of blocks within the request range. If it has, the requested range isn't unavailable completely. This applies to ctf too. With this patch applied, the result looks good and fails in unavailable.exp is fixed. (gdb) p struct_b $1 = {d = <unavailable>, ef = <unavailable>, struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable>, <unavailable>, -1431655766, <unavailable> <repeats 97 times>, -1431655766, <unavailable> <repeats 9899 times>}, ptr = <unavailable>, bitfield = <unavailable>}, s = <unavailable>, static static_struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable> <repeats 10000 times>}, ptr = <unavailable>, bitfield = <unavailable>}, string = <unavailable>} gdb: 2014-05-05 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * tracefile-tfile.c (tfile_xfer_partial): Record the lowest address of blocks that intersects the requested range. Trim LEN up to LOW_ADDR_AVAILABLE if read from executable read-only sections. * ctf.c (ctf_xfer_partial): Likewise. gdb/testsuite: 2014-05-05 Yao Qi <yao@codesourcery.com> * gdb.trace/unavailable.exp (gdb_collect_args_test): Save traceframes into tfile and ctf trace files. Read data from trace file and test collected data. (gdb_collect_locals_test): Likewise. (gdb_unavailable_registers_test): Likewise. (gdb_unavailable_floats): Likewise. (gdb_collect_globals_test): Likewise. (top-level): Append "ctf" to trace_file_targets if GDB supports. |
||
---|---|---|
.. | ||
actions-changed.c | ||
actions-changed.exp | ||
actions.c | ||
actions.exp | ||
ax.exp | ||
backtrace.exp | ||
change-loc-1.c | ||
change-loc-2.c | ||
change-loc.c | ||
change-loc.exp | ||
change-loc.h | ||
circ.c | ||
circ.exp | ||
collection.c | ||
collection.exp | ||
deltrace.exp | ||
disconnected-tracing.c | ||
disconnected-tracing.exp | ||
entry-values.c | ||
entry-values.exp | ||
ftrace.c | ||
ftrace.exp | ||
infotrace.exp | ||
Makefile.in | ||
mi-trace-frame-collected.exp | ||
mi-trace-unavailable.exp | ||
mi-traceframe-changed.exp | ||
mi-tracepoint-changed.exp | ||
mi-tsv-changed.exp | ||
packetlen.exp | ||
passc-dyn.exp | ||
passcount.exp | ||
pending.c | ||
pending.exp | ||
pendshr1.c | ||
pendshr2.c | ||
pr16508.exp | ||
qtro.c | ||
qtro.exp | ||
range-stepping.c | ||
range-stepping.exp | ||
read-memory.c | ||
read-memory.exp | ||
report.exp | ||
save-trace.exp | ||
stap-trace.c | ||
stap-trace.exp | ||
status-stop.c | ||
status-stop.exp | ||
strace.c | ||
strace.exp | ||
tfile.c | ||
tfile.exp | ||
tfind.exp | ||
trace-break.c | ||
trace-break.exp | ||
trace-buffer-size.c | ||
trace-buffer-size.exp | ||
trace-mt.c | ||
trace-mt.exp | ||
trace-unavailable.c | ||
tracecmd.exp | ||
tspeed.c | ||
tspeed.exp | ||
tstatus.exp | ||
tsv.exp | ||
unavailable-dwarf-piece.c | ||
unavailable-dwarf-piece.exp | ||
unavailable.cc | ||
unavailable.exp | ||
while-dyn.exp | ||
while-stepping.exp |