+2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * exec.c (exec_target::get_section_table): Delete member function.
+ (section_table_read_available_memory): Use current_top_target, not
+ just the exec_ops target.
+ * target-delegates.c: Regenerate.
+ * target.c (default_get_section_table): New function.
+ * target.h (target_ops::get_section_table): Change default
+ behaviour to call default_get_section_table.
+ (default_get_section_table): Declare.
+
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
* exec.c (exec_target::close): Call new clear_target_sections
const gdb_byte *writebuf,
ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len) override;
- const target_section_table *get_section_table () override;
void files_info () override;
bool has_memory () override;
section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset,
ULONGEST len, ULONGEST *xfered_len)
{
- const target_section_table *table = target_get_section_table (&exec_ops);
+ const target_section_table *table
+ = target_get_section_table (current_top_target ());
std::vector<mem_range> available_memory
= section_table_available_memory (offset, len, *table);
return TARGET_XFER_EOF; /* We can't help. */
}
-const target_section_table *
-exec_target::get_section_table ()
-{
- return ¤t_program_space->target_sections ();
-}
-
enum target_xfer_status
exec_target::xfer_partial (enum target_object object,
const char *annex, gdb_byte *readbuf,
const target_section_table *
dummy_target::get_section_table ()
{
- return NULL;
+ return default_get_section_table ();
}
const target_section_table *
return NULL;
}
+/* See target.h. */
+
+const target_section_table *
+default_get_section_table ()
+{
+ return ¤t_program_space->target_sections ();
+}
/* Helper for the memory xfer routines. Checks the attributes of the
memory region of MEMADDR against the read or write being attempted.
virtual void log_command (const char *)
TARGET_DEFAULT_IGNORE ();
virtual const target_section_table *get_section_table ()
- TARGET_DEFAULT_RETURN (NULL);
+ TARGET_DEFAULT_RETURN (default_get_section_table ());
/* Provide default values for all "must have" methods. */
virtual bool has_all_memory () { return false; }
extern const target_section_table *target_get_section_table
(struct target_ops *target);
+/* Default implementation of get_section_table for dummy_target. */
+
+extern const target_section_table *default_get_section_table ();
+
/* From mem-break.c */
extern int memory_remove_breakpoint (struct target_ops *,
}
}
-# NOTE: We would like to check 'maint info target-sections' again
-# here, but GDB currently doesn't display the target sections table in
-# this case. This is a bug and will be fixed shortly!!
+check_maint_info_target_sections_output "with loaded symbol file"
# Test the command line completion on 'maint info sections'. First
# the command line flag.