diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-04-01 14:51:24 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-06-25 20:54:28 +0100 |
commit | 4a0788e08cbf9e7b90640475b17afbbf5423ea9d (patch) | |
tree | cea651a3d1016f7362006833fc517eb7bc115f96 /gdb/ChangeLog | |
parent | fc4d5ebf8f8fa30ae3f5c26270df0163ad72000c (diff) | |
download | fsf-binutils-gdb-4a0788e08cbf9e7b90640475b17afbbf5423ea9d.zip fsf-binutils-gdb-4a0788e08cbf9e7b90640475b17afbbf5423ea9d.tar.gz fsf-binutils-gdb-4a0788e08cbf9e7b90640475b17afbbf5423ea9d.tar.bz2 |
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.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 310c506..f4805f8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,34 @@ 2021-06-25 Andrew Burgess <andrew.burgess@embecosm.com> + * 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. + +2021-06-25 Andrew Burgess <andrew.burgess@embecosm.com> + * dwarf2/read.c (struct dwarf2_base_index_functions) <has_unexpanded_symtabs>: Declare. (dwarf2_base_index_functions::has_unexpanded_symtabs): Define new |