]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
gdb: make struct output_source_filename_data more C++ like
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 1 Apr 2021 13:51:24 +0000 (14:51 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 25 Jun 2021 19:54:28 +0000 (20:54 +0100)
commit4a0788e08cbf9e7b90640475b17afbbf5423ea9d
treecea651a3d1016f7362006833fc517eb7bc115f96
parentfc4d5ebf8f8fa30ae3f5c26270df0163ad72000c
gdb: make struct output_source_filename_data more C++ like

In a future commit I'm going to be making some changes to the 'info
sources' command.  While looking at the code I noticed that things
could be improved by making struct output_source_filename_data more
C++ like (private member variables, and more member functions).
That's what this commit does.

The 'info sources' filename filtering is split out into a separate
class in this commit.  In a future commit this new filter
class (info_sources_filter) will move into the header file and be used
from the MI code.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* symtab.c (struct info_sources_filter): New.
(info_sources_filter::info_sources_filter): New function.
(info_sources_filter::matches): New function.
(info_sources_filter::print): New function.
(struct filename_partial_match_opts): Moved to later in the file
and update the comment.
(struct output_source_filename_data)
<output_source_filename_data>: New constructor.  <regexp>: Delete,
this is now in info_sources_filter.  <c_regexp>: Delete, this is
now in info_sources_filter.  <reset_output>: New member function.
<filename_seen_cache>: Rename to m_filename_seen_cache, change
from being a pointer, to being an actual object.  <first>: Rename
to m_first.  <print_header>: New member function. <partial_match>:
Delete.
(output_source_filename_data::output): Update now
m_filename_seen_cache is no longer a pointer, and for other member
variable name changes. Add a header comment.
(print_info_sources_header): Renamed to...
(output_source_filename_data::print_header): ...this.  Update now
it's a member function and to take account of member variable
renaming.
(info_sources_command): Add a header comment, delete stack local
filename_seen_cache, initialization of output_source_filename_data
is now done by the constructor.  Call print_header member function
instead of print_info_sources_header, call reset_output member
function instead of manually performing the reset.
gdb/ChangeLog
gdb/symtab.c