aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-10-08 19:41:45 -0600
committerTom Tromey <tom@tromey.com>2020-10-08 19:41:45 -0600
commitb270168504d91292ec7089056ce32c68ad6c28a7 (patch)
tree636d9955d55eb696ce11f358a68764da88f884ab /gdb/cli
parentb3d3944ee56d22337e30333ad1aa3864e38efa21 (diff)
downloadgdb-b270168504d91292ec7089056ce32c68ad6c28a7.zip
gdb-b270168504d91292ec7089056ce32c68ad6c28a7.tar.gz
gdb-b270168504d91292ec7089056ce32c68ad6c28a7.tar.bz2
Style more output of "disassemble" command
I noticed a couple of spots where the "disassemble" could style its output, but currently does not. This patch adds styling to the function name at the start of the disassembly, and any addresses printed there. gdb/ChangeLog 2020-10-08 Tom Tromey <tom@tromey.com> * cli/cli-cmds.c (print_disassembly): Style function name and addresses. Add _() wrappers. gdb/testsuite/ChangeLog 2020-10-08 Tom Tromey <tom@tromey.com> * gdb.base/style.exp: Check that "main"'s name is styled.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index e3965fe..352abd0 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1395,14 +1395,18 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
else
#endif
{
- printf_filtered ("Dump of assembler code ");
+ printf_filtered (_("Dump of assembler code "));
if (name != NULL)
- printf_filtered ("for function %s:\n", name);
+ printf_filtered (_("for function %ps:\n"),
+ styled_string (function_name_style.style (), name));
if (block == nullptr || BLOCK_CONTIGUOUS_P (block))
{
if (name == NULL)
- printf_filtered ("from %s to %s:\n",
- paddress (gdbarch, low), paddress (gdbarch, high));
+ printf_filtered (_("from %ps to %ps:\n"),
+ styled_string (address_style.style (),
+ paddress (gdbarch, low)),
+ styled_string (address_style.style (),
+ paddress (gdbarch, high)));
/* Dump the specified range. */
gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high);
@@ -1413,14 +1417,16 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
{
CORE_ADDR range_low = BLOCK_RANGE_START (block, i);
CORE_ADDR range_high = BLOCK_RANGE_END (block, i);
- printf_filtered (_("Address range %s to %s:\n"),
- paddress (gdbarch, range_low),
- paddress (gdbarch, range_high));
+ printf_filtered (_("Address range %ps to %ps:\n"),
+ styled_string (address_style.style (),
+ paddress (gdbarch, range_low)),
+ styled_string (address_style.style (),
+ paddress (gdbarch, range_high)));
gdb_disassembly (gdbarch, current_uiout, flags, -1,
range_low, range_high);
}
}
- printf_filtered ("End of assembler dump.\n");
+ printf_filtered (_("End of assembler dump.\n"));
}
}