This is the mail archive of the archer-commits@sourceware.org mailing list for the Archer 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]

[SCM] master: Merge remote-tracking branch 'gdb/master'


The branch, master has been updated
       via  164e31cf9dd1a90500f6199c06e31f788e1c3b79 (commit)
       via  dbc21176c80d4354e66be0fd9a2c492738748db9 (commit)
       via  74e82dd2d59e83f897823ddc27386e7b6e87d49c (commit)
       via  6a68075223aa5f972c828b58e2426540b4bfb6cc (commit)
       via  9760e7fbdb9421e66f92fa2bee8c733138434c0c (commit)
       via  59a865cca319154f174699f0f8092143ef8dcbce (commit)
      from  35f19dab587ce780030a45bdd3f6f764ebe37a35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 164e31cf9dd1a90500f6199c06e31f788e1c3b79
Merge: dbc2117 74e82dd
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Thu Feb 24 11:03:45 2011 +0100

    Merge remote-tracking branch 'gdb/master'

commit dbc21176c80d4354e66be0fd9a2c492738748db9
Merge: 59a865c 35f19da
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Thu Feb 24 10:56:21 2011 +0100

    Merge branch 'master' of ssh://sourceware.org/git/archer

commit 74e82dd2d59e83f897823ddc27386e7b6e87d49c
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu Feb 24 07:39:46 2011 +0000

    Revert the following change (not approved yet):
    
    	2011-02-21  Hui Zhu  <teawater@gmail.com>
    	* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h.
    	* ax-gdb.c (gen_printf_expr_callback): New function.
    	* ax-gdb.h (gen_printf_expr_callback): Forward declare.
    	* ax-general.c (ax_memcpy): New function.
    	(ax_print): Handle "printf".
    	(ax_reqs): Ditto.
    	* ax.h (ax_memcpy): Forward declare.
    	* common/ax.def (invalid2): Removed.
    	(printf): New entry.
    	* printcmd.c (printcmd.h): New include.
    	(string_printf): New function.
    	(ui_printf): Removed.
    	(printf_command): Remove static.  Call string_printf.
    	(eval_command): Call string_printf.
    	* printcmd.h: New file.
    	* tracepoint.c (validate_actionline,
    	encode_actions_1): handle printf_command.

commit 6a68075223aa5f972c828b58e2426540b4bfb6cc
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu Feb 24 07:38:42 2011 +0000

    Revert the following patch (printf tracepoint op) (not approved yet)
    
            2011-02-21  Hui Zhu  <teawater@gmail.com>
            * tracepoint.c (tp_printf): New function.
            (eval_agent_expr): Handle gdb_agent_op_printf.

commit 9760e7fbdb9421e66f92fa2bee8c733138434c0c
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu Feb 24 07:37:59 2011 +0000

    Revert the following patch (code patch was not approved):
    
            2011-02-21  Hui Zhu  <teawater@gmail.com>
            * agentexpr.texi (bytecode descriptions): add printf.
            * gdb.texinfo (tracepoint action lists): add printf.

commit 59a865cca319154f174699f0f8092143ef8dcbce
Merge: d937037 b4f1a6c
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Wed Feb 23 12:28:00 2011 +0100

    Merge remote-tracking branch 'gdb/master'

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog              |   22 ++++++++++++++++
 gdb/Makefile.in            |    2 +-
 gdb/ax-gdb.c               |   59 --------------------------------------------
 gdb/ax-gdb.h               |    2 -
 gdb/ax-general.c           |   53 +++++----------------------------------
 gdb/ax.h                   |    2 -
 gdb/common/ax.def          |    6 +++-
 gdb/doc/ChangeLog          |    7 +++++
 gdb/doc/agentexpr.texi     |    7 -----
 gdb/doc/gdb.texinfo        |    6 ----
 gdb/gdbserver/ChangeLog    |    7 +++++
 gdb/gdbserver/tracepoint.c |   44 --------------------------------
 gdb/printcmd.c             |   38 ++++++---------------------
 gdb/printcmd.h             |   30 ----------------------
 gdb/tracepoint.c           |   39 -----------------------------
 15 files changed, 58 insertions(+), 266 deletions(-)
 delete mode 100644 gdb/printcmd.h

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc358a0..0b03569 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,25 @@
+2011-02-24  Joel Brobecker  <brobecker@adacore.com>
+
+	Revert the following patch (not approved yet):
+	2011-02-21  Hui Zhu  <teawater@gmail.com>
+	* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h.
+	* ax-gdb.c (gen_printf_expr_callback): New function.
+	* ax-gdb.h (gen_printf_expr_callback): Forward declare.
+	* ax-general.c (ax_memcpy): New function.
+	(ax_print): Handle "printf".
+	(ax_reqs): Ditto.
+	* ax.h (ax_memcpy): Forward declare.
+	* common/ax.def (invalid2): Removed.
+	(printf): New entry.
+	* printcmd.c (printcmd.h): New include.
+	(string_printf): New function.
+	(ui_printf): Removed.
+	(printf_command): Remove static.  Call string_printf.
+	(eval_command): Call string_printf.
+	* printcmd.h: New file.
+	* tracepoint.c (validate_actionline,
+	encode_actions_1): handle printf_command.
+
 2011-02-23  Tom Tromey  <tromey@redhat.com>
 
 	* ax-general.c (ax_pick): Add missing newline.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 6363773..fae43b2 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -808,7 +808,7 @@ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h	\
 remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \
 sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \
 gdb_usleep.h jit.h xml-syscall.h microblaze-tdep.h \
-psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h printcmd.h
+psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h
 
 # Header files that already have srcdir in them, or which are in objdir.
 
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index d995d87..d1736e1 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2445,65 +2445,6 @@ gen_eval_for_expr (CORE_ADDR scope, struct expression *expr)
   return ax;
 }
 
-void
-gen_printf_expr_callback (char *fbuf, char **expp, void *loc_v, void *aexpr_v)
-{
-  struct bp_location	*loc = loc_v;
-  struct agent_expr	*aexpr = aexpr_v;
-
-  if (expp)
-    {
-      struct cleanup *old_chain = NULL;
-      struct expression *expr = NULL;
-      union exp_element *pc;
-      struct axs_value value;
-
-      expr = parse_exp_1 (expp, block_for_pc (loc->address), 1);
-      old_chain = make_cleanup (free_current_contents, &expr);
-
-      pc = expr->elts;
-      trace_kludge = 0;
-      value.optimized_out = 0;
-      gen_expr (expr, &pc, aexpr, &value);
-
-      if (value.optimized_out)
-        error (_("value has been optimized out"));
-      switch (value.kind)
-        {
-	case axs_lvalue_memory:
-	  if (TYPE_CODE (value.type) != TYPE_CODE_ARRAY)
-	    {
-	      int length = TYPE_LENGTH (check_typedef (value.type));
-	      switch (length)
-		{
-		case 4:
-		  ax_simple (aexpr, aop_ref32);
-		  break;
-		case 8:
-		  ax_simple (aexpr, aop_ref64);
-		  break;
-		default:
-		  error (_("Size of value is not OK."));
-		  break;
-		}
-	    }
-	  break;
-	case axs_lvalue_register:
-	  ax_reg (aexpr, value.u.reg);
-	  break;
-        }
-
-      do_cleanups (old_chain);
-    }
-
-  ax_simple (aexpr, aop_printf);
-  if (expp)
-    ax_simple (aexpr, 1);
-  else
-    ax_simple (aexpr, 0);
-  ax_memcpy (aexpr, fbuf, strlen (fbuf) + 1);
-}
-
 static void
 agent_command (char *exp, int from_tty)
 {
diff --git a/gdb/ax-gdb.h b/gdb/ax-gdb.h
index 9b15230..a2367a6 100644
--- a/gdb/ax-gdb.h
+++ b/gdb/ax-gdb.h
@@ -108,8 +108,6 @@ extern struct agent_expr *gen_trace_for_var (CORE_ADDR, struct gdbarch *,
 
 extern struct agent_expr *gen_eval_for_expr (CORE_ADDR, struct expression *);
 
-extern void gen_printf_expr_callback (char *, char **, void *, void *);
-
 extern int trace_kludge;
 
 #endif /* AX_GDB_H */
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 62c382c..889fac9 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -331,14 +331,6 @@ ax_tsv (struct agent_expr *x, enum agent_op op, int num)
   x->buf[x->len + 2] = (num) & 0xff;
   x->len += 3;
 }
-
-void
-ax_memcpy (struct agent_expr *x, const void *src, size_t n)
-{
-  grow_expr (x, n);
-  memcpy (x->buf + x->len, src, n);
-  x->len += n;
-}
 
 
 
@@ -377,7 +369,6 @@ ax_print (struct ui_file *f, struct agent_expr *x)
   for (i = 0; i < x->len;)
     {
       enum agent_op op = x->buf[i];
-      int op_size;
 
       if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
 	  || !aop_map[op].name)
@@ -386,19 +377,7 @@ ax_print (struct ui_file *f, struct agent_expr *x)
 	  i++;
 	  continue;
 	}
