+2014-03-22 Yao Qi <yao@codesourcery.com>
+
+ * remote.c (target_read_live_memory): Remove.
+ (memory_xfer_live_readonly_partial): Rename it to
+ remote_xfer_live_readonly_partial. Remove argument 'object'.
+ All callers updated. Call remote_read_bytes_1
+ instead of target_read_live_memory.
+ * tracepoint.c (set_traceframe_number): Remove.
+ (make_cleanup_restore_traceframe_number): Likewise .
+ * tracepoint.h (set_traceframe_number): Remove declaration.
+ (make_cleanup_restore_traceframe_number): Likewise.
+
2014-03-22 Yao Qi <yao@codesourcery.com>
* remote.c (remote_read_bytes): Move code on reading from the
return TARGET_XFER_OK;
}
-/* Read memory from the live target, even if currently inspecting a
- traceframe. The return is the same as that of target_read. */
-
-static enum target_xfer_status
-target_read_live_memory (enum target_object object,
- ULONGEST memaddr, gdb_byte *myaddr, ULONGEST len,
- ULONGEST *xfered_len)
-{
- enum target_xfer_status ret;
- struct cleanup *cleanup;
-
- /* Switch momentarily out of tfind mode so to access live memory.
- Note that this must not clear global state, such as the frame
- cache, which must still remain valid for the previous traceframe.
- We may be _building_ the frame cache at this point. */
- cleanup = make_cleanup_restore_traceframe_number ();
- set_traceframe_number (-1);
-
- ret = target_xfer_partial (current_target.beneath, object, NULL,
- myaddr, NULL, memaddr, len, xfered_len);
-
- do_cleanups (cleanup);
- return ret;
-}
-
-/* Using the set of read-only target sections of OPS, read live
- read-only memory. Note that the actual reads start from the
- top-most target again.
+/* Using the set of read-only target sections of remote, read live
+ read-only memory.
For interface/parameters/return description see target.h,
to_xfer_partial. */
static enum target_xfer_status
-memory_xfer_live_readonly_partial (struct target_ops *ops,
- enum target_object object,
- gdb_byte *readbuf, ULONGEST memaddr,
- ULONGEST len, ULONGEST *xfered_len)
+remote_xfer_live_readonly_partial (struct target_ops *ops, gdb_byte *readbuf,
+ ULONGEST memaddr, ULONGEST len,
+ ULONGEST *xfered_len)
{
struct target_section *secp;
struct target_section_table *table;
if (memend <= p->endaddr)
{
/* Entire transfer is within this section. */
- return target_read_live_memory (object, memaddr,
- readbuf, len, xfered_len);
+ return remote_read_bytes_1 (memaddr, readbuf, len,
+ xfered_len);
}
else if (memaddr >= p->endaddr)
{
{
/* This section overlaps the transfer. Just do half. */
len = p->endaddr - memaddr;
- return target_read_live_memory (object, memaddr,
- readbuf, len, xfered_len);
+ return remote_read_bytes_1 (memaddr, readbuf, len,
+ xfered_len);
}
}
}
do_cleanups (old_chain);
/* This goes through the topmost target again. */
- res = memory_xfer_live_readonly_partial (ops,
- TARGET_OBJECT_MEMORY,
- myaddr, memaddr,
+ res = remote_xfer_live_readonly_partial (ops, myaddr, memaddr,
len, xfered_len);
if (res == TARGET_XFER_OK)
return TARGET_XFER_OK;
clear_traceframe_info ();
}
-/* Make the traceframe NUM be the current trace frame, and do nothing
- more. */
-
-void
-set_traceframe_number (int num)
-{
- traceframe_number = num;
-}
-
/* A cleanup used when switching away and back from tfind mode. */
struct current_traceframe_cleanup
restore_current_traceframe_cleanup_dtor);
}
-struct cleanup *
-make_cleanup_restore_traceframe_number (void)
-{
- return make_cleanup_restore_integer (&traceframe_number);
-}
-
/* Given a number and address, return an uploaded tracepoint with that
number, creating if necessary. */
/* Returns the tracepoint number for current traceframe. */
extern int get_tracepoint_number (void);
-/* Make the traceframe NUM be the current GDB trace frame number, and
- do nothing more. In particular, this does not flush the
- register/frame caches or notify the target about the trace frame
- change, so that is can be used when we need to momentarily access
- live memory. Targets lazily switch their current traceframe to
- match GDB's traceframe number, at the appropriate times. */
-extern void set_traceframe_number (int);
-
/* Make the traceframe NUM be the current trace frame, all the way to
the target, and flushes all global state (register/frame caches,
etc.). */
extern void set_current_traceframe (int num);
struct cleanup *make_cleanup_restore_current_traceframe (void);
-struct cleanup *make_cleanup_restore_traceframe_number (void);
void free_actions (struct breakpoint *);