aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.h
diff options
context:
space:
mode:
authorPedro Franco de Carvalho <pedromfc@linux.ibm.com>2018-08-06 16:24:55 -0300
committerPedro Franco de Carvalho <pedromfc@linux.ibm.com>2018-08-06 16:36:36 -0300
commit4277c4b87addb5354cc47b98d7a73e44cfaf22c2 (patch)
treef727f73fc3f704752b1d6614d382a6070ca72bf3 /gdb/tracepoint.h
parent3df3a985a475db004706d64f83d9085f99053611 (diff)
downloadbinutils-4277c4b87addb5354cc47b98d7a73e44cfaf22c2.zip
binutils-4277c4b87addb5354cc47b98d7a73e44cfaf22c2.tar.gz
binutils-4277c4b87addb5354cc47b98d7a73e44cfaf22c2.tar.bz2
Use remote register numbers in tracepoint mask
Currently, tracepoint register masks in the QTDP packets include both internal and remote register numbers, as well as pseudo-register numbers. This patch changes this so that the mask only includes remote register numbers. Register numbers from agent expressions are already set in the mask using remote numbers. Other tracepoint actions used internal numbers, e.g. "collect $regs" or "collect $<pseudoreg>". To handle pseudoreg numbers, an empty agent expression is created and ax_reg_mask is called for this expression and the pseudoreg. This will cause the ax to set its mask with the corresponding remote raw register numbers (using ax_regs_mask, which calls gdbarch_ax_pseudo_register_collect). If ax_regs_mask and gdbarch_ax_pseudo_register_collect also generate more ax bytecode, the ax is also appended to the collection list. It isn't clear that this was the original intent for gdbarch_ax_pseudo_register_collect, and none of the arches seem to do this, but if this changes in the future, it should work. The patch also refactors the code used by validate_action line to validate axs into a function that is now called from every place that generates axs. Previously, some parts of tracepoint.c that generated axs didn't check if the ax length was greater than MAX_AGENT_EXPR_LEN. gdb/ChangeLog: 2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * tracepoint.h (class collection_list) <add_register>: Remove. <add_remote_register, add_ax_registers, add_local_register>: Declare. <add_memrange>: Add scope parameter. * tracepoint.c (encode_actions_1): Likewise. (collection_list::add_register): Rename to ... (collection_list::add_remote_register): ... this. Update comment. (collection_list::add_ax_registers, add_local_register): New methods. (collection_list::add_memrange): Add scope parameter. Call add_local_register instead of add_register. (finalize_tracepoint_aexpr): New function. (collection_list::collect_symbol): Update calls to add_memrange. Call add_local_register instead of add_register. Call add_ax_registers. Call finalize_tracepoint_aexpr. (encode_actions_1): Get remote regnos for $reg action. Call add_remote_register, add_ax_registers, and add_local_register. Update call to add_memrange. Call finalize_tracepoint_aexpr. (validate_actionline): Call finalize_tracepoint_aexpr.
Diffstat (limited to 'gdb/tracepoint.h')
-rw-r--r--gdb/tracepoint.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index 42e4130..8bdad35 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -262,10 +262,14 @@ public:
/* Add AEXPR to the list, taking ownership. */
void add_aexpr (agent_expr_up aexpr);
- void add_register (unsigned int regno);
+ void add_remote_register (unsigned int regno);
+ void add_ax_registers (struct agent_expr *aexpr);
+ void add_local_register (struct gdbarch *gdbarch,
+ unsigned int regno,
+ CORE_ADDR scope);
void add_memrange (struct gdbarch *gdbarch,
int type, bfd_signed_vma base,
- unsigned long len);
+ unsigned long len, CORE_ADDR scope);
void collect_symbol (struct symbol *sym,
struct gdbarch *gdbarch,
long frame_regno, long frame_offset,