aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
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/python
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/python')
-rw-r--r--gdb/python/py-framefilter.c2
-rw-r--r--gdb/python/py-mi.c3
-rw-r--r--gdb/python/py-uiout.h3
3 files changed, 5 insertions, 3 deletions
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 9f9032f..daec6dd 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -1007,7 +1007,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags,
out->text (":");
annotate_frame_source_line ();
- out->field_signed ("line", line);
+ out->field_signed ("line", line, line_number_style.style ());
}
}
if (out->is_mi_like_p ())
diff --git a/gdb/python/py-mi.c b/gdb/python/py-mi.c
index 632de10..f0e28d9 100644
--- a/gdb/python/py-mi.c
+++ b/gdb/python/py-mi.c
@@ -86,7 +86,8 @@ py_ui_out::do_end (ui_out_type type)
void
py_ui_out::do_field_signed (int fldno, int width, ui_align align,
- const char *fldname, LONGEST value)
+ const char *fldname, LONGEST value,
+ const ui_file_style &style)
{
if (m_error.has_value ())
return;
diff --git a/gdb/python/py-uiout.h b/gdb/python/py-uiout.h
index a2fc90e..5f8c530 100644
--- a/gdb/python/py-uiout.h
+++ b/gdb/python/py-uiout.h
@@ -86,7 +86,8 @@ protected:
void do_end (ui_out_type type) override;
void do_field_signed (int fldno, int width, ui_align align,
- const char *fldname, LONGEST value) override;
+ const char *fldname, LONGEST value,
+ const ui_file_style &style) override;
void do_field_unsigned (int fldno, int width, ui_align align,
const char *fldname, ULONGEST value) override;