From a04b0428abc8564638c910f80b68a1cc7f14d3b2 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 24 Feb 2011 07:39:48 +0000 Subject: Revert the following change (not approved yet): 2011-02-21 Hui Zhu * 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. --- gdb/tracepoint.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'gdb/tracepoint.c') diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 987edcc..2d675ce 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -51,7 +51,6 @@ #include "ax.h" #include "ax-gdb.h" #include "memrange.h" -#include "printcmd.h" /* readline include files */ #include "readline/readline.h" @@ -764,28 +763,6 @@ validate_actionline (char **line, struct breakpoint *t) error (_("while-stepping step count `%s' is malformed."), *line); } - else if (cmd_cfunc_eq (c, printf_command)) - { - char fbuf[101]; - - for (loc = t->loc; loc; loc = loc->next) - { - int nargs; - aexpr = new_agent_expr (loc->gdbarch, loc->address); - old_chain = make_cleanup_free_agent_expr (aexpr); - string_printf (p, NULL, gen_printf_expr_callback, - loc, aexpr); - ax_simple (aexpr, aop_end); - /* The agent expr include expr for arguments, format string, 1 byte - for aop_printf, 1 byte for the number of arguments, 1 byte for - size of format string, 1 byte for blank after format string - and 1 byte for aop_end. */ - if (aexpr->len > MAX_AGENT_EXPR_LEN) - error (_("Expression is too complicated.")); - do_cleanups (old_chain); - } - } - else if (cmd_cfunc_eq (c, end_actions_pseudocommand)) ; @@ -1497,22 +1474,6 @@ encode_actions_1 (struct command_line *action, encode_actions_1 (action->body_list[0], t, tloc, frame_reg, frame_offset, stepping_list, NULL); } - else if (cmd_cfunc_eq (cmd, printf_command)) - { - char fbuf[101]; - struct cleanup *old_chain = NULL; - - aexpr = new_agent_expr (tloc->gdbarch, tloc->address); - old_chain = make_cleanup_free_agent_expr (aexpr); - string_printf (action_exp, NULL, gen_printf_expr_callback, - tloc, aexpr); - ax_simple (aexpr, aop_end); - - ax_reqs (aexpr); - report_agent_reqs_errors (aexpr); - discard_cleanups (old_chain); - add_aexpr (collect, aexpr); - } else error (_("Invalid tracepoint command '%s'"), action->line); } /* for */ -- cgit v1.1