-      if (op == aop_printf)
-        {
-	  if (i + 2 >= x->len)
-	    {
-	      fprintf_filtered (f, _("%3d  <bad opcode %02x>\n"), i, op);
-	      i++;
-	      continue;
-	    }
-	  op_size = 1 + strlen (x->buf + i + 2) + 1;
-	}
-      else
-	op_size = aop_map[op].op_size;
-      if (i + 1 + op_size > x->len)
+      if (i + 1 + aop_map[op].op_size > x->len)
 	{
 	  fprintf_filtered (f, _("%3d  <incomplete opcode %s>\n"),
 			    i, aop_map[op].name);
@@ -406,15 +385,15 @@ ax_print (struct ui_file *f, struct agent_expr *x)
 	}
 
       fprintf_filtered (f, "%3d  %s", i, aop_map[op].name);
-      if (op_size > 0)
+      if (aop_map[op].op_size > 0)
 	{
 	  fputs_filtered (" ", f);
 
 	  print_longest (f, 'd', 0,
-			 read_const (x, i + 1, op_size));
+			 read_const (x, i + 1, aop_map[op].op_size));
 	}
       fprintf_filtered (f, "\n");
-      i += 1 + op_size;
+      i += 1 + aop_map[op].op_size;
 
       is_float = (op == aop_float);
     }
@@ -482,8 +461,6 @@ ax_reqs (struct agent_expr *ax)
   /* Pointer to a description of the present op.  */
   struct aop_map *op;
 
-  int op_size = 0, consumed = 0;
-
   memset (targets, 0, ax->len * sizeof (targets[0]));
   memset (boundary, 0, ax->len * sizeof (boundary[0]));
 
@@ -491,7 +468,7 @@ ax_reqs (struct agent_expr *ax)
   ax->flaw = agent_flaw_none;
   ax->max_data_size = 0;
 
