This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Disallow pseudo-registers in agent expression.


On 26/01/2008, andrzej zaborowski <balrogg@gmail.com> wrote:
> Attached is a mailer-unmangled version of the same file:

Oops
2008-01-26  Andrzej Zaborowski  <balrog@zabor.org>
	* ax-gdb.c (gen_expr): Check that register is raw or cooked.
	* tracepoint.c (read_actions): Actions need to be free-able.

diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -1607,6 +1607,8 @@ gen_expr (union exp_element **pc, struct agent_expr *ax,
 	if (reg == -1)
 	  internal_error (__FILE__, __LINE__,
 			  _("Register $%s not available"), name);
+	if (reg >= gdbarch_num_regs (current_gdbarch))
+	  error (_("GDB agent expressions cannot use pseudo-registers."));
 	value->kind = axs_lvalue_register;
 	value->u.reg = reg;
 	value->type = register_type (current_gdbarch, reg);
index 2d744ae..ba57fee 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -862,8 +862,11 @@ read_actions (struct tracepoint *t)
 	line = gdb_readline (0);
 
       if (!line)
-	line = "end";
-      
+	{
+	  line = xstrdup ("end");
+	  printf_filtered ("end\n");
+	}
+
       linetype = validate_actionline (&line, t);
       if (linetype == BADLINE)
 	continue;		/* already warned -- collect another line */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]