From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 372 invoked by alias); 24 Aug 2014 13:52:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 362 invoked by uid 89); 24 Aug 2014 13:52:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Aug 2014 13:52:17 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1XLYDN-0002ec-Nn from Yao_Qi@mentor.com ; Sun, 24 Aug 2014 06:52:13 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 24 Aug 2014 06:52:13 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Sun, 24 Aug 2014 06:52:12 -0700 From: Yao Qi To: Pedro Alves CC: Subject: Re: [PATCH] Update comments in scan_partial_symbols and add_partial_subprogram References: <1408708971-15299-1-git-send-email-yao@codesourcery.com> <53F77297.80704@redhat.com> Date: Sun, 24 Aug 2014 13:52:00 -0000 In-Reply-To: <53F77297.80704@redhat.com> (Pedro Alves's message of "Fri, 22 Aug 2014 17:40:55 +0100") Message-ID: <87lhqegfrt.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00514.txt.bz2 Pedro Alves writes: >> - that this subprogram contains. >> + that this subprogram contains. If SET_ADDRMAP is true, record the >> + covered ranges in the addrmap. *LOWPC and *HIGHPC to the lowest and >> + highest PC values found in PDI. > > The last sentence is missing the verb? Ur, "are" is missing, I think. It should be "... are found in PDI.". Fixed in the updated patch. > >> - DIE my also be a lexical block, in which case we simply search >> + PDI may also be a lexical block, in which case we simply search >> recursively for suprograms defined inside that lexical block. > > As long as we're fixing typos, there's another here "suprograms". Fixed. > > Otherwise looks fine to me. Patch below is pushed in. --=20 Yao (=E9=BD=90=E5=B0=A7) commit cdc07690a4812fb41d3766d087cf7ec78184d6a8 Author: Yao Qi Date: Fri Aug 15 19:06:02 2014 +0800 Update comments in scan_partial_symbols and add_partial_subprogram =20=20=20=20 I read comment of scan_partial_symbols about NEED_PC and how *LOWPC and *HIGHPC are updated: =20=20=20=20 DW_AT_ranges). If NEED_PC is set, then this function will set *LOWPC and *HIGHPC to the lowest and highest PC values found in CU and record the covered ranges in the addrmap. =20=20=20=20 NEED_PC is only used in the callee of scan_partial_symbols, add_partial_subprogram, =20=20=20=20 if (pdi->tag =3D=3D DW_TAG_subprogram) { if (pdi->has_pc_info) { if (pdi->lowpc < *lowpc) *lowpc =3D pdi->lowpc; if (pdi->highpc > *highpc) *highpc =3D pdi->highpc; if (need_pc) =20=20=20=20 *LOWPC and *HIGHPC is updated regardless of NEED_PC. When NEED_PC is true, addrmap is updated. It would be clear to rename NEED_PC to SET_ADDRMAP. That is what this patch does. Beside this, this patch also adjust comments in related functions. =20=20=20=20 gdb: =20=20=20=20 2014-08-24 Yao Qi =20=20=20=20 * dwarf2read.c (scan_partial_symbols): Update comments. Rename argument 'need_pc' with 'set_addrmap'. =EF=BC=88add_partial_namespace): Rename argument 'need_pc' with 'set_addrmap'. (add_partial_module): Likewise. (add_partial_subprogram): Likewise. Update comments. (dwarf2_name): Fix typo. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0978d63..1660577 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2014-08-24 Yao Qi + + * dwarf2read.c (scan_partial_symbols): Update comments. + Rename argument 'need_pc' with 'set_addrmap'. + =EF=BC=88add_partial_namespace): Rename argument 'need_pc' with + 'set_addrmap'. + (add_partial_module): Likewise. + (add_partial_subprogram): Likewise. Update comments. + (dwarf2_name): Fix typo. + 2014-08-22 Doug Evans =20 PR 17276 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 458977e..df6deef 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1387,10 +1387,10 @@ static void add_partial_symbol (struct partial_die_= info *, =20 static void add_partial_namespace (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, - int need_pc, struct dwarf2_cu *cu); + int set_addrmap, struct dwarf2_cu *cu); =20 static void add_partial_module (struct partial_die_info *pdi, CORE_ADDR *l= owpc, - CORE_ADDR *highpc, int need_pc, + CORE_ADDR *highpc, int set_addrmap, struct dwarf2_cu *cu); =20 static void add_partial_enumeration (struct partial_die_info *enum_pdi, @@ -6542,15 +6542,15 @@ create_all_comp_units (struct objfile *objfile) } =20 /* Process all loaded DIEs for compilation unit CU, starting at - FIRST_DIE. The caller should pass NEED_PC =3D=3D 1 if the compilation + FIRST_DIE. The caller should pass SET_ADDRMAP =3D=3D 1 if the compilat= ion unit DIE did not have PC info (DW_AT_low_pc and DW_AT_high_pc, or - DW_AT_ranges). If NEED_PC is set, then this function will set - *LOWPC and *HIGHPC to the lowest and highest PC values found in CU - and record the covered ranges in the addrmap. */ + DW_AT_ranges). See the comments of add_partial_subprogram on how + SET_ADDRMAP is used and how *LOWPC and *HIGHPC are updated. */ =20 static void scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc, - CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu) + CORE_ADDR *highpc, int set_addrmap, + struct dwarf2_cu *cu) { struct partial_die_info *pdi; =20 @@ -6575,7 +6575,7 @@ scan_partial_symbols (struct partial_die_info *first_= die, CORE_ADDR *lowpc, switch (pdi->tag) { case DW_TAG_subprogram: - add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu); + add_partial_subprogram (pdi, lowpc, highpc, set_addrmap, cu); break; case DW_TAG_constant: case DW_TAG_variable: @@ -6605,10 +6605,10 @@ scan_partial_symbols (struct partial_die_info *firs= t_die, CORE_ADDR *lowpc, add_partial_symbol (pdi, cu); break; case DW_TAG_namespace: - add_partial_namespace (pdi, lowpc, highpc, need_pc, cu); + add_partial_namespace (pdi, lowpc, highpc, set_addrmap, cu); break; case DW_TAG_module: - add_partial_module (pdi, lowpc, highpc, need_pc, cu); + add_partial_module (pdi, lowpc, highpc, set_addrmap, cu); break; case DW_TAG_imported_unit: { @@ -6975,7 +6975,7 @@ add_partial_symbol (struct partial_die_info *pdi, str= uct dwarf2_cu *cu) static void add_partial_namespace (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, - int need_pc, struct dwarf2_cu *cu) + int set_addrmap, struct dwarf2_cu *cu) { /* Add a symbol for the namespace. */ =20 @@ -6984,14 +6984,14 @@ add_partial_namespace (struct partial_die_info *pdi, /* Now scan partial symbols in that namespace. */ =20 if (pdi->has_children) - scan_partial_symbols (pdi->die_child, lowpc, highpc, need_pc, cu); + scan_partial_symbols (pdi->die_child, lowpc, highpc, set_addrmap, cu); } =20 /* Read a partial die corresponding to a Fortran module. */ =20 static void add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc, - CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu) + CORE_ADDR *highpc, int set_addrmap, struct dwarf2_cu *cu) { /* Add a symbol for the namespace. */ =20 @@ -7000,23 +7000,25 @@ add_partial_module (struct partial_die_info *pdi, C= ORE_ADDR *lowpc, /* Now scan partial symbols in that module. */ =20 if (pdi->has_children) - scan_partial_symbols (pdi->die_child, lowpc, highpc, need_pc, cu); + scan_partial_symbols (pdi->die_child, lowpc, highpc, set_addrmap, cu); } =20 /* Read a partial die corresponding to a subprogram and create a partial symbol for that subprogram. When the CU language allows it, this routine also defines a partial symbol for each nested subprogram - that this subprogram contains. + that this subprogram contains. If SET_ADDRMAP is true, record the + covered ranges in the addrmap. *LOWPC and *HIGHPC to the lowest and + highest PC values are found in PDI. =20 - DIE my also be a lexical block, in which case we simply search - recursively for suprograms defined inside that lexical block. + PDI may also be a lexical block, in which case we simply search + recursively for subprograms defined inside that lexical block. Again, this is only performed when the CU language allows this type of definitions. */ =20 static void add_partial_subprogram (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, - int need_pc, struct dwarf2_cu *cu) + int set_addrmap, struct dwarf2_cu *cu) { if (pdi->tag =3D=3D DW_TAG_subprogram) { @@ -7026,7 +7028,7 @@ add_partial_subprogram (struct partial_die_info *pdi, *lowpc =3D pdi->lowpc; if (pdi->highpc > *highpc) *highpc =3D pdi->highpc; - if (need_pc) + if (set_addrmap) { CORE_ADDR baseaddr; struct objfile *objfile =3D cu->objfile; @@ -7062,7 +7064,7 @@ add_partial_subprogram (struct partial_die_info *pdi, fixup_partial_die (pdi, cu); if (pdi->tag =3D=3D DW_TAG_subprogram || pdi->tag =3D=3D DW_TAG_lexical_block) - add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu); + add_partial_subprogram (pdi, lowpc, highpc, set_addrmap, cu); pdi =3D pdi->die_sibling; } } @@ -19025,7 +19027,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu= *cu) /* GCJ will output '' for Java constructor names. For this special case, return the name of the parent class. */ =20 - /* GCJ may output suprogram DIEs with AT_specification set. + /* GCJ may output subprogram DIEs with AT_specification set. If so, use the name of the specified DIE. */ spec_die =3D die_specification (die, &spec_cu); if (spec_die !=3D NULL)