gas: remove use of PTR
[binutils-gdb.git] / gdb / dtrace-probe.c
index 3fa02ddaebec7170ee3d589ac13143edf9dac232..6f01edf3924c987d9f6eb17ea875605492f59598 100644 (file)
@@ -1,6 +1,6 @@
 /* DTrace probe support for GDB.
 
-   Copyright (C) 2014-2021 Free Software Foundation, Inc.
+   Copyright (C) 2014-2022 Free Software Foundation, Inc.
 
    Contributed by Oracle, Inc.
 
@@ -684,7 +684,7 @@ dtrace_probe::is_enabled () const
 CORE_ADDR
 dtrace_probe::get_relocated_address (struct objfile *objfile)
 {
-  return this->get_address () + objfile->data_section_offset ();
+  return this->get_address () + objfile->text_section_offset ();
 }
 
 /* Implementation of the get_argument_count method.  */
@@ -725,17 +725,9 @@ dtrace_probe::compile_to_ax (struct agent_expr *expr, struct axs_value *value,
                             unsigned n)
 {
   struct dtrace_probe_arg *arg;
-  union exp_element *pc;
 
   arg = this->get_arg_by_number (n, expr->gdbarch);
-
-  if (arg->expr->op != nullptr)
-    arg->expr->op->generate_ax (arg->expr.get (), expr, value);
-  else
-    {
-      pc = arg->expr->elts;
-      gen_expr (arg->expr.get (), &pc, expr, value);
-    }
+  arg->expr->op->generate_ax (arg->expr.get (), expr, value);
 
   require_rvalue (expr, value);
   value->type = arg->type;
@@ -859,7 +851,7 @@ dtrace_static_probe_ops::get_probes
          if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
            dtrace_process_dof (sect, objfile, probesp,
                                (struct dtrace_dof_hdr *) dof);
-        else
+         else
            complaint (_("could not obtain the contents of"
                         "section '%s' in objfile `%s'."),
                       bfd_section_name (sect), bfd_get_filename (abfd));