From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2113 invoked by alias); 10 Jan 2012 01:46:32 -0000 Received: (qmail 2105 invoked by uid 22791); 10 Jan 2012 01:46:31 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,TW_BJ,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ww0-f73.google.com (HELO mail-ww0-f73.google.com) (74.125.82.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jan 2012 01:46:19 +0000 Received: by wgbed3 with SMTP id ed3so79725wgb.0 for ; Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: by 10.213.35.76 with SMTP id o12mr760772ebd.6.1326159977844; Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: by 10.213.35.76 with SMTP id o12mr760764ebd.6.1326159977584; Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id m16si17315309eei.3.2012.01.09.17.46.17 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 60B1D2000D8; Mon, 9 Jan 2012 17:46:17 -0800 (PST) Received: by ruffy2.mtv.corp.google.com (Postfix, from userid 67641) id 957501E25C7; Mon, 9 Jan 2012 17:46:16 -0800 (PST) To: gdb-patches@sourceware.org, brobecker@adacore.com Subject: [patch] dwarf2read.c: Don't read pc/line-number mapping for type units Message-Id: <20120110014616.957501E25C7@ruffy2.mtv.corp.google.com> Date: Tue, 10 Jan 2012 01:46:00 -0000 From: dje@google.com (Doug Evans) X-IsSubscribed: yes 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 X-SW-Source: 2012-01/txt/msg00283.txt.bz2 Hi. fyi, I'm checking this in. Type units don't need the pc/line-number mapping, and this can save a lot of space. [There's still a fair bit of wasted space, but that's for another day. This brings the amount down to a tolerable level.] Joel: I'd also like to check this into the 7.4 branch. IMO it's safe enough. [btw, the cleanup handling of the line header here feels clumsy. It's accomplished as a side-effect of handle_DW_AT_stmt_list. It feels cleaner to let the caller decide how it wants to clean things up. That is also left for another day.] 2012-01-09 Doug Evans * dwarf2read.c (handle_DW_AT_stmt_list): Add function comment. New arg "want_line_info". All callers updated. (read_file_scope,read_type_unit_scope): Move comment from handle_DW_AT_stmt_list to here. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.605 diff -u -p -r1.605 dwarf2read.c --- dwarf2read.c 9 Jan 2012 17:40:05 -0000 1.605 +++ dwarf2read.c 10 Jan 2012 01:30:13 -0000 @@ -5521,19 +5521,19 @@ find_file_and_directory (struct die_info *name = ""; } -/* Handle DW_AT_stmt_list for a compilation unit. */ +/* Handle DW_AT_stmt_list for a compilation unit or type unit. + DIE is the DW_TAG_compile_unit or DW_TAG_type_unit die for CU. + COMP_DIR is the compilation directory. + WANT_LINE_INFO is non-zero if the pc/line-number mapping is needed. */ static void handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu, - const char *comp_dir) + const char *comp_dir, int want_line_info) { struct attribute *attr; struct objfile *objfile = cu->objfile; bfd *abfd = objfile->obfd; - /* Decode line number information if present. We do this before - processing child DIEs, so that the line header table is available - for DW_AT_decl_file. */ attr = dwarf2_attr (die, DW_AT_stmt_list, cu); if (attr) { @@ -5545,7 +5545,8 @@ handle_DW_AT_stmt_list (struct die_info { cu->line_header = line_header; make_cleanup (free_cu_line_header, cu); - dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL); + if (want_line_info) + dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL); } } } @@ -5604,7 +5605,10 @@ read_file_scope (struct die_info *die, s record_debugformat ("DWARF 2"); record_producer (cu->producer); - handle_DW_AT_stmt_list (die, cu, comp_dir); + /* Decode line number information if present. We do this before + processing child DIEs, so that the line header table is available + for DW_AT_decl_file. */ + handle_DW_AT_stmt_list (die, cu, comp_dir, 1); /* Process all dies in compilation unit. */ if (die->child != NULL) @@ -5707,7 +5711,11 @@ read_type_unit_scope (struct die_info *d record_debugformat ("DWARF 2"); record_producer (cu->producer); - handle_DW_AT_stmt_list (die, cu, comp_dir); + /* Decode line number information if present. We do this before + processing child DIEs, so that the line header table is available + for DW_AT_decl_file. + We don't need the pc/line-number mapping for type units. */ + handle_DW_AT_stmt_list (die, cu, comp_dir, 0); /* Process the dies in the type unit. */ if (die->child == NULL) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2545 invoked by alias); 10 Jan 2012 01:47:14 -0000 Received: (qmail 2534 invoked by uid 22791); 10 Jan 2012 01:47:12 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,TW_BJ,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-wi0-f201.google.com (HELO mail-wi0-f201.google.com) (209.85.212.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jan 2012 01:47:01 +0000 Received: by wibhq12 with SMTP id hq12so165104wib.0 for ; Mon, 09 Jan 2012 17:46:59 -0800 (PST) Received: by 10.213.35.76 with SMTP id o12mr760772ebd.6.1326159977844; Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: by 10.213.35.76 with SMTP id o12mr760764ebd.6.1326159977584; Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id m16si17315309eei.3.2012.01.09.17.46.17 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 09 Jan 2012 17:46:17 -0800 (PST) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 60B1D2000D8; Mon, 9 Jan 2012 17:46:17 -0800 (PST) Received: by ruffy2.mtv.corp.google.com (Postfix, from userid 67641) id 957501E25C7; Mon, 9 Jan 2012 17:46:16 -0800 (PST) To: gdb-patches@sourceware.org, brobecker@adacore.com Subject: [patch] dwarf2read.c: Don't read pc/line-number mapping for type units Message-ID: <20120110014616.957501E25C7@ruffy2.mtv.corp.google.com> Date: Tue, 10 Jan 2012 03:51:00 -0000 From: dje@google.com (Doug Evans) X-IsSubscribed: yes 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 X-SW-Source: 2012-01/txt/msg00284.txt.bz2 Message-ID: <20120110035100.4H84Eecn1NtNLV2U_jPhkxIIqqoY1oiTfscOASeMdlE@z> Hi. fyi, I'm checking this in. Type units don't need the pc/line-number mapping, and this can save a lot of space. [There's still a fair bit of wasted space, but that's for another day. This brings the amount down to a tolerable level.] Joel: I'd also like to check this into the 7.4 branch. IMO it's safe enough. [btw, the cleanup handling of the line header here feels clumsy. It's accomplished as a side-effect of handle_DW_AT_stmt_list. It feels cleaner to let the caller decide how it wants to clean things up. That is also left for another day.] 2012-01-09 Doug Evans * dwarf2read.c (handle_DW_AT_stmt_list): Add function comment. New arg "want_line_info". All callers updated. (read_file_scope,read_type_unit_scope): Move comment from handle_DW_AT_stmt_list to here. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.605 diff -u -p -r1.605 dwarf2read.c --- dwarf2read.c 9 Jan 2012 17:40:05 -0000 1.605 +++ dwarf2read.c 10 Jan 2012 01:30:13 -0000 @@ -5521,19 +5521,19 @@ find_file_and_directory (struct die_info *name = ""; } -/* Handle DW_AT_stmt_list for a compilation unit. */ +/* Handle DW_AT_stmt_list for a compilation unit or type unit. + DIE is the DW_TAG_compile_unit or DW_TAG_type_unit die for CU. + COMP_DIR is the compilation directory. + WANT_LINE_INFO is non-zero if the pc/line-number mapping is needed. */ static void handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu, - const char *comp_dir) + const char *comp_dir, int want_line_info) { struct attribute *attr; struct objfile *objfile = cu->objfile; bfd *abfd = objfile->obfd; - /* Decode line number information if present. We do this before - processing child DIEs, so that the line header table is available - for DW_AT_decl_file. */ attr = dwarf2_attr (die, DW_AT_stmt_list, cu); if (attr) { @@ -5545,7 +5545,8 @@ handle_DW_AT_stmt_list (struct die_info { cu->line_header = line_header; make_cleanup (free_cu_line_header, cu); - dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL); + if (want_line_info) + dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL); } } } @@ -5604,7 +5605,10 @@ read_file_scope (struct die_info *die, s record_debugformat ("DWARF 2"); record_producer (cu->producer); - handle_DW_AT_stmt_list (die, cu, comp_dir); + /* Decode line number information if present. We do this before + processing child DIEs, so that the line header table is available + for DW_AT_decl_file. */ + handle_DW_AT_stmt_list (die, cu, comp_dir, 1); /* Process all dies in compilation unit. */ if (die->child != NULL) @@ -5707,7 +5711,11 @@ read_type_unit_scope (struct die_info *d record_debugformat ("DWARF 2"); record_producer (cu->producer); - handle_DW_AT_stmt_list (die, cu, comp_dir); + /* Decode line number information if present. We do this before + processing child DIEs, so that the line header table is available + for DW_AT_decl_file. + We don't need the pc/line-number mapping for type units. */ + handle_DW_AT_stmt_list (die, cu, comp_dir, 0); /* Process the dies in the type unit. */ if (die->child == NULL)