[RFC,6/8] Style print_address_symbolic
Commit Message
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/printcmd.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
@@ -49,6 +49,7 @@
#include "format.h"
#include "source.h"
#include "common/byte-vector.h"
+#include "cli/cli-style.h"
/* Last specified output format. */
@@ -534,7 +535,9 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
fputs_filtered ("<*", stream);
else
fputs_filtered ("<", stream);
+ set_output_style (stream, function_name_style.style ());
fputs_filtered (name.c_str (), stream);
+ set_output_style (stream, ui_file_style ());
if (offset != 0)
fprintf_filtered (stream, "+%u", (unsigned int) offset);
@@ -542,10 +545,12 @@ 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);
+ set_output_style (stream, file_name_style.style ());
+ fputs_filtered (filename.c_str (), stream);
+ set_output_style (stream, ui_file_style ());
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);