-  for (i = 0; i < ax->len; i += 1 + op_size)
+  for (i = 0; i < ax->len; i += 1 + op->op_size)
     {
       if (ax->buf[i] > (sizeof (aop_map) / sizeof (aop_map[0])))
 	{
@@ -507,23 +484,7 @@ ax_reqs (struct agent_expr *ax)
 	  return;
 	}
 
-      if (ax->buf[i] == aop_printf)
-        {
-	  if (i + 2 >= ax->len)
-	    {
-	      ax->flaw = agent_flaw_incomplete_instruction;
-	      return;
-	    }
-	  consumed = ax->buf[i + 1];
-	  op_size = 1 + strlen (ax->buf + i + 2) + 1;
-	}
-      else
-        {
-	  op_size = op->op_size;
-	  consumed = op->consumed;
-        }
-
-      if (i + 1 + op_size > ax->len)
+      if (i + 1 + op->op_size > ax->len)
 	{
 	  ax->flaw = agent_flaw_incomplete_instruction;
 	  return;
@@ -541,7 +502,7 @@ ax_reqs (struct agent_expr *ax)
       boundary[i] = 1;
       heights[i] = height;
 
-      height -= consumed;
+      height -= op->consumed;
       if (height < ax->min_height)
 	ax->min_height = height;
       height += op->produced;
diff --git a/gdb/ax.h b/gdb/ax.h
index 05dc6a1..a124575 100644
--- a/gdb/ax.h
+++ b/gdb/ax.h
@@ -213,8 +213,6 @@ extern void ax_reg_mask (struct agent_expr *ax, int reg);
 
 /* Assemble code to operate on a trace state variable.  */
 extern void ax_tsv (struct agent_expr *expr, enum agent_op op, int num);
-
-extern void ax_memcpy (struct agent_expr *x, const void *src, size_t n);
 
 
 /* Functions for printing out expressions, and otherwise debugging
diff --git a/gdb/common/ax.def b/gdb/common/ax.def
index f1be688..56ddd4a 100644
--- a/gdb/common/ax.def
+++ b/gdb/common/ax.def
@@ -86,8 +86,12 @@ DEFOP (swap, 0, 0, 2, 2, 0x2b)
 DEFOP (getv, 2, 0, 0, 1, 0x2c)
 DEFOP (setv, 2, 0, 0, 1, 0x2d)
 DEFOP (tracev, 2, 0, 0, 1, 0x2e)
+/* We need something here just to make the tables come out ok.  */
 DEFOP (invalid, 0, 0, 0, 0, 0x2f)
 DEFOP (trace16, 2, 0, 1, 1, 0x30)
-DEFOP (printf, 0, 0, 0, 0, 0x31)
+/* We need something here just to make the tables come out ok.  */
+DEFOP (invalid2, 0, 0, 0, 0, 0x2f)
+/* The "consumed" number for pick is wrong, but there's no way to
+   express the right thing.  */
 DEFOP (pick, 1, 0, 0, 1, 0x32)
 DEFOP (rot, 0, 0, 3, 3, 0x33)
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 3f91321..59cf1e4 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-24  Joel Brobecker  <brobecker@adacore.com>
+
+	Revert the following patch (code patch was not approved):
+	2011-02-21  Hui Zhu  <teawater@gmail.com>
+	* agentexpr.texi (bytecode descriptions): add printf.
+	* gdb.texinfo (tracepoint action lists): add printf.
+
 2011-02-23  Doug Evans  <dje@google.com>
 
 	* gdb.texinfo (Symbols In Python): Fix mention of C++, use C@t{++}.
diff --git a/gdb/doc/agentexpr.texi b/gdb/doc/agentexpr.texi
index 5a360df..f2d51b7 100644
--- a/gdb/doc/agentexpr.texi
+++ b/gdb/doc/agentexpr.texi
@@ -489,13 +489,6 @@ named @code{trace_quick16}, for consistency.
 Record the value of trace state variable number @var{n} in the trace
 buffer.  The handling of @var{n} is as described for @code{getv}.
 
-@item @code{printf} (0x31) @var{n} @var{template}: @result{}
-Print the values in the stack under the control of the string template.
-The end of @var{template} is 0x00.
-If @var{n} is 0, just output the string template.
-If @var{n} is 1, pop a value from the stack and print it under the control
-of the string template.
-
 @item @code{end} (0x27): @result{}
 Stop executing bytecode; the result should be the top element of the
 stack.  If the purpose of the expression was to compute an lvalue or a
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 32d9b44..c727dc8 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -10242,12 +10242,6 @@ state variables (@pxref{Trace State Variables}) without adding those
 values to the trace buffer, as would be the case if the @code{collect}
 action were used.
 
-@kindex printf
-@item printf @var{template}, @var{expressions}@dots{}
-Print the values of one or more @var{expressions} under the control of
-the string @var{template} in @code{gdbserver} part.
-The command format is with simple @code{printf} (@pxref{Output, printf}).
-
 @kindex while-stepping @r{(tracepoints)}
 @item while-stepping @var{n}
 Perform @var{n} single-step instruction traces after the tracepoint,
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 0f7655f..1f42a8e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-24  Joel Brobecker  <brobecker@adacore.com>
+
+	Revert the following patch (not approved yet):
+	2011-02-21  Hui Zhu  <teawater@gmail.com>
+	* tracepoint.c (tp_printf): New function.
+	(eval_agent_expr): Handle gdb_agent_op_printf.
+
 2011-02-21  Hui Zhu  <teawater@gmail.com>
 
 	* tracepoint.c (tp_printf): New function.
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index d897728..8d99c94 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -4214,16 +4214,6 @@ gdb_agent_op_name (int op)
   return gdb_agent_op_names[op];
 }
 
-int
-tp_printf (const char *format, ...)
-{
-  va_list ap;
-  va_start (ap, format);
-  vprintf (format, ap);
-  va_end (ap);
-  return 0;
-}
-
 /* The agent expression evaluator, as specified by the GDB docs. It
    returns 0 if everything went OK, and a nonzero error code
    otherwise.  */
@@ -4583,40 +4573,6 @@ eval_agent_expr (struct tracepoint_hit_ctx *ctx,
 	  agent_tsv_read (tframe, arg);
 	  break;
 
-	case gdb_agent_op_printf:
-	  {
-	    void *argv;
-	    arg = aexpr->bytes[pc++];
-	    argv = (void *) (unsigned long) top;
-	    if (--sp >= 0)
-	      top = stack[sp];
-
-	    if (arg)
-	      {
-		if (strstr ((char *) (aexpr->bytes + pc), "%s"))
-		  {
-		    int			i;
-		    unsigned char	buf[100];
-
-		    for (i = 0; i < 100; i++)
-		      {
-			agent_mem_read (tframe, buf + i,
-					(CORE_ADDR) ((unsigned long)argv + i),
-					1);
-			if (!buf[i])
-			  break;
-		      }
-		    tp_printf ((char *) (aexpr->bytes + pc), buf);
-		  }
-		else
-	          tp_printf ((char *) (aexpr->bytes + pc), argv);
-	      }
-	    else
-	      tp_printf ((char *) (aexpr->bytes + pc));
-	    pc += strlen ((char *) aexpr->bytes + pc) + 1;
-	  }
-	  break;
-
 	  /* GDB never (currently) generates any of these ops.  */
 	case gdb_agent_op_float:
 	case gdb_agent_op_ref_float:
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index ebca5a3..39ac8a8 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -49,7 +49,6 @@
 #include "parser-defs.h"
 #include "charset.h"
 #include "arch-utils.h"
-#include "printcmd.h"
 #include "cli/cli-utils.h"
 
 #ifdef TUI
@@ -1962,9 +1961,10 @@ print_variable_and_value (const char *name, struct symbol *var,
   fprintf_filtered (stream, "\n");
 }
 
-void
-string_printf (char *arg, struct ui_file *stream, printf_callback callback,
-	       void *loc_v, void *aexpr_v)
+/* printf "printf format string" ARG to STREAM.  */
+
+static void
+ui_printf (char *arg, struct ui_file *stream)
 {
   char *f = NULL;
   char *s = arg;
@@ -1975,8 +1975,6 @@ string_printf (char *arg, struct ui_file *stream, printf_callback callback,
   int nargs = 0;
   int allocated_args = 20;
   struct cleanup *old_cleanups;
-  struct bp_location *loc = loc_v;
-  struct agent_expr *aexpr = aexpr_v;
 
   val_args = xmalloc (allocated_args * sizeof (struct value *));
   old_cleanups = make_cleanup (free_current_contents, &val_args);
@@ -2295,42 +2293,26 @@ string_printf (char *arg, struct ui_file *stream, printf_callback callback,
     /* Now, parse all arguments and evaluate them.
        Store the VALUEs in VAL_ARGS.  */
 
-    if (callback)
-      current_substring = substrings;
     while (*s != '\0')
       {
 	char *s1;
 
-	s1 = s;
 	if (nargs == allocated_args)
 	  val_args = (struct value **) xrealloc ((char *) val_args,
 						 (allocated_args *= 2)
 						 * sizeof (struct value *));
-	if (callback)
-	  {
-	    if (nargs >= nargs_wanted)
-	      error (_("Wrong number of arguments for specified "
-		       "format-string"));
-	    callback (current_substring, &s1, loc, aexpr);
-	    current_substring += strlen (current_substring) + 1;
-	  }
-	else
-	  val_args[nargs] = parse_to_comma_and_eval (&s1);
+	s1 = s;
+	val_args[nargs] = parse_to_comma_and_eval (&s1);
 
 	nargs++;
 	s = s1;
 	if (*s == ',')
 	  s++;
       }
-    if (callback)
-      callback (last_arg, NULL, loc, aexpr);
 
     if (nargs != nargs_wanted)
       error (_("Wrong number of arguments for specified format-string"));
 
-    if (!stream)
-      goto after_print;
-
     /* Now actually print them.  */
     current_substring = substrings;
     for (i = 0; i < nargs; i++)
@@ -2685,17 +2667,15 @@ string_printf (char *arg, struct ui_file *stream, printf_callback callback,
        by default, which will warn here if there is no argument.  */
     fprintf_filtered (stream, last_arg, 0);
   }
-
-after_print:
   do_cleanups (old_cleanups);
 }
 
 /* Implement the "printf" command.  */
 
-void
+static void
 printf_command (char *arg, int from_tty)
 {
-  string_printf (arg, gdb_stdout, NULL, NULL, NULL);
+  ui_printf (arg, gdb_stdout);


hooks/post-receive
--
Repository for Project Archer.


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