From patchwork Thu Mar 27 19:05:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 318 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (caibbdcaaahc.dreamhost.com [208.113.200.72]) by wilcox.dreamhost.com (Postfix) with ESMTP id C94C83600BB for ; Thu, 27 Mar 2014 12:05:23 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 7A14E40A3735F; Thu, 27 Mar 2014 12:05:23 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 568F440A5162F for ; Thu, 27 Mar 2014 12:05:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=WwNw360EQjC1yYGa3BItShR0yy/6F cCdBtvk0F2pG2y07xkF1cA4ccnaCbes6Mt4f+O3jCzOYraVTBaXF84U3FZYPMzmJ gM/lHrJb3Y2MnuxB1U6MQ6Cgty9Yvro5krXkfkVO90bsZmf/XDYc828RifaRd0eg fnCNxONgOAHPQg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=4pctyJoFES6p5HlC3LwNmWBZXSw=; b=M8O Rtms9suGC6nTdwNtU4QV/wrYsWVNpWdNtRvWhgTBAD4JYdaHd/x6S1m6TqXVMk2f VlpZoOJEeZ9Nd9U1yTOOv/O6IqFHx1elupq2vaxKerWxfbNwCiB52mFC38hBEvqV pxNiCd4M/CXgzRSSq/v4QvqR4bQau1stFtCATl9s= Received: (qmail 4841 invoked by alias); 27 Mar 2014 19:05:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4827 invoked by uid 89); 27 Mar 2014 19:05:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f201.google.com Received: from mail-qc0-f201.google.com (HELO mail-qc0-f201.google.com) (209.85.216.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 27 Mar 2014 19:05:19 +0000 Received: by mail-qc0-f201.google.com with SMTP id c9so539300qcz.0 for ; Thu, 27 Mar 2014 12:05:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=pw7h5EA+75XjBHvzcJaS5WcvrR/L7A/+b6yy3ERwekQ=; b=HPR+ONTB/u2/OkD3OMMsI4IRouPCipPUsp6KleNbuQviStYT7sRIfvUoytOSSo1EM4 QaBub/TGrxRFrTapaHPuCjIzvLQ9Dpnc0CKQQujFQ88GBv0dDZRRmjl2yCySfdvbMNTD D95yud2XL+SE61ymxn0icvll6K+oQJgwwrupz0teN4Ibk184Vn4kmYwT+R8QL/R7b1Yp C+yNSV748p9+/jovOzvF8uyls1IjtZWO3yYKZkgH9CVWbhsIZ1uZNqnim8ffHq5JwvCC nlKWFKwrBUu+koF2AjSE7Jw67APKUv8jMoOa9i37m+x/BupfT2OYtXsM9hZxKI/R0x4O uJow== X-Gm-Message-State: ALoCoQnF5qmbBG9ZICpAVvZvUhlmCWQ5kUgXVVfT3GD9+tInB6cgN3NYDSWUUHcRHOPU+w3fk5YGCKG1HB5FULVtnGyMmRmmknqM6nixMlDs8ILwlre4r9KtixCJcjJoP+fENfWi+empH5kDT9FhVjj/6Yf/Na2ZpmGqNyR2wtSiGVv+Fw+9p6d7a503hzZFtJPpJaPN1+6panVZdzDk4FUOX1vRSosIvRrlrJLX8ssld3LL0tQHNY0= X-Received: by 10.58.228.201 with SMTP id sk9mr122481vec.35.1395947117534; Thu, 27 Mar 2014 12:05:17 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id i30si548008yhc.0.2014.03.27.12.05.17 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Mar 2014 12:05:17 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 2CFD831C1AE for ; Thu, 27 Mar 2014 12:05:17 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [commit] dwarf2read.c (init_cutu_and_read_dies_no_follow): Minor cleanups Date: Thu, 27 Mar 2014 12:05:16 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi. fyi, I committed this. Regression tested on amd64-linux. 2014-03-27 Doug Evans * dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments. Remove argument abbrev_section. All callers updated. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index cf95583..5238f4b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -5515,10 +5515,9 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, do_cleanups (cleanups); } -/* Read CU/TU THIS_CU in section SECTION, - but do not follow DW_AT_GNU_dwo_name if present. - DWOP_FILE, if non-NULL, is the DWO/DWP file to read (the caller is assumed - to have already done the lookup to find the DWO/DWP file). +/* Read CU/TU THIS_CU but do not follow DW_AT_GNU_dwo_name if present. + DWO_FILE, if non-NULL, is the DWO file to read (the caller is assumed + to have already done the lookup to find the DWO file). The caller is required to fill in THIS_CU->section, THIS_CU->offset, and THIS_CU->is_debug_types, but nothing else. @@ -5534,7 +5533,6 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, static void init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, - struct dwarf2_section_info *abbrev_section, struct dwo_file *dwo_file, die_reader_func_ftype *die_reader_func, void *data) @@ -5542,6 +5540,7 @@ init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile = dwarf2_per_objfile->objfile; struct dwarf2_section_info *section = this_cu->section; bfd *abfd = get_section_bfd_owner (section); + struct dwarf2_section_info *abbrev_section; struct dwarf2_cu cu; const gdb_byte *begin_info_ptr, *info_ptr; struct die_reader_specs reader; @@ -5556,6 +5555,10 @@ init_cutu_and_read_dies_no_follow (struct dwarf2_per_cu_data *this_cu, gdb_assert (this_cu->cu == NULL); + abbrev_section = (dwo_file != NULL + ? &dwo_file->sections.abbrev + : get_abbrev_section_for_cu (this_cu)); + /* This is cheap if the section is already read in. */ dwarf2_read_section (objfile, section); @@ -5603,10 +5606,7 @@ init_cutu_and_read_dies_simple (struct dwarf2_per_cu_data *this_cu, die_reader_func_ftype *die_reader_func, void *data) { - init_cutu_and_read_dies_no_follow (this_cu, - get_abbrev_section_for_cu (this_cu), - NULL, - die_reader_func, data); + init_cutu_and_read_dies_no_follow (this_cu, NULL, die_reader_func, data); } /* Type Unit Groups. @@ -9326,9 +9326,7 @@ create_dwo_cu (struct dwo_file *dwo_file) per_cu.offset.sect_off = info_ptr - section->buffer; per_cu.section = section; - init_cutu_and_read_dies_no_follow (&per_cu, - &dwo_file->sections.abbrev, - dwo_file, + init_cutu_and_read_dies_no_follow (&per_cu, dwo_file, create_dwo_cu_reader, &create_dwo_cu_data);