]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change target_section_table to std::vector alias
authorTom Tromey <tom@tromey.com>
Mon, 12 Oct 2020 21:53:16 +0000 (15:53 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 13 Oct 2020 02:18:48 +0000 (20:18 -0600)
Because target_section_table only holds a vector, and because it is
used in an "open" way, this patch makes it just be an alias for the
std::vector specialization.  This makes the code less wordy.  If we do
ever want to add more specialized behavior to this type, it's simple
enough to convert it back to a struct with the few needed methods
implied by this change.

gdb/ChangeLog
2020-10-12  Tom Tromey  <tom@tromey.com>

* target.h (struct target_ops) <get_section_table>: Update.
(target_get_section_table): Update.
* target.c (target_get_section_table, target_section_by_addr)
(memory_xfer_partial_1): Update.
* target-section.h (target_section_table): Now an alias.
* target-delegates.c: Rebuild.
* target-debug.h (target_debug_print_target_section_table_p):
Rename from target_debug_print_struct_target_section_table_p.
* symfile.c (build_section_addr_info_from_section_table): Update.
* solib.c (solib_map_sections, solib_contains_address_p): Update.
* solib-svr4.c (scan_dyntag): Update.
* solib-dsbt.c (scan_dyntag): Update.
* remote.c (remote_target::remote_xfer_live_readonly_partial):
Update.
* record-full.c (record_full_core_target::xfer_partial): Update.
* progspace.h (struct program_space) <target_sections>: Update.
* exec.h (print_section_info): Update.
* exec.c (exec_target::close, build_section_table)
(add_target_sections, add_target_sections_of_objfile)
(remove_target_sections, exec_on_vfork)
(section_table_available_memory)
(section_table_xfer_memory_partial)
(exec_target::get_section_table, exec_target::xfer_partial)
(print_section_info, set_section_command)
(exec_set_section_address, exec_target::has_memory): Update.
* corelow.c (core_target::build_file_mappings)
(core_target::xfer_partial, core_target::info_proc_mappings)
(core_target::info_proc_mappings): Update.
* bfd-target.c (class target_bfd): Update

17 files changed:
gdb/ChangeLog
gdb/bfd-target.c
gdb/corelow.c
gdb/exec.c
gdb/exec.h
gdb/progspace.h
gdb/record-full.c
gdb/remote.c
gdb/solib-dsbt.c
gdb/solib-svr4.c
gdb/solib.c
gdb/symfile.c
gdb/target-debug.h
gdb/target-delegates.c
gdb/target-section.h
gdb/target.c
gdb/target.h

index 849bfe205b5eed9be9b01f70099864d2d23be681..7dc3590f14632f8aacf8dfac7398f20f9e00d5cf 100644 (file)
@@ -1,3 +1,35 @@
+2020-10-12  Tom Tromey  <tom@tromey.com>
+
+       * target.h (struct target_ops) <get_section_table>: Update.
+       (target_get_section_table): Update.
+       * target.c (target_get_section_table, target_section_by_addr)
+       (memory_xfer_partial_1): Update.
+       * target-section.h (target_section_table): Now an alias.
+       * target-delegates.c: Rebuild.
+       * target-debug.h (target_debug_print_target_section_table_p):
+       Rename from target_debug_print_struct_target_section_table_p.
+       * symfile.c (build_section_addr_info_from_section_table): Update.
+       * solib.c (solib_map_sections, solib_contains_address_p): Update.
+       * solib-svr4.c (scan_dyntag): Update.
+       * solib-dsbt.c (scan_dyntag): Update.
+       * remote.c (remote_target::remote_xfer_live_readonly_partial):
+       Update.
+       * record-full.c (record_full_core_target::xfer_partial): Update.
+       * progspace.h (struct program_space) <target_sections>: Update.
+       * exec.h (print_section_info): Update.
+       * exec.c (exec_target::close, build_section_table)
+       (add_target_sections, add_target_sections_of_objfile)
+       (remove_target_sections, exec_on_vfork)
+       (section_table_available_memory)
+       (section_table_xfer_memory_partial)
+       (exec_target::get_section_table, exec_target::xfer_partial)
+       (print_section_info, set_section_command)
+       (exec_set_section_address, exec_target::has_memory): Update.
+       * corelow.c (core_target::build_file_mappings)
+       (core_target::xfer_partial, core_target::info_proc_mappings)
+       (core_target::info_proc_mappings): Update.
+       * bfd-target.c (class target_bfd): Update
+
 2020-10-12  Tom Tromey  <tom@tromey.com>
 
        * progspace.c (program_space::~program_space): Don't call
index d5defab9a80dcf6189626a65c0a7bbaf6427c187..bf4a98594bd88fc439b58332fc7903cafbfd6a8f 100644 (file)
@@ -59,7 +59,7 @@ private:
   /* The section table build from the ALLOC sections in BFD.  Note
      that we can't rely on extracting the BFD from a random section in
      the table, since the table can be legitimately empty.  */
-  struct target_section_table m_table;
+  target_section_table m_table;
 };
 
 target_xfer_status
