[gdb/testsuite] Fix gdb.dwarf2/dw2-filename.exp with -readnow
[deliverable/binutils-gdb.git] / gdb / dtrace-probe.c
index 9eaed2b9fc4508594cb65d158619bd507a28c212..ce96037be21fe210b8462ad65e0b18121d0c2618 100644 (file)
@@ -1,6 +1,6 @@
 /* DTrace probe support for GDB.
 
-   Copyright (C) 2014-2019 Free Software Foundation, Inc.
+   Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
    Contributed by Oracle, Inc.
 
@@ -151,7 +151,7 @@ public:
   struct dtrace_probe_arg *get_arg_by_number (unsigned n,
                                              struct gdbarch *gdbarch);
 
-  /* Build the GDB internal expressiosn that, once evaluated, will
+  /* Build the GDB internal expression that, once evaluated, will
      calculate the values of the arguments of the probe.  */
   void build_arg_exprs (struct gdbarch *gdbarch);
 
@@ -520,7 +520,7 @@ dtrace_process_dof (asection *sect, struct objfile *objfile,
                    std::vector<std::unique_ptr<probe>> *probesp,
                    struct dtrace_dof_hdr *dof)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct dtrace_dof_sect *section;
   int i;
 
@@ -685,8 +685,7 @@ dtrace_probe::is_enabled () const
 CORE_ADDR
 dtrace_probe::get_relocated_address (struct objfile *objfile)
 {
-  return this->get_address () + ANOFFSET (objfile->section_offsets,
-                                         SECT_OFF_DATA (objfile));
+  return this->get_address () + objfile->data_section_offset ();
 }
 
 /* Implementation of the get_argument_count method.  */
@@ -861,7 +860,7 @@ dtrace_static_probe_ops::get_probes
          else
            complaint (_("could not obtain the contents of"
                         "section '%s' in objfile `%s'."),
-                      sect->name, abfd->filename);
+                      bfd_section_name (sect), bfd_get_filename (abfd));
 
          xfree (dof);
        }
@@ -897,8 +896,9 @@ info_probes_dtrace_command (const char *arg, int from_tty)
   info_probes_for_spops (arg, from_tty, &dtrace_static_probe_ops);
 }
 
+void _initialize_dtrace_probe ();
 void
-_initialize_dtrace_probe (void)
+_initialize_dtrace_probe ()
 {
   all_static_probe_ops.push_back (&dtrace_static_probe_ops);
 
This page took 0.024506 seconds and 4 git commands to generate.