diff options
author | Tom Tromey <tom@tromey.com> | 2025-09-06 13:19:42 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2025-09-08 18:53:55 -0600 |
commit | 4f0fa315f6b7b8da1099a82c625d938b0585db8c (patch) | |
tree | 6267cf77919b10ae85c2d95de90a01a7455b8d36 /gdb | |
parent | 715608fa8c229e98cc20c731e38c7fdf96cf6951 (diff) | |
download | binutils-4f0fa315f6b7b8da1099a82c625d938b0585db8c.zip binutils-4f0fa315f6b7b8da1099a82c625d938b0585db8c.tar.gz binutils-4f0fa315f6b7b8da1099a82c625d938b0585db8c.tar.bz2 |
Change dwarf_finish_line to be a method
This changes dwarf_finish_line to be a method of lnp_state_machine,
simplifying it a bit.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/dwarf2/line-program.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/gdb/dwarf2/line-program.c b/gdb/dwarf2/line-program.c index e70d7d3..9592f24 100644 --- a/gdb/dwarf2/line-program.c +++ b/gdb/dwarf2/line-program.c @@ -151,6 +151,7 @@ private: } bool record_line_p (); + void finish_line (); struct dwarf2_cu *m_cu; @@ -336,26 +337,24 @@ dwarf_record_line_1 (struct gdbarch *gdbarch, struct subfile *subfile, } /* Subroutine of dwarf_decode_lines_1 to simplify it. - Mark the end of a set of line number records. - The arguments are the same as for dwarf_record_line_1. - If SUBFILE is NULL the request is ignored. */ + Mark the end of a set of line number records. */ -static void -dwarf_finish_line (struct gdbarch *gdbarch, struct subfile *subfile, - unrelocated_addr address, struct dwarf2_cu *cu) +void +lnp_state_machine::finish_line () { - if (subfile == NULL) + if (m_last_subfile == nullptr) return; if (dwarf_line_debug) { gdb_printf (gdb_stdlog, "Finishing current line, file %s, address %s\n", - lbasename (subfile->name.c_str ()), - paddress (gdbarch, (CORE_ADDR) address)); + lbasename (m_last_subfile->name.c_str ()), + paddress (m_gdbarch, (CORE_ADDR) m_address)); } - dwarf_record_line_1 (gdbarch, subfile, 0, address, LEF_IS_STMT, cu); + dwarf_record_line_1 (m_gdbarch, m_last_subfile, 0, m_address, LEF_IS_STMT, + m_currently_recording_lines ? m_cu : nullptr); } void @@ -408,10 +407,7 @@ lnp_state_machine::record_line (bool end_sequence) || (!end_sequence && m_line == 0)); if ((file_changed && !ignore_this_line) || end_sequence) - { - dwarf_finish_line (m_gdbarch, m_last_subfile, m_address, - m_currently_recording_lines ? m_cu : nullptr); - } + finish_line (); if (!end_sequence && !ignore_this_line) { |