This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] dwarf2read.c: C++fy lnp_state_machine


*** TEST RESULTS FOR COMMIT 6f77053d2ae56f16c10a8817732ed9fb43893507 ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 6f77053d2ae56f16c10a8817732ed9fb43893507

dwarf2read.c: C++fy lnp_state_machine

While I was looking at the file, I noticed that this struct could be
nicely converted to a class.  As I was progressing, I ended up moving
all state machine actual internal state manipulation to methods of
lnp_state_machine, essentially decoupling DWARF parsing from state
tracking.  I also noticed that the lnp_reader_state doesn't really
serve any good use, so that's eliminated in the process.

gdb/ChangeLog:
2017-04-04  Pedro Alves  <palves@redhat.com>

	* dwarf2read.c (lnp_state_machine): Now a class.  Initialize all
	data fields, make them private and add "m_" prefixes.
	(lnp_state_machine::lnp_state_machine): New ctor.
	(record_line, check_line_address, handle_set_discriminator)
	(handle_set_address, handle_advance_pc, handle_special_opcode)
	(handle_advance_line, handle_set_file, handle_negate_stmt)
	(handle_const_add_pc, handle_fixed_advance_pc, handle_copy)
	(end_sequence, advance_line): New methods.
	(m_gdbarch, m_record_lines_p): New fields.
	(lnp_reader_state): Delete.
	(dwarf_record_line): Rename to ...
	(lnp_state_machine::record_line): ... adjust.
	(init_lnp_state_machine): Delete.
	(lnp_state_machine::lnp_state_machine): New.
	(check_line_address): Rename to ...
	(lnp_state_machine::check_line_address): This.
	(dwarf_decode_lines_1): Remove reference to "reader_state".
	Adjust lnp_state_machine having a non-default ctor.  Use bool.
	State machine internal state manipulation moved to
	lnp_state_machine methods.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]