index 193dccbeeb51760a3db8578ccdd4d4d5be3723d3..d557475e06f0fe9a77a9f46028045cfa8e493eb0 100644 (file)
@@ -266,8 +266,8 @@ core_target::build_file_mappings ()
        bfd_set_section_alignment (sec, 2);
 
        /* Set target_section fields.  */
-       m_core_file_mappings.sections.emplace_back ();
-       target_section &ts = m_core_file_mappings.sections.back ();
+       m_core_file_mappings.emplace_back ();
+       target_section &ts = m_core_file_mappings.back ();
        ts.addr = start;
        ts.endaddr = end;
        ts.owner = nullptr;
@@ -814,7 +814,7 @@ core_target::xfer_partial (enum target_object object, const char *annex,
           or the like) as this should provide a more accurate
           result.  If not, check the stratum beneath us, which should
           be the file stratum.  */
-       if (!m_core_file_mappings.sections.empty ())
+       if (!m_core_file_mappings.empty ())
          xfer_status = xfer_memory_via_mappings (readbuf, writebuf, offset,
                                                  len, xfered_len);
        else
@@ -1098,7 +1098,7 @@ get_current_core_target ()
 void
 core_target::info_proc_mappings (struct gdbarch *gdbarch)
 {
-  if (!m_core_file_mappings.sections.empty ())
+  if (!m_core_file_mappings.empty ())
     {
       printf_filtered (_("Mapped address spaces:\n\n"));
       if (gdbarch_addr_bit (gdbarch) == 32)
@@ -1117,7 +1117,7 @@ core_target::info_proc_mappings (struct gdbarch *gdbarch)
        }
     }
 
-  for (const target_section &tsp : m_core_file_mappings.sections)
+  for (const target_section &tsp : m_core_file_mappings)
     {
       ULONGEST start = tsp.addr;
       ULONGEST end = tsp.endaddr;
index ab47757c2b4b4b686905b75fd6dbb3595c7f2df5..dd322129139bf15226195efe6f0380690cf805be 100644 (file)
@@ -75,7 +75,7 @@ struct exec_target final : public target_ops
                                        const gdb_byte *writebuf,
                                        ULONGEST offset, ULONGEST len,
                                        ULONGEST *xfered_len) override;
-  struct target_section_table *get_section_table () override;
+  target_section_table *get_section_table () override;
   void files_info () override;
 
   bool has_memory () override;
@@ -183,7 +183,7 @@ exec_target::close ()
   for (struct program_space *ss : program_spaces)
     {
       set_current_program_space (ss);
-      current_target_sections->sections.clear ();
+      current_target_sections->clear ();
       exec_close ();
     }
 }
@@ -598,8 +598,8 @@ build_section_table (struct bfd *some_bfd)
       if (!(aflag & SEC_ALLOC))
        continue;
 
-      table.sections.emplace_back ();
-      target_section &sect = table.sections.back ();
+      table.emplace_back ();
+      target_section &sect = table.back ();
       sect.owner = NULL;
       sect.the_bfd_section = asect;
       sect.addr = bfd_section_vma (asect);
