X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbarch.sh;h=2f9fbbc56cd78cbc5600a9a310454646dc08b07a;hb=6b78c3f83c8bcbfa714aab7627ece9673b2d602a;hp=59493d8c21512b2b85d10cf80c000b91057b1760;hpb=37eedb39824dc26c82a92b5515a352d7de0c9b5b;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 59493d8c21..2f9fbbc56c 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -1030,6 +1030,31 @@ M;int;stap_is_single_operand;const char *s;s # parser), and should advance the buffer pointer (p->arg). M;int;stap_parse_special_token;struct stap_parse_info *p;p +# Perform arch-dependent adjustments to a register name. +# +# In very specific situations, it may be necessary for the register +# name present in a SystemTap probe's argument to be handled in a +# special way. For example, on i386, GCC may over-optimize the +# register allocation and use smaller registers than necessary. In +# such cases, the client that is reading and evaluating the SystemTap +# probe (ourselves) will need to actually fetch values from the wider +# version of the register in question. +# +# To illustrate the example, consider the following probe argument +# (i386): +# +# 4@%ax +# +# This argument says that its value can be found at the %ax register, +# which is a 16-bit register. However, the argument's prefix says +# that its type is "uint32_t", which is 32-bit in size. Therefore, in +# this case, GDB should actually fetch the probe's value from register +# %eax, not %ax. In this scenario, this function would actually +# replace the register name from %ax to %eax. +# +# The rationale for this can be found at PR breakpoints/24541. +M;std::string;stap_adjust_register;struct stap_parse_info *p, const std::string \®name, int regnum;p, regname, regnum + # DTrace related functions. # The expression to compute the NARTGth+1 argument to a DTrace USDT probe.