From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18845 invoked by alias); 18 Sep 2012 04:30:17 -0000 Received: (qmail 18713 invoked by uid 22791); 18 Sep 2012 04:30:08 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Sep 2012 04:29:53 +0000 Received: by pbbro12 with SMTP id ro12so11721346pbb.0 for ; Mon, 17 Sep 2012 21:29:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=D9gBY/hkmoA6o2yTE7gCi44th7/hBdolB3Y7bZtvsY8=; b=aaQWl33FTJ7gNEpEn6Nu0FiM2dlfzNrOd+1jyUhliZnkF08W0WSsBvUp3d4ePcZvUy QYgSARxHffA2H3X8yabsGGAkvnxyJmApSNeolAmyH3D4T1vgooG0m/kccZYronZDHEWn NVVAs6nKcfG/dCw4DJ5C6EUM+WOQJQFDGtviRf0715j/yXpS9ICE1SURuqqn5hwNGYzP y7ABSHY2X+FSj6o5Xs3T8oTuu19zEloy7oly0i+UB1dU19G4EYnmmhQWtD8DpfV1+0E9 o1+zI92VhyqRbkDg+Ql+hRp7DlH1d3td4k+MjM0l5AqCAXwpS+9kbdRIwMWMj5oU6oz8 5kYw== Received: by 10.66.81.201 with SMTP id c9mr23658868pay.80.1347942593368; Mon, 17 Sep 2012 21:29:53 -0700 (PDT) Received: from divine-comedy.divine-comedy (ec2-122-248-200-206.ap-southeast-1.compute.amazonaws.com. [122.248.200.206]) by mx.google.com with ESMTPS id pn4sm8003659pbb.50.2012.09.17.21.29.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 21:29:52 -0700 (PDT) From: Sanjoy Das To: gdb-patches@sourceware.org Cc: Sanjoy Das Subject: [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects. Date: Tue, 18 Sep 2012 04:30:00 -0000 Message-Id: <1347942847-31510-3-git-send-email-sanjoy@playingwithpointers.com> In-Reply-To: <1347942847-31510-1-git-send-email-sanjoy@playingwithpointers.com> References: <1347942847-31510-1-git-send-email-sanjoy@playingwithpointers.com> X-Gm-Message-State: ALoCoQlTsb3yBTa9d1kM53K7Bmx/Wlj0k/MPPj+jyiLlpMLaTVXTv4iUxAkaGsddXn6BQefnhS8O 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-09/txt/msg00338.txt.bz2 --- gdb/ChangeLog | 5 +++++ gdb/doc/ChangeLog | 4 ++++ gdb/doc/gdb.texinfo | 22 +++++++++++++--------- gdb/jit.c | 5 ++++- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a1c55e5..24ea360 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2012-09-18 Sanjoy Das + * jit.c (jit_reader_load_command): Interpret the jit reader name + as an absolute path if it begins with a forward slash. + +2012-09-18 Sanjoy Das + PR gdb/14550 * jit.c (finalize_symtab): Ensure that only the global block has a diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index adcd4ff..9b84dcc 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2012-09-18 Sanjoy Das + * gdb.texinfo (Using JIT Debug Info Readers): Change documentation + to reflect that jit-reader-load now supports absolute file-names. + 2012-09-17 Yao Qi * gdb.texinfo (List): Describe the meaning of 0 and -1 in diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index dc8860a..0939c24 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -33419,15 +33419,19 @@ Readers can be loaded and unloaded using the @code{jit-reader-load} and @code{jit-reader-unload} commands. @table @code -@item jit-reader-load @var{reader-name} -Load the JIT reader named @var{reader-name}. On a UNIX system, this -will usually load @file{@var{libdir}/gdb/@var{reader-name}}, where -@var{libdir} is the system library directory, usually -@file{/usr/local/lib}. Only one reader can be active at a time; -trying to load a second reader when one is already loaded will result -in @value{GDBN} reporting an error. A new JIT reader can be loaded by -first unloading the current one using @code{jit-reader-load} and then -invoking @code{jit-reader-load}. +@item jit-reader-load @var{reader} +Load the JIT reader named @var{reader}. @var{reader} can either be +the absolute path to or the file name of a shared object. In the +latter case, gdb will try to load the reader from a pre-configured +directory, usually @file{@var{libdir}/gdb/} on a UNIX system (here +@var{libdir} is the system library directory, often +@file{/usr/local/lib}). + +Only one reader can be active at a time; trying to load a second +reader when one is already loaded will result in @value{GDBN} +reporting an error. A new JIT reader can be loaded by first unloading +the current one using @code{jit-reader-load} and then invoking +@code{jit-reader-load}. @item jit-reader-unload Unload the currently loaded JIT reader. diff --git a/gdb/jit.c b/gdb/jit.c index 2f9d426..818238f 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -208,7 +208,10 @@ jit_reader_load_command (char *args, int from_tty) if (loaded_jit_reader != NULL) error (_("JIT reader already loaded. Run jit-reader-unload first.")); - so_name = xstrprintf ("%s/%s", jit_reader_dir, args); + if (args[0] == '/') + so_name = xstrdup (args); + else + so_name = xstrprintf ("%s/%s", jit_reader_dir, args); prev_cleanup = make_cleanup (xfree, so_name); loaded_jit_reader = jit_reader_load (so_name); -- 1.7.10.4