|
|
4c2ad1 |
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
|
4c2ad1 |
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
4c2ad1 |
Date: Thu, 9 Aug 2018 17:17:16 +0200
|
|
|
4c2ad1 |
Subject: gdb-rhbz1187581-power8-regs-4of7.patch
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
;; Add GDB support to access/display POWER8 registers (IBM, RH BZ 1187581).
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
commit 4277c4b87addb5354cc47b98d7a73e44cfaf22c2
|
|
|
4c2ad1 |
Author: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
|
|
4c2ad1 |
Date: Mon Aug 6 16:24:55 2018 -0300
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
Use remote register numbers in tracepoint mask
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
Currently, tracepoint register masks in the QTDP packets include both
|
|
|
4c2ad1 |
internal and remote register numbers, as well as pseudo-register
|
|
|
4c2ad1 |
numbers.
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
This patch changes this so that the mask only includes remote register
|
|
|
4c2ad1 |
numbers.
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
Register numbers from agent expressions are already set in the mask
|
|
|
4c2ad1 |
using remote numbers. Other tracepoint actions used internal numbers,
|
|
|
4c2ad1 |
e.g. "collect $regs" or "collect $<pseudoreg>". To handle pseudoreg
|
|
|
4c2ad1 |
numbers, an empty agent expression is created and ax_reg_mask is
|
|
|
4c2ad1 |
called for this expression and the pseudoreg. This will cause the ax
|
|
|
4c2ad1 |
to set its mask with the corresponding remote raw register
|
|
|
4c2ad1 |
numbers (using ax_regs_mask, which calls
|
|
|
4c2ad1 |
gdbarch_ax_pseudo_register_collect).
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
If ax_regs_mask and gdbarch_ax_pseudo_register_collect also generate
|
|
|
4c2ad1 |
more ax bytecode, the ax is also appended to the collection list. It
|
|
|
4c2ad1 |
isn't clear that this was the original intent for
|
|
|
4c2ad1 |
gdbarch_ax_pseudo_register_collect, and none of the arches seem to do
|
|
|
4c2ad1 |
this, but if this changes in the future, it should work.
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
The patch also refactors the code used by validate_action line to
|
|
|
4c2ad1 |
validate axs into a function that is now called from every place that
|
|
|
4c2ad1 |
generates axs. Previously, some parts of tracepoint.c that generated
|
|
|
4c2ad1 |
axs didn't check if the ax length was greater than MAX_AGENT_EXPR_LEN.
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
gdb/ChangeLog:
|
|
|
4c2ad1 |
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
* tracepoint.h (class collection_list) <add_register>: Remove.
|
|
|
4c2ad1 |
<add_remote_register, add_ax_registers, add_local_register>:
|
|
|
4c2ad1 |
Declare.
|
|
|
4c2ad1 |
<add_memrange>: Add scope parameter.
|
|
|
4c2ad1 |
* tracepoint.c (encode_actions_1): Likewise.
|
|
|
4c2ad1 |
(collection_list::add_register): Rename to ...
|
|
|
4c2ad1 |
(collection_list::add_remote_register): ... this. Update
|
|
|
4c2ad1 |
comment.
|
|
|
4c2ad1 |
(collection_list::add_ax_registers, add_local_register): New
|
|
|
4c2ad1 |
methods.
|
|
|
4c2ad1 |
(collection_list::add_memrange): Add scope parameter. Call
|
|
|
4c2ad1 |
add_local_register instead of add_register.
|
|
|
4c2ad1 |
(finalize_tracepoint_aexpr): New function.
|
|
|
4c2ad1 |
(collection_list::collect_symbol): Update calls to add_memrange.
|
|
|
4c2ad1 |
Call add_local_register instead of add_register. Call
|
|
|
4c2ad1 |
add_ax_registers. Call finalize_tracepoint_aexpr.
|
|
|
4c2ad1 |
(encode_actions_1): Get remote regnos for $reg action. Call
|
|
|
4c2ad1 |
add_remote_register, add_ax_registers, and add_local_register.
|
|
|
4c2ad1 |
Update call to add_memrange. Call finalize_tracepoint_aexpr.
|
|
|
4c2ad1 |
(validate_actionline): Call finalize_tracepoint_aexpr.
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
+2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ * tracepoint.h (class collection_list) <add_register>: Remove.
|
|
|
4c2ad1 |
+ <add_remote_register, add_ax_registers, add_local_register>:
|
|
|
4c2ad1 |
+ Declare.
|
|
|
4c2ad1 |
+ <add_memrange>: Add scope parameter.
|
|
|
4c2ad1 |
+ * tracepoint.c (encode_actions_1): Likewise.
|
|
|
4c2ad1 |
+ (collection_list::add_register): Rename to ...
|
|
|
4c2ad1 |
+ (collection_list::add_remote_register): ... this. Update
|
|
|
4c2ad1 |
+ comment.
|
|
|
4c2ad1 |
+ (collection_list::add_ax_registers, add_local_register): New
|
|
|
4c2ad1 |
+ methods.
|
|
|
4c2ad1 |
+ (collection_list::add_memrange): Add scope parameter. Call
|
|
|
4c2ad1 |
+ add_local_register instead of add_register.
|
|
|
4c2ad1 |
+ (finalize_tracepoint_aexpr): New function.
|
|
|
4c2ad1 |
+ (collection_list::collect_symbol): Update calls to add_memrange.
|
|
|
4c2ad1 |
+ Call add_local_register instead of add_register. Call
|
|
|
4c2ad1 |
+ add_ax_registers. Call finalize_tracepoint_aexpr.
|
|
|
4c2ad1 |
+ (encode_actions_1): Get remote regnos for $reg action. Call
|
|
|
4c2ad1 |
+ add_remote_register, add_ax_registers, and add_local_register.
|
|
|
4c2ad1 |
+ Update call to add_memrange. Call finalize_tracepoint_aexpr.
|
|
|
4c2ad1 |
+ (validate_actionline): Call finalize_tracepoint_aexpr.
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
* remote.c (remote_target::download_tracepoint): Remove BUF_SIZE.
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
|
|
|
4c2ad1 |
--- a/gdb/tracepoint.c
|
|
|
4c2ad1 |
+++ b/gdb/tracepoint.c
|
|
|
4c2ad1 |
@@ -615,6 +615,19 @@ report_agent_reqs_errors (struct agent_expr *aexpr)
|
|
|
4c2ad1 |
error (_("Expression is too complicated."));
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
+/* Call ax_reqs on AEXPR and raise an error if something is wrong. */
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+static void
|
|
|
4c2ad1 |
+finalize_tracepoint_aexpr (struct agent_expr *aexpr)
|
|
|
4c2ad1 |
+{
|
|
|
4c2ad1 |
+ ax_reqs (aexpr);
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
|
|
4c2ad1 |
+ error (_("Expression is too complicated."));
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ report_agent_reqs_errors (aexpr);
|
|
|
4c2ad1 |
+}
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
/* worker function */
|
|
|
4c2ad1 |
void
|
|
|
4c2ad1 |
validate_actionline (const char *line, struct breakpoint *b)
|
|
|
4c2ad1 |
@@ -699,12 +712,7 @@ validate_actionline (const char *line, struct breakpoint *b)
|
|
|
4c2ad1 |
exp.get (),
|
|
|
4c2ad1 |
trace_string);
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
- if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
|
|
4c2ad1 |
- error (_("Expression is too complicated."));
|
|
|
4c2ad1 |
-
|
|
|
4c2ad1 |
- ax_reqs (aexpr.get ());
|
|
|
4c2ad1 |
-
|
|
|
4c2ad1 |
- report_agent_reqs_errors (aexpr.get ());
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
while (p && *p++ == ',');
|
|
|
4c2ad1 |
@@ -731,11 +739,7 @@ validate_actionline (const char *line, struct breakpoint *b)
|
|
|
4c2ad1 |
long. */
|
|
|
4c2ad1 |
agent_expr_up aexpr = gen_eval_for_expr (loc->address, exp.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
- if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
|
|
4c2ad1 |
- error (_("Expression is too complicated."));
|
|
|
4c2ad1 |
-
|
|
|
4c2ad1 |
- ax_reqs (aexpr.get ());
|
|
|
4c2ad1 |
- report_agent_reqs_errors (aexpr.get ());
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
while (p && *p++ == ',');
|
|
|
4c2ad1 |
@@ -811,10 +815,10 @@ memrange_sortmerge (std::vector<memrange> &memranges)
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
-/* Add a register to a collection list. */
|
|
|
4c2ad1 |
+/* Add remote register number REGNO to the collection list mask. */
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
void
|
|
|
4c2ad1 |
-collection_list::add_register (unsigned int regno)
|
|
|
4c2ad1 |
+collection_list::add_remote_register (unsigned int regno)
|
|
|
4c2ad1 |
{
|
|
|
4c2ad1 |
if (info_verbose)
|
|
|
4c2ad1 |
printf_filtered ("collect register %d\n", regno);
|
|
|
4c2ad1 |
@@ -824,12 +828,74 @@ collection_list::add_register (unsigned int regno)
|
|
|
4c2ad1 |
m_regs_mask[regno / 8] |= 1 << (regno % 8);
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
+/* Add all the registers from the mask in AEXPR to the mask in the
|
|
|
4c2ad1 |
+ collection list. Registers in the AEXPR mask are already remote
|
|
|
4c2ad1 |
+ register numbers. */
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+void
|
|
|
4c2ad1 |
+collection_list::add_ax_registers (struct agent_expr *aexpr)
|
|
|
4c2ad1 |
+{
|
|
|
4c2ad1 |
+ if (aexpr->reg_mask_len > 0)
|
|
|
4c2ad1 |
+ {
|
|
|
4c2ad1 |
+ for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
|
|
4c2ad1 |
+ {
|
|
|
4c2ad1 |
+ QUIT; /* Allow user to bail out with ^C. */
|
|
|
4c2ad1 |
+ if (aexpr->reg_mask[ndx1] != 0)
|
|
|
4c2ad1 |
+ {
|
|
|
4c2ad1 |
+ /* Assume chars have 8 bits. */
|
|
|
4c2ad1 |
+ for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
|
|
4c2ad1 |
+ if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
|
|
4c2ad1 |
+ /* It's used -- record it. */
|
|
|
4c2ad1 |
+ add_remote_register (ndx1 * 8 + ndx2);
|
|
|
4c2ad1 |
+ }
|
|
|
4c2ad1 |
+ }
|
|
|
4c2ad1 |
+ }
|
|
|
4c2ad1 |
+}
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+/* If REGNO is raw, add its corresponding remote register number to
|
|
|
4c2ad1 |
+ the mask. If REGNO is a pseudo-register, figure out the necessary
|
|
|
4c2ad1 |
+ registers using a temporary agent expression, and add it to the
|
|
|
4c2ad1 |
+ list if it needs more than just a mask. */
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+void
|
|
|
4c2ad1 |
+collection_list::add_local_register (struct gdbarch *gdbarch,
|
|
|
4c2ad1 |
+ unsigned int regno,
|
|
|
4c2ad1 |
+ CORE_ADDR scope)
|
|
|
4c2ad1 |
+{
|
|
|
4c2ad1 |
+ if (regno < gdbarch_num_regs (gdbarch))
|
|
|
4c2ad1 |
+ {
|
|
|
4c2ad1 |
+ int remote_regno = gdbarch_remote_register_number (gdbarch, regno);
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ if (remote_regno < 0)
|
|
|
4c2ad1 |
+ error (_("Can't collect register %d"), regno);
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ add_remote_register (remote_regno);
|
|
|
4c2ad1 |
+ }
|
|
|
4c2ad1 |
+ else
|
|
|
4c2ad1 |
+ {
|
|
|
4c2ad1 |
+ agent_expr_up aexpr (new agent_expr (gdbarch, scope));
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ ax_reg_mask (aexpr.get (), regno);
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ add_ax_registers (aexpr.get ());
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ /* Usually ax_reg_mask for a pseudo-regiser only sets the
|
|
|
4c2ad1 |
+ corresponding raw registers in the ax mask, but if this isn't
|
|
|
4c2ad1 |
+ the case add the expression that is generated to the
|
|
|
4c2ad1 |
+ collection list. */
|
|
|
4c2ad1 |
+ if (aexpr->len > 0)
|
|
|
4c2ad1 |
+ add_aexpr (std::move (aexpr));
|
|
|
4c2ad1 |
+ }
|
|
|
4c2ad1 |
+}
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
/* Add a memrange to a collection list. */
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
void
|
|
|
4c2ad1 |
collection_list::add_memrange (struct gdbarch *gdbarch,
|
|
|
4c2ad1 |
int type, bfd_signed_vma base,
|
|
|
4c2ad1 |
- ULONGEST len)
|
|
|
4c2ad1 |
+ ULONGEST len, CORE_ADDR scope)
|
|
|
4c2ad1 |
{
|
|
|
4c2ad1 |
if (info_verbose)
|
|
|
4c2ad1 |
printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
|
|
|
4c2ad1 |
@@ -840,7 +906,7 @@ collection_list::add_memrange (struct gdbarch *gdbarch,
|
|
|
4c2ad1 |
m_memranges.emplace_back (type, base, base + len);
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
if (type != memrange_absolute) /* Better collect the base register! */
|
|
|
4c2ad1 |
- add_register (type);
|
|
|
4c2ad1 |
+ add_local_register (gdbarch, type, scope);
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
/* Add a symbol to a collection list. */
|
|
|
4c2ad1 |
@@ -882,19 +948,19 @@ collection_list::collect_symbol (struct symbol *sym,
|
|
|
4c2ad1 |
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT)
|
|
|
4c2ad1 |
treat_as_expr = 1;
|
|
|
4c2ad1 |
else
|
|
|
4c2ad1 |
- add_memrange (gdbarch, memrange_absolute, offset, len);
|
|
|
4c2ad1 |
+ add_memrange (gdbarch, memrange_absolute, offset, len, scope);
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
case LOC_REGISTER:
|
|
|
4c2ad1 |
reg = SYMBOL_REGISTER_OPS (sym)->register_number (sym, gdbarch);
|
|
|
4c2ad1 |
if (info_verbose)
|
|
|
4c2ad1 |
printf_filtered ("LOC_REG[parm] %s: ",
|
|
|
4c2ad1 |
SYMBOL_PRINT_NAME (sym));
|
|
|
4c2ad1 |
- add_register (reg);
|
|
|
4c2ad1 |
+ add_local_register (gdbarch, reg, scope);
|
|
|
4c2ad1 |
/* Check for doubles stored in two registers. */
|
|
|
4c2ad1 |
/* FIXME: how about larger types stored in 3 or more regs? */
|
|
|
4c2ad1 |
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
|
|
|
4c2ad1 |
len > register_size (gdbarch, reg))
|
|
|
4c2ad1 |
- add_register (reg + 1);
|
|
|
4c2ad1 |
+ add_local_register (gdbarch, reg + 1, scope);
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
case LOC_REF_ARG:
|
|
|
4c2ad1 |
printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
|
|
|
4c2ad1 |
@@ -911,7 +977,7 @@ collection_list::collect_symbol (struct symbol *sym,
|
|
|
4c2ad1 |
SYMBOL_PRINT_NAME (sym), pulongest (len),
|
|
|
4c2ad1 |
paddress (gdbarch, offset), reg);
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
- add_memrange (gdbarch, reg, offset, len);
|
|
|
4c2ad1 |
+ add_memrange (gdbarch, reg, offset, len, scope);
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
case LOC_REGPARM_ADDR:
|
|
|
4c2ad1 |
reg = SYMBOL_VALUE (sym);
|
|
|
4c2ad1 |
@@ -923,7 +989,7 @@ collection_list::collect_symbol (struct symbol *sym,
|
|
|
4c2ad1 |
SYMBOL_PRINT_NAME (sym), pulongest (len),
|
|
|
4c2ad1 |
paddress (gdbarch, offset), reg);
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
- add_memrange (gdbarch, reg, offset, len);
|
|
|
4c2ad1 |
+ add_memrange (gdbarch, reg, offset, len, scope);
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
case LOC_LOCAL:
|
|
|
4c2ad1 |
reg = frame_regno;
|
|
|
4c2ad1 |
@@ -935,7 +1001,7 @@ collection_list::collect_symbol (struct symbol *sym,
|
|
|
4c2ad1 |
SYMBOL_PRINT_NAME (sym), pulongest (len),
|
|
|
4c2ad1 |
paddress (gdbarch, offset), reg);
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
- add_memrange (gdbarch, reg, offset, len);
|
|
|
4c2ad1 |
+ add_memrange (gdbarch, reg, offset, len, scope);
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
case LOC_UNRESOLVED:
|
|
|
4c2ad1 |
@@ -968,26 +1034,10 @@ collection_list::collect_symbol (struct symbol *sym,
|
|
|
4c2ad1 |
return;
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
- ax_reqs (aexpr.get ());
|
|
|
4c2ad1 |
-
|
|
|
4c2ad1 |
- report_agent_reqs_errors (aexpr.get ());
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
/* Take care of the registers. */
|
|
|
4c2ad1 |
- if (aexpr->reg_mask_len > 0)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- QUIT; /* Allow user to bail out with ^C. */
|
|
|
4c2ad1 |
- if (aexpr->reg_mask[ndx1] != 0)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- /* Assume chars have 8 bits. */
|
|
|
4c2ad1 |
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
|
|
4c2ad1 |
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
|
|
4c2ad1 |
- /* It's used -- record it. */
|
|
|
4c2ad1 |
- add_register (ndx1 * 8 + ndx2);
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
+ add_ax_registers (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
add_aexpr (std::move (aexpr));
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
@@ -1257,8 +1307,18 @@ encode_actions_1 (struct command_line *action,
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
if (0 == strncasecmp ("$reg", action_exp, 4))
|
|
|
4c2ad1 |
{
|
|
|
4c2ad1 |
- for (i = 0; i < gdbarch_num_regs (target_gdbarch ()); i++)
|
|
|
4c2ad1 |
- collect->add_register (i);
|
|
|
4c2ad1 |
+ for (i = 0; i < gdbarch_num_regs (target_gdbarch ());
|
|
|
4c2ad1 |
+ i++)
|
|
|
4c2ad1 |
+ {
|
|
|
4c2ad1 |
+ int remote_regno = (gdbarch_remote_register_number
|
|
|
4c2ad1 |
+ (target_gdbarch (), i));
|
|
|
4c2ad1 |
+
|
|
|
4c2ad1 |
+ /* Ignore arch regnos without a corresponding
|
|
|
4c2ad1 |
+ remote regno. This can happen for regnos not
|
|
|
4c2ad1 |
+ in the tdesc. */
|
|
|
4c2ad1 |
+ if (remote_regno >= 0)
|
|
|
4c2ad1 |
+ collect->add_remote_register (remote_regno);
|
|
|
4c2ad1 |
+ }
|
|
|
4c2ad1 |
action_exp = strchr (action_exp, ','); /* more? */
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
else if (0 == strncasecmp ("$arg", action_exp, 4))
|
|
|
4c2ad1 |
@@ -1288,27 +1348,10 @@ encode_actions_1 (struct command_line *action,
|
|
|
4c2ad1 |
target_gdbarch (),
|
|
|
4c2ad1 |
trace_string);
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
- ax_reqs (aexpr.get ());
|
|
|
4c2ad1 |
- report_agent_reqs_errors (aexpr.get ());
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
/* take care of the registers */
|
|
|
4c2ad1 |
- if (aexpr->reg_mask_len > 0)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- QUIT; /* allow user to bail out with ^C */
|
|
|
4c2ad1 |
- if (aexpr->reg_mask[ndx1] != 0)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- /* assume chars have 8 bits */
|
|
|
4c2ad1 |
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
|
|
4c2ad1 |
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- /* It's used -- record it. */
|
|
|
4c2ad1 |
- collect->add_register (ndx1 * 8 + ndx2);
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
+ collect->add_ax_registers (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
collect->add_aexpr (std::move (aexpr));
|
|
|
4c2ad1 |
action_exp = strchr (action_exp, ','); /* more? */
|
|
|
4c2ad1 |
@@ -1340,7 +1383,8 @@ encode_actions_1 (struct command_line *action,
|
|
|
4c2ad1 |
name);
|
|
|
4c2ad1 |
if (info_verbose)
|
|
|
4c2ad1 |
printf_filtered ("OP_REGISTER: ");
|
|
|
4c2ad1 |
- collect->add_register (i);
|
|
|
4c2ad1 |
+ collect->add_local_register (target_gdbarch (),
|
|
|
4c2ad1 |
+ i, tloc->address);
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
}
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
@@ -1352,7 +1396,8 @@ encode_actions_1 (struct command_line *action,
|
|
|
4c2ad1 |
check_typedef (exp->elts[1].type);
|
|
|
4c2ad1 |
collect->add_memrange (target_gdbarch (),
|
|
|
4c2ad1 |
memrange_absolute, addr,
|
|
|
4c2ad1 |
- TYPE_LENGTH (exp->elts[1].type));
|
|
|
4c2ad1 |
+ TYPE_LENGTH (exp->elts[1].type),
|
|
|
4c2ad1 |
+ tloc->address);
|
|
|
4c2ad1 |
collect->append_exp (exp.get ());
|
|
|
4c2ad1 |
break;
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
@@ -1376,28 +1421,10 @@ encode_actions_1 (struct command_line *action,
|
|
|
4c2ad1 |
exp.get (),
|
|
|
4c2ad1 |
trace_string);
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
- ax_reqs (aexpr.get ());
|
|
|
4c2ad1 |
-
|
|
|
4c2ad1 |
- report_agent_reqs_errors (aexpr.get ());
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
/* Take care of the registers. */
|
|
|
4c2ad1 |
- if (aexpr->reg_mask_len > 0)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- QUIT; /* Allow user to bail out with ^C. */
|
|
|
4c2ad1 |
- if (aexpr->reg_mask[ndx1] != 0)
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- /* Assume chars have 8 bits. */
|
|
|
4c2ad1 |
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
|
|
|
4c2ad1 |
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
|
|
|
4c2ad1 |
- {
|
|
|
4c2ad1 |
- /* It's used -- record it. */
|
|
|
4c2ad1 |
- collect->add_register (ndx1 * 8 + ndx2);
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
- }
|
|
|
4c2ad1 |
+ collect->add_ax_registers (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
collect->add_aexpr (std::move (aexpr));
|
|
|
4c2ad1 |
collect->append_exp (exp.get ());
|
|
|
4c2ad1 |
@@ -1422,8 +1449,7 @@ encode_actions_1 (struct command_line *action,
|
|
|
4c2ad1 |
agent_expr_up aexpr = gen_eval_for_expr (tloc->address,
|
|
|
4c2ad1 |
exp.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
- ax_reqs (aexpr.get ());
|
|
|
4c2ad1 |
- report_agent_reqs_errors (aexpr.get ());
|
|
|
4c2ad1 |
+ finalize_tracepoint_aexpr (aexpr.get ());
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
/* Even though we're not officially collecting, add
|
|
|
4c2ad1 |
to the collect list anyway. */
|
|
|
4c2ad1 |
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
|
|
|
4c2ad1 |
--- a/gdb/tracepoint.h
|
|
|
4c2ad1 |
+++ b/gdb/tracepoint.h
|
|
|
4c2ad1 |
@@ -263,9 +263,14 @@ public:
|
|
|
4c2ad1 |
void add_aexpr (agent_expr_up aexpr);
|
|
|
4c2ad1 |
|
|
|
4c2ad1 |
void add_register (unsigned int regno);
|
|
|
4c2ad1 |
+ void add_remote_register (unsigned int regno);
|
|
|
4c2ad1 |
+ void add_ax_registers (struct agent_expr *aexpr);
|
|
|
4c2ad1 |
+ void add_local_register (struct gdbarch *gdbarch,
|
|
|
4c2ad1 |
+ unsigned int regno,
|
|
|
4c2ad1 |
+ CORE_ADDR scope);
|
|
|
4c2ad1 |
void add_memrange (struct gdbarch *gdbarch,
|
|
|
4c2ad1 |
int type, bfd_signed_vma base,
|
|
|
4c2ad1 |
- ULONGEST len);
|
|
|
4c2ad1 |
+ ULONGEST len, CORE_ADDR scope);
|
|
|
4c2ad1 |
void collect_symbol (struct symbol *sym,
|
|
|
4c2ad1 |
struct gdbarch *gdbarch,
|
|
|
4c2ad1 |
long frame_regno, long frame_offset,
|