+ regname.c_str (), p->saved_arg);
+
+ /* Check if there's any special treatment that the arch-specific
+ code would like to perform on the register name. */
+ if (gdbarch_stap_adjust_register_p (gdbarch))
+ {
+ std::string newregname
+ = gdbarch_stap_adjust_register (gdbarch, p, regname, regnum);
+
+ 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, newregname.c_str (),
+ newregname.size ());
+
+ if (regnum == -1)
+ internal_error (__FILE__, __LINE__,
+ _("Invalid register name '%s' after replacing it"
+ " (previous name was '%s')"),
+ newregname.c_str (), regname.c_str ());
+
+ regname = newregname;
+ }
+ }