PR record/18691: Fix fails in solib-precsave.exp

We see the following regressions in testing on x86_64-linux,

 reverse-step^M
 Cannot access memory at address 0x2aaaaaed26c0^M
 (gdb) FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function one

when GDB reverse step into a function, GDB wants to skip prologue so
it requests TARGET_OBJECT_CODE_MEMORY to read some code memory in
memory_xfer_partial_1.  However in dcache_read_memory_partial, the object
becomes TARGET_OBJECT_MEMORY

      return ops->to_xfer_partial (ops, TARGET_OBJECT_MEMORY, NULL,
                                   myaddr, NULL, memaddr, len,
                                   xfered_len);

in reverse debugging, ops->to_xfer_partial is record_full_core_xfer_partial
and it will return TARGET_XFER_E_IO because it can't find any records.
The test fails.

At this moment, the delegate relationship is like

  dcache -> record-core -> core -> exec

and we want to GDB read memory across targets, which means if the
requested memory isn't found in record-core, GDB can read memory from
core, and exec even further if needed.  I find raw_memory_xfer_partial
is exactly what I want.

gdb:

2015-07-29  Yao Qi  <yao.qi@linaro.org>

	PR record/18691
	* dcache.c (dcache_read_memory_partial): Call
	raw_memory_xfer_partial.
	* target.c (raw_memory_xfer_partial): Make it non-static.
	* target.h (raw_memory_xfer_partial): Declare.
This commit is contained in:
Yao Qi 2015-07-29 12:43:10 +01:00
parent eb1a79028c
commit cc9f16aa88
4 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2015-07-29 Yao Qi <yao.qi@linaro.org>
PR record/18691
* dcache.c (dcache_read_memory_partial): Call
raw_memory_xfer_partial.
* target.c (raw_memory_xfer_partial): Make it non-static.
* target.h (raw_memory_xfer_partial): Declare.
2015-07-28 Simon Marchi <simon.marchi@ericsson.com>
* c-valprint.c (c_val_print_array): Consider addressable memory

View File

@ -498,9 +498,8 @@ dcache_read_memory_partial (struct target_ops *ops, DCACHE *dcache,
{
/* Even though reading the whole line failed, we may be able to
read a piece starting where the caller wanted. */
return ops->to_xfer_partial (ops, TARGET_OBJECT_MEMORY, NULL,
myaddr, NULL, memaddr, len,
xfered_len);
return raw_memory_xfer_partial (ops, myaddr, NULL, memaddr, len,
xfered_len);
}
else
{

View File

@ -1060,7 +1060,7 @@ memory_xfer_check_region (gdb_byte *readbuf, const gdb_byte *writebuf,
instance, could have some of memory but delegate other bits to
the target below it. So, we must manually try all targets. */
static enum target_xfer_status
enum target_xfer_status
raw_memory_xfer_partial (struct target_ops *ops, gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST memaddr, LONGEST len,
ULONGEST *xfered_len)

View File

@ -265,6 +265,11 @@ typedef enum target_xfer_status
ULONGEST len,
ULONGEST *xfered_len);
enum target_xfer_status
raw_memory_xfer_partial (struct target_ops *ops, gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST memaddr,
LONGEST len, ULONGEST *xfered_len);
/* Request that OPS transfer up to LEN addressable units of the target's
OBJECT. When reading from a memory object, the size of an addressable unit
is architecture dependent and can be found using