From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15431 invoked by alias); 26 Sep 2013 01:54:02 -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 14278 invoked by uid 89); 26 Sep 2013 01:54:01 -0000 Received: from mail-ie0-f179.google.com (HELO mail-ie0-f179.google.com) (209.85.223.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 26 Sep 2013 01:54:01 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_00,NO_RELAYS,SPAM_SUBJECT autolearn=no version=3.3.2 X-HELO: mail-ie0-f179.google.com Received: by mail-ie0-f179.google.com with SMTP id e14so575802iej.38 for ; Wed, 25 Sep 2013 18:53:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=6M6IQp2Vsr2FOvlql0ur7H8MPXzi4EQBlV+Ics+IvuA=; b=JV3nhe2yPuQrZ0wpub5exWpa1jWq4zb2nbYP+nMmBXCSJ2P/49TIRPDQ8XNYMHlrMy bAg3x65gUc7GC3eZmWhhnjjrNGCRGm73xRKQfzSQaXoDJMBZb1gGWZfa7YAUSWPiVSCs TYkjEZVh1ArFIzELg8sGJHtTuLPK0RFC8ipRc59ZRurGVGhHOQ3K5whlqtPmMUClvQ4/ pQwRHWSgfXbFfs0eulqsgpJZZRub2MGdlTrbAm/m2RFZTG7v38iGIDYwm6Tv8V6h2Lr/ V0RGEELEWLTNVO+RdxyufdAloSI54oQK10ViALeLa1ncVJXjs9owUy/cflxyS7jiEy8x gOGg== X-Gm-Message-State: ALoCoQnU1fc6aRCQF5nIEkA6JLTZgYL94ynxwxSsNMgyaHC/X0Ou+0slnht07qHgcKqg8L0TkO6aW+0zwBVQclX+MMjyStuSHTvajGZ5nAr7J3o+a/fHZVyGC8g/jkb0L/LLXRaQAZaNOxPbwD63J4NKqcBmX+/xLxnKTYC8Z4jiwzIvEJQK7YpBF8hM5wT6DZcUfvwrrwXrKHveXi488Qd3N2lU7qwGEw== MIME-Version: 1.0 X-Received: by 10.42.146.1 with SMTP id h1mr20108939icv.38.1380160438900; Wed, 25 Sep 2013 18:53:58 -0700 (PDT) Received: by 10.64.31.100 with HTTP; Wed, 25 Sep 2013 18:53:58 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Sep 2013 01:54:00 -0000 Message-ID: Subject: Re: [RFC] Record objfile->original_name as an absolute path From: Doug Evans To: gdb-patches , Jan Kratochvil Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00916.txt.bz2 On Wed, Sep 25, 2013 at 6:29 PM, Doug Evans wrote: > Hi. > > The comment for objfile->original_name says the path is stored as an > absolute path, but that's not the case, and that got me thinking: > What if the user cd's before the debug info is accessed? > > This patch is only RFC, and not RFA, because I'm not sure how to do > something better in the test. I can certainly clean up what's there, > if people think it's not *too* cheezy. > > [...] > > 2013-09-25 Doug Evans > > * objfiles.c (allocate_objfile): Save original_name as an absolute > path. > * objfiles.c (struct objfile): Expand comment on original_name. > * utils.c (gdb_abspath): New function. > * utils.h (gdb_abspath): Declare. > > testsuite/ > * gdb.dwarf/dwp-symlink.c: Fake out gdb to not load debug info > at start. > * gdb.dwarf/dwp-symlink.exp: Test trying to load dwp when the binary > has been specified with a relative path and we have chdir'd before > accessing the debug info. One thought for doing the test differently is to have an option to the "file" command that is the opposite of -readnow, that tells gdb to not read any debug info (even to set the initial language).