From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24621 invoked by alias); 10 Jul 2012 08:09:30 -0000 Received: (qmail 24601 invoked by uid 22791); 10 Jul 2012 08:09:28 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SARE_SUB_IMPROVE,TW_BJ,T_FILL_THIS_FORM_SHORT,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-yw0-f73.google.com (HELO mail-yw0-f73.google.com) (209.85.213.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 08:09:14 +0000 Received: by yhpp61 with SMTP id p61so1461729yhp.0 for ; Tue, 10 Jul 2012 01:09:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=HDZe8jMOwr6dElONir5npXpaTmbnbOdXLzJ0UBrmJDg=; b=PNY9q8MgcThgiuxzHtnhR7Jv5pUrsHYP+vujrbcFeGKftuP6ye0GtpnaXwykaHhd4D 4tN0Ub2w5p+WlQbPKZmWCQn0yC8/9STmWvPAzgIWCLthZGXcqW8Bw1QmjN8OSCaY1QGC UMyy6UXl1czWggqfrRpcgues52x7m56wjIifS6Y1M+WzoBDZrwwnyQo68oLeUn1Zc+4J TQuMGmZpywy2QTSipcjnupw6SaFznd+NsOL4lBqk2UX2pJ+mOiK7YzHcFAiaY95+EABU LY5AtcfbpcSyv94y9vcmVhG/PO4ysr6qpQPH3V7WWj+R/Ww/hXKhLNiIH5rGGpvlCvdN IM7A== Received: by 10.236.83.111 with SMTP id p75mr68774473yhe.5.1341907754003; Tue, 10 Jul 2012 01:09:14 -0700 (PDT) Received: by 10.236.83.111 with SMTP id p75mr68774464yhe.5.1341907753950; Tue, 10 Jul 2012 01:09:13 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id k67si8829264yhm.2.2012.07.10.01.09.13 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 10 Jul 2012 01:09:13 -0700 (PDT) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id D46FC100047 for ; Tue, 10 Jul 2012 01:09:13 -0700 (PDT) Received: by ruffy2.mtv.corp.google.com (Postfix, from userid 67641) id 82E3B1E1253; Tue, 10 Jul 2012 01:09:13 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [RFA 2/4] Improve DWARF Type Unit performance Message-Id: <20120710080913.82E3B1E1253@ruffy2.mtv.corp.google.com> Date: Tue, 10 Jul 2012 08:09:00 -0000 From: dje@google.com (Doug Evans) X-Gm-Message-State: ALoCoQlcIE6KOiF4qEB2dJGTN2+3Tnq8WIixJMkYNO0hiY/GFIDrvOoKuDk26m4hSf45RpMBGvsLVMMMSEV4m/4U6xq14BXpqGtIowJVTFYMrl67rQCOuUKlHTUQL12IRKqNA29vhV8r6dmiNx7/tJ2YoBv2j3HgdYtkGp5eVwQlvtyFTflEMeSVwAzGyKJ9YbOFvSVZuiQuy/au7r+nTRU8MEGQWGpVwA== 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-07/txt/msg00125.txt.bz2 This patch in the series adds the notion of anonymous partial symtabs. TU partial symtabs currently don't have a name, and this patch series doesn't change that. They could if we looked at DW_AT_decl_file, but I haven't found a compelling need for it (you can't, for example, set a breakpoint on a type unit). 2012-07-09 Doug Evans * psympriv.h (struct partial_symtab): New member "anonymous". * psymtab.c (partial_map_symtabs_matching_filename): Ignore anonymous psymtabs. (map_symbol_filenames_psymtab): Ditto. (expand_symtabs_matching_via_partial): Ditto. (dump_psymtab): Update. Index: psympriv.h =================================================================== RCS file: /cvs/src/src/gdb/psympriv.h,v retrieving revision 1.13 diff -u -p -r1.13 psympriv.h --- psympriv.h 10 May 2012 19:54:45 -0000 1.13 +++ psympriv.h 10 Jul 2012 01:15:46 -0000 @@ -182,6 +182,10 @@ struct partial_symtab unsigned char psymtabs_addrmap_supported; + /* True if the name of this partial symtab is not a source file name. */ + + unsigned char anonymous; + /* A flag that is temporarily used when searching psymtabs. */ ENUM_BITFIELD (psymtab_search_status) searched_flag : 2; Index: psymtab.c =================================================================== RCS file: /cvs/src/src/gdb/psymtab.c,v retrieving revision 1.48 diff -u -p -r1.48 psymtab.c --- psymtab.c 26 Jun 2012 20:14:02 -0000 1.48 +++ psymtab.c 10 Jul 2012 01:15:46 -0000 @@ -174,6 +174,10 @@ partial_map_symtabs_matching_filename (s if (pst->user != NULL) continue; + /* Anonymous psymtabs don't have a file name. */ + if (pst->anonymous) + continue; + if (FILENAME_CMP (name, pst->filename) == 0 || (!is_abs && compare_filenames_for_search (pst->filename, name, name_len))) @@ -973,8 +977,13 @@ dump_psymtab (struct objfile *objfile, s struct gdbarch *gdbarch = get_objfile_arch (objfile); int i; - fprintf_filtered (outfile, "\nPartial symtab for source file %s ", - psymtab->filename); + if (psymtab->anonymous) + fprintf_filtered (outfile, "\nAnonymous partial symtab "); + else + { + fprintf_filtered (outfile, "\nPartial symtab for source file %s ", + psymtab->filename); + } fprintf_filtered (outfile, "(object "); gdb_print_host_address (psymtab, outfile); fprintf_filtered (outfile, ")\n\n"); @@ -1143,6 +1152,10 @@ map_symbol_filenames_psymtab (struct obj if (ps->readin) continue; + /* Anonymous psymtabs don't have a file name. */ + if (ps->anonymous) + continue; + QUIT; if (need_fullname) fullname = psymtab_to_fullname (ps); @@ -1377,8 +1390,13 @@ expand_symtabs_matching_via_partial if (ps->user != NULL) continue; - if (file_matcher && ! (*file_matcher) (ps->filename, data)) - continue; + if (file_matcher) + { + if (ps->anonymous) + continue; + if (! (*file_matcher) (ps->filename, data)) + continue; + } if (recursively_search_psymtabs (ps, objfile, kind, name_matcher, data)) psymtab_to_symtab (ps);