From patchwork Fri May 16 22:46:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 996 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 350633600B4 for ; Fri, 16 May 2014 15:47:01 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id E384D5AD4615; Fri, 16 May 2014 15:47:00 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.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-mx22.g.dreamhost.com (Postfix) with ESMTPS id 80F545AE6423 for ; Fri, 16 May 2014 15:47:00 -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=mdmOcGDnkQvpfsj4wvu8XPgQc6PK9 4EtOJgMFMDlkfvZFhyg+/fMnTSkFaTY5O6cfai2HwnpV6HoCWExG1YgF5gVN38yq RrO1m5e8kYND4Y2JpZYkSl+vtdmlDG/HyQ0u00IjQm2UUsDz8HZodyVQDdE9M37O s+t7NImgrDfEso= 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=bkLoueC6OLBkkhi0gP/v39nispQ=; b=YVD PJdtwim9ns0k6tRgxJUgJ/onz/mHFxEktOhgABb1RghCjaPzLwSRh8e8AUcUwuIP 6RHPtIekx/k2rNpJGzyC1Tu4KFe4tpEXlJsHSBmHCnE96nrmEu7Tqvns6Opf19Xl QGUBR55zl/e4eeMZgO3t5aCcKC0Q3P+rSkeVpb+E= Received: (qmail 32162 invoked by alias); 16 May 2014 22:46:58 -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 32148 invoked by uid 89); 16 May 2014 22:46:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 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-oa0-f74.google.com Received: from mail-oa0-f74.google.com (HELO mail-oa0-f74.google.com) (209.85.219.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 16 May 2014 22:46:55 +0000 Received: by mail-oa0-f74.google.com with SMTP id m1so663190oag.5 for ; Fri, 16 May 2014 15:46:54 -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=vl807jQRl+BQjdsQBl49/X7OHS5yv3bNPuG1DGQzSDo=; b=BZT0R2DP8kciYx0aitQFFF4QTUnQa/Eh8EPooW2xq+ZmjTpoAUXI5xDEHTdwkOQjGo 8QKZ3iFLbCOQGSLhTj080zPCjhnjMrvfPpmVdvb3up/MI+Vt3vwxgP5o39+nDBwrF/66 HzLb+w0ac64nEnhOboCD18LftLZnH31B9/eTcMFaluWNmZxASFYFl0OVIuEXzoEZKRAS Qqb4d2RYVGIjvc7Lv2syDBEY9kB4A+qAIZ3t7kg8GPXy3PV3qGXtvSzjPQMsn8JxXnHe ObWLCUjeYUGnbkOgn1JNEO9iIEbNNXJ3yYnjUdJEXuVnYOoJxJy4R4TUodk/CAlSCpt1 4KWw== X-Gm-Message-State: ALoCoQl+lxIcyVPe+6zeI+W3vtLi46wBIrCIqsghr5gePRzIZUVSL25YWqrprkMszACp1LsRKKSR X-Received: by 10.182.28.102 with SMTP id a6mr8431141obh.44.1400280414220; Fri, 16 May 2014 15:46:54 -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 y50si480922yhk.4.2014.05.16.15.46.54 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 May 2014 15:46:54 -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 A03C031C1D8; Fri, 16 May 2014 15:46:53 -0700 (PDT) From: Doug Evans To: ccoutant@google.com, gdb-patches@sourceware.org Subject: [RFC] cleanup dwo files left in testsuite source tree Date: Fri, 16 May 2014 15:46:53 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi. Testing gdb.base/fullpath-expand.exp with -gsplit-dwarf leaves a few files behind in the source tree. bash$ git status [...] # Untracked files: # (use "git add ..." to include in what will be committed) # # testsuite/fullpath-expand-func.dwo # testsuite/fullpath-expand.dwo This is because the test first cd's to the source tree and runs the compilation there, and gcc creates the dwo files there. This patch cleans up the files after the test. I'm not intending to check it in at present since I'm not sure it's the best solution, and I doubt many test with fission and thus don't care. I think(!) a better solution would be to have a way to tell gcc where to put dwo files, and maybe use a different default for the "gcc -gsplit-dwarf foo.c bar.c -o /tmp/baz" case. Things get a bit complicated in that DW_AT_GNU_dwo_name is generally relative to DW_AT_comp_dir which is $srcdir. One could record an absolute path but that complicates providing gdb with alternative directories in which to find dwo files (with debug-file-directory, which is essentially a list of directories to try instead of DW_AT_comp_dir). One could create a new DWARF attribute to use instead of DW_AT_comp_dir for this purpose. DW_AT_GNU_dwo_dir? [If present, use that to find DW_AT_GNU_dwo_name. Otherwise use DW_AT_comp_dir.] Still, if I do "gcc foo.c bar.c -o /tmp/baz" I can be assured gcc won't try to create any files in the current directory (e.g. I could be compiling in a readonly source tree). -gsplit-dwarf doesn't follow this convention. IWBN I think, at least in this particular example, if gcc put the dwo files in the same directory as baz. Anyways, for reference sake, here's the patch. diff --git a/gdb/testsuite/gdb.base/fullpath-expand.exp b/gdb/testsuite/gdb.base/fullpath-expand.exp index 949f3fc..29be0b0 100644 --- a/gdb/testsuite/gdb.base/fullpath-expand.exp +++ b/gdb/testsuite/gdb.base/fullpath-expand.exp @@ -42,3 +42,10 @@ gdb_test "rbreak $realsrcfile2:func" "^rbreak \[^\r\n\]*:func\r\nBreakpoint 1 at # Verify the compilation pathnames are as expected: gdb_test "list func" "\tfunc \\(void\\)\r\n.*" gdb_test "info source" "^info source\r\nCurrent source file is [string_to_regexp ${subdir}/${srcfile2}]\r\nCompilation directory is /.*" + +# Fission leaves dwo files in the source tree. +# Clean them up. We can't clean them up sooner because gdb needs the +# debug info contained in them. +foreach file [list ${srcfile} ${srcfile2}] { + remote_file host delete ${srcdir}/[file rootname ${file}].dwo +}