From patchwork Wed Jun 24 15:16:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 7329 Received: (qmail 48335 invoked by alias); 24 Jun 2015 15:16:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 48287 invoked by uid 89); 24 Jun 2015 15:16:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 24 Jun 2015 15:16:21 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 21172340906 for ; Wed, 24 Jun 2015 15:16:20 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: trace: drop unused trace_one_insn Date: Wed, 24 Jun 2015 11:16:17 -0400 Message-Id: <1435158977-25641-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Everyone has migrated to the split functions (trace_prefix + trace_generic) a while ago, so we can drop this one now. Committed. --- sim/common/ChangeLog | 5 +++ sim/common/sim-trace.c | 85 -------------------------------------------------- sim/common/sim-trace.h | 13 -------- 3 files changed, 5 insertions(+), 98 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 37f97dc..ffb7ea8 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,10 @@ 2015-06-24 Mike Frysinger + * sim-trace.c (trace_one_insn): Delete. + * sim-trace.h (trace_one_insn): Delete. + +2015-06-24 Mike Frysinger + * sim-trace.c (debug_printf): Rename to ... (sim_debug_printf): ... this. * sim-trace.h (debug_printf): Delete define. diff --git a/sim/common/sim-trace.c b/sim/common/sim-trace.c index 40286e1..e69c62d 100644 --- a/sim/common/sim-trace.c +++ b/sim/common/sim-trace.c @@ -1218,91 +1218,6 @@ trace_vprintf (SIM_DESC sd, sim_cpu *cpu, const char *fmt, va_list ap) } } -/* The function trace_one_insn has been replaced by the function pair - trace_prefix() + trace_generic(). It is still used. */ -void -trace_one_insn (SIM_DESC sd, sim_cpu *cpu, address_word pc, - int line_p, const char *filename, int linenum, - const char *phase_wo_colon, const char *fmt, - ...) -{ - va_list ap; - char phase[SIZE_PHASE+2]; - - strncpy (phase, phase_wo_colon, SIZE_PHASE); - strcat (phase, ":"); - - if (!line_p) - { - trace_printf (sd, cpu, "%-*s %s:%-*d 0x%.*lx ", - SIZE_PHASE+1, phase, - filename, - SIZE_LINE_NUMBER, linenum, - SIZE_PC, (long)pc); - va_start (ap, fmt); - trace_vprintf (sd, cpu, fmt, ap); - va_end (ap); - trace_printf (sd, cpu, "\n"); - } - else - { - char buf[256]; - - buf[0] = 0; - if (STATE_TEXT_SECTION (CPU_STATE (cpu)) - && pc >= STATE_TEXT_START (CPU_STATE (cpu)) - && pc < STATE_TEXT_END (CPU_STATE (cpu))) - { - const char *pc_filename = (const char *)0; - const char *pc_function = (const char *)0; - unsigned int pc_linenum = 0; - - if (bfd_find_nearest_line (STATE_PROG_BFD (CPU_STATE (cpu)), - STATE_TEXT_SECTION (CPU_STATE (cpu)), - (struct bfd_symbol **) 0, - pc - STATE_TEXT_START (CPU_STATE (cpu)), - &pc_filename, &pc_function, &pc_linenum)) - { - char *p = buf; - if (pc_linenum) - { - sprintf (p, "#%-*d ", SIZE_LINE_NUMBER, pc_linenum); - p += strlen (p); - } - else - { - sprintf (p, "%-*s ", SIZE_LINE_NUMBER+1, "---"); - p += SIZE_LINE_NUMBER+2; - } - - if (pc_function) - { - sprintf (p, "%s ", pc_function); - p += strlen (p); - } - else if (pc_filename) - { - char *q = (char *) strrchr (pc_filename, '/'); - sprintf (p, "%s ", (q) ? q+1 : pc_filename); - p += strlen (p); - } - - if (*p == ' ') - *p = '\0'; - } - } - - trace_printf (sd, cpu, "%-*s 0x%.*x %-*.*s ", - SIZE_PHASE+1, phase, - SIZE_PC, (unsigned) pc, - SIZE_LOCATION, SIZE_LOCATION, buf); - va_start (ap, fmt); - trace_vprintf (sd, cpu, fmt, ap); - va_end (ap); - trace_printf (sd, cpu, "\n"); - } -} - void trace_printf (SIM_DESC sd, sim_cpu *cpu, const char *fmt, ...) { diff --git a/sim/common/sim-trace.h b/sim/common/sim-trace.h index 580cd4e..28fc351 100644 --- a/sim/common/sim-trace.h +++ b/sim/common/sim-trace.h @@ -618,19 +618,6 @@ do { \ } while (0) -/* The function trace_one_insn has been replaced by the function pair - trace_prefix() + trace_generic() */ -extern void trace_one_insn (SIM_DESC sd, - sim_cpu * cpu, - address_word cia, - int print_linenum_p, - const char *file_name, - int line_nr, - const char *unit, - const char *fmt, - ...) - __attribute__((format (printf, 8, 9))); - extern void trace_printf (SIM_DESC, sim_cpu *, const char *, ...) __attribute__((format (printf, 3, 4)));