diff options
author | Tom Tromey <tom@tromey.com> | 2022-01-02 11:46:15 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-03-29 12:46:24 -0600 |
commit | 6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a (patch) | |
tree | 641a6a86240919fe4ba9219fbbbe15bc6331c22d /gdb/btrace.c | |
parent | a11ac3b3e8ff6769badcf0041894f6c5acc1b94f (diff) | |
download | binutils-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.zip binutils-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.gz binutils-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.bz2 |
Unify gdb printf functions
Now that filtered and unfiltered output can be treated identically, we
can unify the printf family of functions. This is done under the name
"gdb_printf". Most of this patch was written by script.
Diffstat (limited to 'gdb/btrace.c')
-rw-r--r-- | gdb/btrace.c | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/gdb/btrace.c b/gdb/btrace.c index ea733fe..b195b59 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -62,8 +62,8 @@ static void btrace_add_pc (struct thread_info *tp); do \ { \ if (record_debug != 0) \ - fprintf_unfiltered (gdb_stdlog, \ - "[btrace] " msg "\n", ##args); \ + gdb_printf (gdb_stdlog, \ + "[btrace] " msg "\n", ##args); \ } \ while (0) @@ -2852,122 +2852,122 @@ pt_print_packet (const struct pt_packet *packet) switch (packet->type) { default: - printf_filtered (("[??: %x]"), packet->type); + gdb_printf (("[??: %x]"), packet->type); break; case ppt_psb: - printf_filtered (("psb")); + gdb_printf (("psb")); break; case ppt_psbend: - printf_filtered (("psbend")); + gdb_printf (("psbend")); break; case ppt_pad: - printf_filtered (("pad")); + gdb_printf (("pad")); break; case ppt_tip: - printf_filtered (("tip %u: 0x%" PRIx64 ""), - packet->payload.ip.ipc, - packet->payload.ip.ip); + gdb_printf (("tip %u: 0x%" PRIx64 ""), + packet->payload.ip.ipc, + packet->payload.ip.ip); break; case ppt_tip_pge: - printf_filtered (("tip.pge %u: 0x%" PRIx64 ""), - packet->payload.ip.ipc, - packet->payload.ip.ip); + gdb_printf (("tip.pge %u: 0x%" PRIx64 ""), + packet->payload.ip.ipc, + packet->payload.ip.ip); break; case ppt_tip_pgd: - printf_filtered (("tip.pgd %u: 0x%" PRIx64 ""), - packet->payload.ip.ipc, - packet->payload.ip.ip); + gdb_printf (("tip.pgd %u: 0x%" PRIx64 ""), + packet->payload.ip.ipc, + packet->payload.ip.ip); break; case ppt_fup: - printf_filtered (("fup %u: 0x%" PRIx64 ""), - packet->payload.ip.ipc, - packet->payload.ip.ip); + gdb_printf (("fup %u: 0x%" PRIx64 ""), + packet->payload.ip.ipc, + packet->payload.ip.ip); break; case ppt_tnt_8: - printf_filtered (("tnt-8 %u: 0x%" PRIx64 ""), - packet->payload.tnt.bit_size, - packet->payload.tnt.payload); + gdb_printf (("tnt-8 %u: 0x%" PRIx64 ""), + packet->payload.tnt.bit_size, + packet->payload.tnt.payload); break; case ppt_tnt_64: - printf_filtered (("tnt-64 %u: 0x%" PRIx64 ""), - packet->payload.tnt.bit_size, - packet->payload.tnt.payload); + gdb_printf (("tnt-64 %u: 0x%" PRIx64 ""), + packet->payload.tnt.bit_size, + packet->payload.tnt.payload); break; case ppt_pip: - printf_filtered (("pip %" PRIx64 "%s"), packet->payload.pip.cr3, - packet->payload.pip.nr ? (" nr") : ("")); + gdb_printf (("pip %" PRIx64 "%s"), packet->payload.pip.cr3, + packet->payload.pip.nr ? (" nr") : ("")); break; case ppt_tsc: - printf_filtered (("tsc %" PRIx64 ""), packet->payload.tsc.tsc); + gdb_printf (("tsc %" PRIx64 ""), packet->payload.tsc.tsc); break; case ppt_cbr: - printf_filtered (("cbr %u"), packet->payload.cbr.ratio); + gdb_printf (("cbr %u"), packet->payload.cbr.ratio); break; case ppt_mode: switch (packet->payload.mode.leaf) { default: - printf_filtered (("mode %u"), packet->payload.mode.leaf); + gdb_printf (("mode %u"), packet->payload.mode.leaf); break; case pt_mol_exec: - printf_filtered (("mode.exec%s%s"), - packet->payload.mode.bits.exec.csl - ? (" cs.l") : (""), - packet->payload.mode.bits.exec.csd - ? (" cs.d") : ("")); + gdb_printf (("mode.exec%s%s"), + packet->payload.mode.bits.exec.csl + ? (" cs.l") : (""), + packet->payload.mode.bits.exec.csd + ? (" cs.d") : ("")); break; case pt_mol_tsx: - printf_filtered (("mode.tsx%s%s"), - packet->payload.mode.bits.tsx.intx - ? (" intx") : (""), - packet->payload.mode.bits.tsx.abrt - ? (" abrt") : ("")); + gdb_printf (("mode.tsx%s%s"), + packet->payload.mode.bits.tsx.intx + ? (" intx") : (""), + packet->payload.mode.bits.tsx.abrt + ? (" abrt") : ("")); break; } break; case ppt_ovf: - printf_filtered (("ovf")); + gdb_printf (("ovf")); break; case ppt_stop: - printf_filtered (("stop")); + gdb_printf (("stop")); break; case ppt_vmcs: - printf_filtered (("vmcs %" PRIx64 ""), packet->payload.vmcs.base); + gdb_printf (("vmcs %" PRIx64 ""), packet->payload.vmcs.base); break; case ppt_tma: - printf_filtered (("tma %x %x"), packet->payload.tma.ctc, - packet->payload.tma.fc); + gdb_printf (("tma %x %x"), packet->payload.tma.ctc, + packet->payload.tma.fc); break; case ppt_mtc: - printf_filtered (("mtc %x"), packet->payload.mtc.ctc); + gdb_printf (("mtc %x"), packet->payload.mtc.ctc); break; case ppt_cyc: - printf_filtered (("cyc %" PRIx64 ""), packet->payload.cyc.value); + gdb_printf (("cyc %" PRIx64 ""), packet->payload.cyc.value); break; case ppt_mnt: - printf_filtered (("mnt %" PRIx64 ""), packet->payload.mnt.payload); + gdb_printf (("mnt %" PRIx64 ""), packet->payload.mnt.payload); break; } } @@ -3149,9 +3149,9 @@ btrace_maint_print_packets (struct btrace_thread_info *btinfo, { const btrace_block &block = blocks.at (blk); - printf_filtered ("%u\tbegin: %s, end: %s\n", blk, - core_addr_to_string_nz (block.begin), - core_addr_to_string_nz (block.end)); + gdb_printf ("%u\tbegin: %s, end: %s\n", blk, + core_addr_to_string_nz (block.begin), + core_addr_to_string_nz (block.end)); } btinfo->maint.variant.bts.packet_history.begin = begin; @@ -3170,15 +3170,15 @@ btrace_maint_print_packets (struct btrace_thread_info *btinfo, { const struct btrace_pt_packet &packet = packets.at (pkt); - printf_filtered ("%u\t", pkt); - printf_filtered ("0x%" PRIx64 "\t", packet.offset); + gdb_printf ("%u\t", pkt); + gdb_printf ("0x%" PRIx64 "\t", packet.offset); if (packet.errcode == pte_ok) pt_print_packet (&packet.packet); else - printf_filtered ("[error: %s]", pt_errstr (packet.errcode)); + gdb_printf ("[error: %s]", pt_errstr (packet.errcode)); - printf_filtered ("\n"); + gdb_printf ("\n"); } btinfo->maint.variant.pt.packet_history.begin = begin; @@ -3256,7 +3256,7 @@ maint_btrace_packet_history_cmd (const char *arg, int from_tty) btrace_maint_update_packets (btinfo, &begin, &end, &from, &to); if (begin == end) { - printf_filtered (_("No trace.\n")); + gdb_printf (_("No trace.\n")); return; } @@ -3398,8 +3398,8 @@ maint_info_btrace_cmd (const char *args, int from_tty) if (conf == NULL) error (_("No btrace configuration.")); - printf_filtered (_("Format: %s.\n"), - btrace_format_string (conf->format)); + gdb_printf (_("Format: %s.\n"), + btrace_format_string (conf->format)); switch (conf->format) { @@ -3407,8 +3407,8 @@ maint_info_btrace_cmd (const char *args, int from_tty) break; case BTRACE_FORMAT_BTS: - printf_filtered (_("Number of packets: %zu.\n"), - btinfo->data.variant.bts.blocks->size ()); + gdb_printf (_("Number of packets: %zu.\n"), + btinfo->data.variant.bts.blocks->size ()); break; #if defined (HAVE_LIBIPT) @@ -3417,14 +3417,14 @@ maint_info_btrace_cmd (const char *args, int from_tty) struct pt_version version; version = pt_library_version (); - printf_filtered (_("Version: %u.%u.%u%s.\n"), version.major, - version.minor, version.build, - version.ext != NULL ? version.ext : ""); + gdb_printf (_("Version: %u.%u.%u%s.\n"), version.major, + version.minor, version.build, + version.ext != NULL ? version.ext : ""); btrace_maint_update_pt_packets (btinfo); - printf_filtered (_("Number of packets: %zu.\n"), - ((btinfo->maint.variant.pt.packets == nullptr) - ? 0 : btinfo->maint.variant.pt.packets->size ())); + gdb_printf (_("Number of packets: %zu.\n"), + ((btinfo->maint.variant.pt.packets == nullptr) + ? 0 : btinfo->maint.variant.pt.packets->size ())); } break; #endif /* defined (HAVE_LIBIPT) */ @@ -3438,7 +3438,7 @@ show_maint_btrace_pt_skip_pad (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - fprintf_filtered (file, _("Skip PAD packets is %s.\n"), value); + gdb_printf (file, _("Skip PAD packets is %s.\n"), value); } |