#include "defs.h"
#include "stap-probe.h"
#include "probe.h"
-#include "common/vec.h"
#include "ui-out.h"
#include "objfiles.h"
#include "arch-utils.h"
CORE_ADDR get_relocated_address (struct objfile *objfile) override;
/* See probe.h. */
- unsigned get_argument_count (struct frame_info *frame) override;
+ unsigned get_argument_count (struct gdbarch *gdbarch) override;
/* See probe.h. */
bool can_evaluate_arguments () const override;
code would like to perform on the register name. */
if (gdbarch_stap_adjust_register_p (gdbarch))
{
- std::string oldregname = regname;
+ std::string newregname
+ = gdbarch_stap_adjust_register (gdbarch, p, regname, regnum);
- gdbarch_stap_adjust_register (gdbarch, p, regname, regnum);
-
- if (regname != oldregname)
+ if (regname != newregname)
{
/* This is just a check we perform to make sure that the
arch-dependent code has provided us with a valid
register name. */
- regnum = user_reg_map_name_to_regnum (gdbarch, regname.c_str (),
- regname.size ());
+ regnum = user_reg_map_name_to_regnum (gdbarch, newregname.c_str (),
+ newregname.size ());
if (regnum == -1)
internal_error (__FILE__, __LINE__,
_("Invalid register name '%s' after replacing it"
" (previous name was '%s')"),
- regname.c_str (), oldregname.c_str ());
+ newregname.c_str (), regname.c_str ());
+
+ regname = newregname;
}
}
argument string. */
unsigned
-stap_probe::get_argument_count (struct frame_info *frame)
+stap_probe::get_argument_count (struct gdbarch *gdbarch)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
-
if (!m_have_parsed_args)
{
if (this->can_evaluate_arguments ())
return;
}
- value = extract_unsigned_integer (bytes, TYPE_LENGTH (type),
- gdbarch_byte_order (gdbarch));
+ enum bfd_endian byte_order = type_byte_order (type);
+ value = extract_unsigned_integer (bytes, TYPE_LENGTH (type), byte_order);
/* Note that we explicitly don't worry about overflow or
underflow. */
if (set)
else
--value;
- store_unsigned_integer (bytes, TYPE_LENGTH (type),
- gdbarch_byte_order (gdbarch), value);
+ store_unsigned_integer (bytes, TYPE_LENGTH (type), byte_order, value);
if (target_write_memory (address, bytes, TYPE_LENGTH (type)) != 0)
warning (_("Could not write the value of a SystemTap semaphore."));