aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-09-14 15:07:17 -0600
committerTom Tromey <tom@tromey.com>2024-09-30 13:23:35 -0600
commit887ae0cf2be5cb10d68b14f16df8faf666f4e43b (patch)
treef7c92c61df329414d9e57a31c9f034750992e7ec /gdb/tracepoint.c
parent7ecf0250f7f0868f3b828ffadd47d0e5f2dbd875 (diff)
downloadbinutils-887ae0cf2be5cb10d68b14f16df8faf666f4e43b.zip
binutils-887ae0cf2be5cb10d68b14f16df8faf666f4e43b.tar.gz
binutils-887ae0cf2be5cb10d68b14f16df8faf666f4e43b.tar.bz2
Add line-number styling
This patch adds separate styling for line numbers. That is, whenever gdb prints a source line number, it uses this style. v2 includes a change to ensure that %ps works in query. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index a5a2e69..8cf96fd 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2351,8 +2351,9 @@ tfind_line_command (const char *args, int from_tty)
{
if (start_pc == end_pc)
{
- gdb_printf ("Line %d of \"%s\"",
- sal.line,
+ gdb_printf ("Line %ps of \"%s\"",
+ styled_string (line_number_style.style (),
+ pulongest (sal.line)),
symtab_to_filename_for_display (sal.symtab));
gdb_stdout->wrap_here (2);
gdb_printf (" is at address ");
@@ -2363,8 +2364,9 @@ tfind_line_command (const char *args, int from_tty)
if (sal.line > 0
&& find_line_pc_range (sal, &start_pc, &end_pc)
&& start_pc != end_pc)
- gdb_printf ("Attempting to find line %d instead.\n",
- sal.line);
+ gdb_printf ("Attempting to find line %ps instead.\n",
+ styled_string (line_number_style.style (),
+ pulongest (sal.line)));
else
error (_("Cannot find a good line."));
}
@@ -3644,7 +3646,7 @@ print_one_static_tracepoint_marker (int count,
else
uiout->field_skip ("fullname");
- uiout->field_signed ("line", sal.line);
+ uiout->field_signed ("line", sal.line, line_number_style.style ());
}
else
{