aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-09-05 23:39:34 -0600
committerTom Tromey <tom@tromey.com>2018-12-28 12:49:51 -0700
commitaf79b68d7f935799c956b1a40e92a167385b5380 (patch)
treeaf1ade9d467b88a8017cbdef77898c77f1422d6d
parent0bb296cb5f3a81b4b5e702208aad911d3b727f8b (diff)
downloadbinutils-af79b68d7f935799c956b1a40e92a167385b5380.zip
binutils-af79b68d7f935799c956b1a40e92a167385b5380.tar.gz
binutils-af79b68d7f935799c956b1a40e92a167385b5380.tar.bz2
Style print_address_symbolic
print_address_symbolic does not use ui-out, so it did not style function names. This patch changes it to use the low-level style code directly. gdb/ChangeLog 2018-12-28 Tom Tromey <tom@tromey.com> * printcmd.c (print_address_symbolic): Style function name. gdb/testsuite/ChangeLog 2018-12-28 Tom Tromey <tom@tromey.com> * gdb.base/style.exp: Add test for print_address_symbolic.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/printcmd.c9
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/style.exp2
4 files changed, 15 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f9a8f09..aa98a94 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2018-12-28 Tom Tromey <tom@tromey.com>
+ * printcmd.c (print_address_symbolic): Style function name.
+
+2018-12-28 Tom Tromey <tom@tromey.com>
+
* breakpoint.c (say_where): Style file name.
2018-12-28 Tom Tromey <tom@tromey.com>
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index dd16264..c5b6b1a 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -50,6 +50,7 @@
#include "format.h"
#include "source.h"
#include "common/byte-vector.h"
+#include "cli/cli-style.h"
/* Last specified output format. */
@@ -535,7 +536,7 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
fputs_filtered ("<*", stream);
else
fputs_filtered ("<", stream);
- fputs_filtered (name.c_str (), stream);
+ fputs_styled (name.c_str (), function_name_style.style (), stream);
if (offset != 0)
fprintf_filtered (stream, "+%u", (unsigned int) offset);
@@ -543,10 +544,10 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
line # of this addr, if we have it; else line # of the nearest symbol. */
if (print_symbol_filename && !filename.empty ())
{
+ fputs_filtered (line == -1 ? " in " : " at ", stream);
+ fputs_styled (filename.c_str (), file_name_style.style (), stream);
if (line != -1)
- fprintf_filtered (stream, " at %s:%d", filename.c_str (), line);
- else
- fprintf_filtered (stream, " in %s", filename.c_str ());
+ fprintf_filtered (stream, ":%d", line);
}
if (unmapped)
fputs_filtered ("*>", stream);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index de21939..78c8da4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2018-12-28 Tom Tromey <tom@tromey.com>
+ * gdb.base/style.exp: Add test for print_address_symbolic.
+
+2018-12-28 Tom Tromey <tom@tromey.com>
+
* gdb.base/style.exp: Add test for breakpoint setting.
2018-12-28 Tom Tromey <tom@tromey.com>
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index f5d3fc2..2978d82 100644
--- a/gdb/testsuite/gdb.base/style.exp
+++ b/gdb/testsuite/gdb.base/style.exp
@@ -42,4 +42,6 @@ save_vars { env(TERM) } {
gdb_test "info breakpoints" "$main_expr at $file_expr.*"
gdb_test "break main" "file $base_file_expr.*"
+
+ gdb_test "print &main" " = .* <$main_expr>"
}