This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] Add a set of accessors for section fields in dwarf2read.c
- From: Doug Evans <dje at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 4 Oct 2013 19:16:52 -0700
- Subject: Re: [commit] Add a set of accessors for section fields in dwarf2read.c
- Authentication-results: sourceware.org; auth=none
- References: <yjt2txh69dz4 dot fsf at ruffy dot mtv dot corp dot google dot com> <87ioxi9l5z dot fsf at fleche dot redhat dot com>
Tom Tromey writes:
> >>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> This patch is a bit of a cleanup, and also a prelude to adding
> Doug> DWP V2 support.
>
> Doug> 2013-09-27 Doug Evans <dje@google.com>
> Doug> * dwarf2read.c (die_reader_specs): Tweak comment.
> Doug> (get_section_bfd_owner, get_section_bfd_section): New functions.
> Doug> (get_section_name, get_section_file_name): New functions.
> Doug> (get_section_id, get_section_flags): New functions.
>
> I think a comment near dwarf2_section_info about the new requirement to
> use accessors is needed.
How about this?
2013-10-04 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf2_section_info): Add comment.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.841
diff -u -p -r1.841 dwarf2read.c
--- dwarf2read.c 5 Oct 2013 02:10:29 -0000 1.841
+++ dwarf2read.c 5 Oct 2013 02:11:27 -0000
@@ -114,7 +114,12 @@ static int dwarf2_loclist_block_index;
input section.
If this is a virtual dwp-v2 section, S.CONTAINING_SECTION is a backlink to
the real section this "virtual" section is contained in, and BUFFER,SIZE
- describe the virtual section. */
+ describe the virtual section.
+
+ N.B. Reading the bfd-maintained aspects of the section must go through the
+ various get_section_* accessors defined below. This includes S.ASECTION
+ unless IS_VIRTUAL is checked first. This does not include setting
+ S.ASECTION, for simplicity it is set directly. */
struct dwarf2_section_info
{