@@ -616,14 +616,14 @@ void
 add_target_sections (void *owner,
                     const target_section_table &sections)
 {
-  struct target_section_table *table = current_target_sections;
+  target_section_table *table = current_target_sections;
 
-  if (!sections.sections.empty ())
+  if (!sections.empty ())
     {
-      for (const target_section &s : sections.sections)
+      for (const target_section &s : sections)
        {
-         table->sections.push_back (s);
-         table->sections.back ().owner = owner;
+         table->push_back (s);
+         table->back ().owner = owner;
        }
 
       scoped_restore_current_pspace_and_thread restore_pspace_thread;
@@ -651,7 +651,7 @@ add_target_sections (void *owner,
 void
 add_target_sections_of_objfile (struct objfile *objfile)
 {
-  struct target_section_table *table = current_target_sections;
+  target_section_table *table = current_target_sections;
   struct obj_section *osect;
 
   gdb_assert (objfile != nullptr);
@@ -662,8 +662,8 @@ add_target_sections_of_objfile (struct objfile *objfile)
       if (bfd_section_size (osect->the_bfd_section) == 0)
        continue;
 
-      table->sections.emplace_back ();
-      target_section &ts = table->sections.back ();
+      table->emplace_back ();
+      target_section &ts = table->back ();
       ts.addr = obj_section_addr (osect);
       ts.endaddr = obj_section_endaddr (osect);
       ts.the_bfd_section = osect->the_bfd_section;
@@ -677,22 +677,22 @@ add_target_sections_of_objfile (struct objfile *objfile)
 void
 remove_target_sections (void *owner)
 {
-  struct target_section_table *table = current_target_sections;
+  target_section_table *table = current_target_sections;
 
   gdb_assert (owner != NULL);
 
-  auto it = std::remove_if (table->sections.begin (),
-                           table->sections.end (),
+  auto it = std::remove_if (table->begin (),
+                           table->end (),
                            [&] (target_section &sect)
                            {
                              return sect.owner == owner;
                            });
-  table->sections.erase (it, table->sections.end ());
+  table->erase (it, table->end ());
 
   /* If we don't have any more sections to read memory from,
      remove the file_stratum target from the stack of each
      inferior sharing the program space.  */
-  if (table->sections.empty ())
+  if (table->empty ())
     {
       scoped_restore_current_pspace_and_thread restore_pspace_thread;
       program_space *curr_pspace = current_program_space;
@@ -702,7 +702,7 @@ remove_target_sections (void *owner)
          if (inf->pspace != curr_pspace)
            continue;
 
-         if (!inf->pspace->target_sections.sections.empty ())
+         if (!inf->pspace->target_sections.empty ())
            continue;
 
          switch_to_inferior_no_thread (inf);
@@ -716,7 +716,7 @@ remove_target_sections (void *owner)
 void
 exec_on_vfork ()
 {
-  if (!current_program_space->target_sections.sections.empty ())
+  if (!current_program_space->target_sections.empty ())
     push_target (&exec_ops);
 }
 
@@ -779,7 +779,7 @@ section_table_available_memory (CORE_ADDR memaddr, ULONGEST len,
 {
   std::vector<mem_range> memory;
 
-  for (const target_section &p : sections.sections)
+  for (const target_section &p : sections)
     {
       if ((bfd_section_flags (p.the_bfd_section) & SEC_READONLY) == 0)
        continue;
@@ -858,7 +858,7 @@ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
 
   gdb_assert (len != 0);
 
-  for (const target_section &p : sections.sections)
+  for (const target_section &p : sections)
     {
       struct bfd_section *asect = p.the_bfd_section;
       bfd *abfd = asect->owner;
@@ -918,7 +918,7 @@ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
   return TARGET_XFER_EOF;              /* We can't help.  */
 }
 
-struct target_section_table *
+target_section_table *
 exec_target::get_section_table ()
 {
   return current_target_sections;
@@ -930,7 +930,7 @@ exec_target::xfer_partial (enum target_object object,
                           const gdb_byte *writebuf,
                           ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 {
-  struct target_section_table *table = get_section_table ();
+  target_section_table *table = get_section_table ();
 
   if (object == TARGET_OBJECT_MEMORY)
     return section_table_xfer_memory_partial (readbuf, writebuf,
@@ -942,7 +942,7 @@ exec_target::xfer_partial (enum target_object object,
 \f
 
 void
-print_section_info (struct target_section_table *t, bfd *abfd)
+print_section_info (target_section_table *t, bfd *abfd)
 {
   struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
   /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64.  */
@@ -961,7 +961,7 @@ print_section_info (struct target_section_table *t, bfd *abfd)
       bfd_vma entry_point;
       bool found = false;
 
-      for (const target_section &p : t->sections)
+      for (const target_section &p : *t)
        {
          struct bfd_section *psect = p.the_bfd_section;
 
@@ -989,7 +989,7 @@ print_section_info (struct target_section_table *t, bfd *abfd)
       printf_filtered (_("\tEntry point: %s\n"),
                       paddress (gdbarch, entry_point));
     }
-  for (const target_section &p : t->sections)
+  for (const target_section &p : *t)
     {
       struct bfd_section *psect = p.the_bfd_section;
       bfd *pbfd = psect->owner;
@@ -1032,7 +1032,6 @@ set_section_command (const char *args, int from_tty)
   unsigned long secaddr;
   char secprint[100];
   long offset;
-  struct target_section_table *table;
 
   if (args == 0)
     error (_("Must specify section name and its virtual address"));
@@ -1044,8 +1043,7 @@ set_section_command (const char *args, int from_tty)
   /* Parse out new virtual address.  */
   secaddr = parse_and_eval_address (args);
 
-  table = current_target_sections;
-  for (target_section &p : table->sections)
+  for (target_section &p : *current_target_sections)
     {
       if (!strncmp (secname, bfd_section_name (p.the_bfd_section), seclen)
          && bfd_section_name (p.the_bfd_section)[seclen] == '\0')
@@ -1071,10 +1069,7 @@ set_section_command (const char *args, int from_tty)
 void
 exec_set_section_address (const char *filename, int index, CORE_ADDR address)
 {
-  struct target_section_table *table;
-
-  table = current_target_sections;
-  for (target_section &p : table->sections)
+  for (target_section &p : *current_target_sections)
     {
       if (filename_cmp (filename,
                        bfd_get_filename (p.the_bfd_section->owner)) == 0
@@ -1091,7 +1086,7 @@ exec_target::has_memory ()
 {
   /* We can provide memory if we have any file/target sections to read
      from.  */
-  return !current_target_sections->sections.empty ();
+  return !current_target_sections->empty ();
 }
 
 char *
index f28a033428d4cb6f1bd9b29d758995504ec65d77..24489654ddc87ef3e238994311234ad7fc17e230 100644 (file)
@@ -115,7 +115,7 @@ extern void add_target_sections_of_objfile (struct objfile *objfile);
    special cased --- it's filename is omitted; if it is the executable
    file, its entry point is printed.  */
 
-extern void print_section_info (struct target_section_table *table,
+extern void print_section_info (target_section_table *table,
                                bfd *abfd);
 
 extern void exec_close (void);
index 099b4dc0b3a4c4df4d5b70fd23159aa8ede9eb45..6a0e90363995e8c950b0acf6eece9cbea99cba0d 100644 (file)
@@ -325,7 +325,7 @@ struct program_space
 
   /* The set of target sections matching the sections mapped into
      this program space.  Managed by both exec_ops and solib.c.  */
-  struct target_section_table target_sections {};
+  target_section_table target_sections;
 
   /* List of shared objects mapped into this space.  Managed by
      solib.c.  */
index 40740f216cea9f7c6b19a0381d44d48ecd4f8f7e..b5447e5a9a6849b8896fcd3454760688271929c0 100644 (file)
@@ -2138,7 +2138,7 @@ record_full_core_target::xfer_partial (enum target_object object,
     {
       if (record_full_gdb_operation_disable || !writebuf)
        {
-         for (target_section &p : record_full_core_sections.sections)
+         for (target_section &p : record_full_core_sections)
            {
              if (offset >= p.addr)
                {
index 15884fcd94192720322a587d0cc80402155a0277..9ee1e8cbcf9e9e1b9e3025d0ed94c23d06f4a2c6 100644 (file)
@@ -8890,7 +8890,6 @@ remote_target::remote_xfer_live_readonly_partial (gdb_byte *readbuf,
                                                  ULONGEST *xfered_len)
 {
   struct target_section *secp;
-  struct target_section_table *table;
 
   secp = target_section_by_addr (this, memaddr);
   if (secp != NULL
@@ -8898,9 +8897,8 @@ remote_target::remote_xfer_live_readonly_partial (gdb_byte *readbuf,
     {
       ULONGEST memend = memaddr + len;
 
-      table = target_get_section_table (this);
-
-      for (target_section &p : table->sections)
+      target_section_table *table = target_get_section_table (this);
+      for (target_section &p : *table)
        {
          if (memaddr >= p.addr)
            {
index 5908921631463e4648aac3aa7f5f99f5e9ca7b1e..57c7ab18430daf6265b862a0ab2a9c1f1335864c 100644 (file)
@@ -424,7 +424,7 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
     return 0;
 
   bool found = false;
-  for (target_section &target_section : current_target_sections->sections)
+  for (target_section &target_section : *current_target_sections)
     if (sect == target_section.the_bfd_section)
       {
        dyn_addr = target_section.addr;
index 9bb728ae9b9303158e0bc008eb385db5b47550bf..a780f8d34678e5e59ed77d9702062e572626b3e8 100644 (file)
@@ -608,7 +608,7 @@ scan_dyntag (const int desired_dyntag, bfd *abfd, CORE_ADDR *ptr,
     return 0;
 
   bool found = false;
-  for (target_section &target_section : current_target_sections->sections)
+  for (target_section &target_section : *current_target_sections)
     if (sect == target_section.the_bfd_section)
       {
        dyn_addr = target_section.addr;
index bd6a27d89837dc9198d014ca285dc78c83566d6d..b4864429e9aa22f604de75530a575334aaa9017c 100644 (file)
@@ -556,7 +556,7 @@ solib_map_sections (struct so_list *so)
     so->sections = new target_section_table;
   *so->sections = build_section_table (so->abfd);
 
-  for (target_section &p : so->sections->sections)
+  for (target_section &p : *so->sections)
     {
       /* Relocate the section binding addresses as recorded in the shared
          object's file by the base address to which the object was actually
@@ -1113,7 +1113,7 @@ bool
 solib_contains_address_p (const struct so_list *const solib,
                          CORE_ADDR address)
 {
-  for (target_section &p : solib->sections->sections)
+  for (target_section &p : *solib->sections)
     if (p.addr <= address && address < p.endaddr)
       return true;
 
index f4acec50ccaf6d8303d35d5eb2a78c20b5197f8f..3332e7f69ff8152371a401c8fb351940b308a52e 100644 (file)
@@ -216,13 +216,13 @@ build_section_addr_info_from_section_table (const target_section_table &table)
 {
   section_addr_info sap;
 
-  for (const target_section &stp : table.sections)
+  for (const target_section &stp : table)
     {
       struct bfd_section *asect = stp.the_bfd_section;
       bfd *abfd = asect->owner;
 
       if (bfd_section_flags (asect) & (SEC_ALLOC | SEC_LOAD)
-         && sap.size () < table.sections.size ())
+         && sap.size () < table.size ())
        sap.emplace_back (stp.addr,
                          bfd_section_name (asect),
                          gdb_bfd_section_index (abfd, asect));
index 1b2feb2c7fbc1416f28484c76a79c03b181cbe17..65a14c41787432e6ece93c5c1b96cef1b064a043 100644 (file)
   target_debug_do_print (host_address_to_string (X))
 #define target_debug_print_struct_ui_file_p(X) \
   target_debug_do_print (host_address_to_string (X))
-#define target_debug_print_struct_target_section_table_p(X)    \
+#define target_debug_print_target_section_table_p(X)   \
   target_debug_do_print (host_address_to_string (X))
 #define target_debug_print_async_callback_ftype_p(X) \
   target_debug_do_print (host_address_to_string (X))
index c0968e2040ebda3b2383d4f696c124d4ede69f92..e9c349fb7ba0677559f3a0b4d6d7b2c17132491c 100644 (file)
@@ -77,7 +77,7 @@ struct dummy_target : public target_ops
   void rcmd (const char *arg0, struct ui_file *arg1) override;
   char *pid_to_exec_file (int arg0) override;
   void log_command (const char *arg0) override;
-  struct target_section_table *get_section_table () override;
+  target_section_table *get_section_table () override;
   thread_control_capabilities get_thread_control_capabilities () override;
   bool attach_no_wait () override;
   bool can_async_p () override;
@@ -248,7 +248,7 @@ struct debug_target : public target_ops
   void rcmd (const char *arg0, struct ui_file *arg1) override;
   char *pid_to_exec_file (int arg0) override;
   void log_command (const char *arg0) override;
-  struct target_section_table *get_section_table () override;
+  target_section_table *get_section_table () override;
   thread_control_capabilities get_thread_control_capabilities () override;
   bool attach_no_wait () override;
   bool can_async_p () override;
@@ -2021,27 +2021,27 @@ debug_target::log_command (const char *arg0)
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
-struct target_section_table *
+target_section_table *
 target_ops::get_section_table ()
 {
   return this->beneath ()->get_section_table ();
 }
 
-struct target_section_table *
+target_section_table *
 dummy_target::get_section_table ()
 {
   return NULL;
 }
 
-struct target_section_table *
+target_section_table *
 debug_target::get_section_table ()
 {
-  struct target_section_table * result;
+  target_section_table * result;
   fprintf_unfiltered (gdb_stdlog, "-> %s->get_section_table (...)\n", this->beneath ()->shortname ());
   result = this->beneath ()->get_section_table ();
   fprintf_unfiltered (gdb_stdlog, "<- %s->get_section_table (", this->beneath ()->shortname ());
   fputs_unfiltered (") = ", gdb_stdlog);
-  target_debug_print_struct_target_section_table_p (result);
+  target_debug_print_target_section_table_p (result);
   fputs_unfiltered ("\n", gdb_stdlog);
   return result;
 }
index 97d9f4028a556f3bcd876cc51cca8a12146f5838..ec6932da0a6b02b185abec1035b1fe717ffdc1d4 100644 (file)
@@ -44,9 +44,6 @@ struct target_section
 
 /* Holds an array of target sections.  */
 
-struct target_section_table
-{
-  std::vector<struct target_section> sections;
-};
+using target_section_table = std::vector<target_section>;
 
 #endif /* GDB_TARGET_SECTION_H */
index 0f3f745c13f5f20c8c0a1536d80d5572cacfa18e..531858a3333f621bb108363424ac6fc91ea82399 100644 (file)
@@ -812,7 +812,7 @@ target_read_string (CORE_ADDR memaddr, int len, int *bytes_read)
   return gdb::unique_xmalloc_ptr<char> ((char *) buffer.release ());
 }
 
-struct target_section_table *
+target_section_table *
 target_get_section_table (struct target_ops *target)
 {
   return target->get_section_table ();
@@ -823,12 +823,12 @@ target_get_section_table (struct target_ops *target)
 struct target_section *
 target_section_by_addr (struct target_ops *target, CORE_ADDR addr)
 {
-  struct target_section_table *table = target_get_section_table (target);
+  target_section_table *table = target_get_section_table (target);
 
   if (table == NULL)
     return NULL;
 
-  for (target_section &secp : table->sections)
+  for (target_section &secp : *table)
     {
       if (addr >= secp.addr && addr < secp.endaddr)
        return &secp;
@@ -965,8 +965,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
 
       if (pc_in_unmapped_range (memaddr, section))
        {
-         struct target_section_table *table
-           = target_get_section_table (ops);
+         target_section_table *table = target_get_section_table (ops);
          const char *section_name = section->the_bfd_section->name;
 
          memaddr = overlay_mapped_address (memaddr, section);
@@ -986,13 +985,12 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
   if (readbuf != NULL && trust_readonly)
     {
       struct target_section *secp;
-      struct target_section_table *table;
 
       secp = target_section_by_addr (ops, memaddr);
       if (secp != NULL
          && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
        {
-         table = target_get_section_table (ops);
+         target_section_table *table = target_get_section_table (ops);
          return section_table_xfer_memory_partial (readbuf, writebuf,
                                                    memaddr, len, xfered_len,
                                                    *table);
index cf0a296075d429eb0b6552633650bef82dc2bce2..7e152fa6e151eee183b5c5550f507a09c7596926 100644 (file)
@@ -29,7 +29,6 @@ struct target_ops;
 struct bp_location;
 struct bp_target_info;
 struct regcache;
-struct target_section_table;
 struct trace_state_variable;
 struct trace_status;
 struct uploaded_tsv;
@@ -681,7 +680,7 @@ struct target_ops
       TARGET_DEFAULT_RETURN (NULL);
     virtual void log_command (const char *)
       TARGET_DEFAULT_IGNORE ();
-    virtual struct target_section_table *get_section_table ()
+    virtual target_section_table *get_section_table ()
       TARGET_DEFAULT_RETURN (NULL);
 
     /* Provide default values for all "must have" methods.  */
@@ -2413,7 +2412,7 @@ struct target_section *target_section_by_addr (struct target_ops *target,
 /* Return the target section table this target (or the targets
    beneath) currently manipulate.  */
 
-extern struct target_section_table *target_get_section_table
+extern target_section_table *target_get_section_table
   (struct target_ops *target);
 
 /* From mem-break.c */