2009-08-04 Hui Zhu <teawater@gmail.com>
Michael Snyder <msnyder@vmware.com> * record.c (record_mem_entry): New field 'mem_entry_not_accessible'. (record_arch_list_add_mem): Initialize 'mem_entry_not_accessible'. (record_wait): Set 'mem_entry_not_accessible' flag if target memory not readable. Don't try to change target memory if 'mem_entry_not_accessible' is set.
This commit is contained in:
parent
f86adc0752
commit
afd0cd3fc1
|
@ -1,3 +1,12 @@
|
||||||
|
2009-08-04 Hui Zhu <teawater@gmail.com>
|
||||||
|
Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* record.c (record_mem_entry): New field 'mem_entry_not_accessible'.
|
||||||
|
(record_arch_list_add_mem): Initialize 'mem_entry_not_accessible'.
|
||||||
|
(record_wait): Set 'mem_entry_not_accessible' flag if target
|
||||||
|
memory not readable. Don't try to change target memory if
|
||||||
|
'mem_entry_not_accessible' is set.
|
||||||
|
|
||||||
2009-08-03 Richard Guenther <rguenther@suse.de>
|
2009-08-03 Richard Guenther <rguenther@suse.de>
|
||||||
Jan Kratochvil <jan.kratochvil@redhat.com>
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
|
77
gdb/record.c
77
gdb/record.c
|
@ -51,6 +51,9 @@ struct record_mem_entry
|
||||||
{
|
{
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
int len;
|
int len;
|
||||||
|
/* Set this flag if target memory for this entry
|
||||||
|
can no longer be accessed. */
|
||||||
|
int mem_entry_not_accessible;
|
||||||
gdb_byte *val;
|
gdb_byte *val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -275,6 +278,7 @@ record_arch_list_add_mem (CORE_ADDR addr, int len)
|
||||||
rec->type = record_mem;
|
rec->type = record_mem;
|
||||||
rec->u.mem.addr = addr;
|
rec->u.mem.addr = addr;
|
||||||
rec->u.mem.len = len;
|
rec->u.mem.len = len;
|
||||||
|
rec->u.mem.mem_entry_not_accessible = 0;
|
||||||
|
|
||||||
if (target_read_memory (addr, rec->u.mem.val, len))
|
if (target_read_memory (addr, rec->u.mem.val, len))
|
||||||
{
|
{
|
||||||
|
@ -727,32 +731,55 @@ record_wait (struct target_ops *ops,
|
||||||
else if (record_list->type == record_mem)
|
else if (record_list->type == record_mem)
|
||||||
{
|
{
|
||||||
/* mem */
|
/* mem */
|
||||||
gdb_byte *mem = alloca (record_list->u.mem.len);
|
/* Nothing to do if the entry is flagged not_accessible. */
|
||||||
if (record_debug > 1)
|
if (!record_list->u.mem.mem_entry_not_accessible)
|
||||||
fprintf_unfiltered (gdb_stdlog,
|
{
|
||||||
"Process record: record_mem %s to "
|
gdb_byte *mem = alloca (record_list->u.mem.len);
|
||||||
"inferior addr = %s len = %d.\n",
|
if (record_debug > 1)
|
||||||
host_address_to_string (record_list),
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
paddress (gdbarch, record_list->u.mem.addr),
|
"Process record: record_mem %s to "
|
||||||
record_list->u.mem.len);
|
"inferior addr = %s len = %d.\n",
|
||||||
|
host_address_to_string (record_list),
|
||||||
|
paddress (gdbarch,
|
||||||
|
record_list->u.mem.addr),
|
||||||
|
record_list->u.mem.len);
|
||||||
|
|
||||||
if (target_read_memory
|
if (target_read_memory (record_list->u.mem.addr, mem,
|
||||||
(record_list->u.mem.addr, mem, record_list->u.mem.len))
|
record_list->u.mem.len))
|
||||||
error (_("Process record: error reading memory at "
|
{
|
||||||
"addr = %s len = %d."),
|
if (execution_direction != EXEC_REVERSE)
|
||||||
paddress (gdbarch, record_list->u.mem.addr),
|
error (_("Process record: error reading memory at "
|
||||||
record_list->u.mem.len);
|
"addr = %s len = %d."),
|
||||||
|
paddress (gdbarch, record_list->u.mem.addr),
|
||||||
if (target_write_memory
|
record_list->u.mem.len);
|
||||||
(record_list->u.mem.addr, record_list->u.mem.val,
|
else
|
||||||
record_list->u.mem.len))
|
/* Read failed --
|
||||||
error (_
|
flag entry as not_accessible. */
|
||||||
("Process record: error writing memory at "
|
record_list->u.mem.mem_entry_not_accessible = 1;
|
||||||
"addr = %s len = %d."),
|
}
|
||||||
paddress (gdbarch, record_list->u.mem.addr),
|
else
|
||||||
record_list->u.mem.len);
|
{
|
||||||
|
if (target_write_memory (record_list->u.mem.addr,
|
||||||
memcpy (record_list->u.mem.val, mem, record_list->u.mem.len);
|
record_list->u.mem.val,
|
||||||
|
record_list->u.mem.len))
|
||||||
|
{
|
||||||
|
if (execution_direction != EXEC_REVERSE)
|
||||||
|
error (_("Process record: error writing memory at "
|
||||||
|
"addr = %s len = %d."),
|
||||||
|
paddress (gdbarch, record_list->u.mem.addr),
|
||||||
|
record_list->u.mem.len);
|
||||||
|
else
|
||||||
|
/* Write failed --
|
||||||
|
flag entry as not_accessible. */
|
||||||
|
record_list->u.mem.mem_entry_not_accessible = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memcpy (record_list->u.mem.val, mem,
|
||||||
|
record_list->u.mem.len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue