From: Sanjoy Das <sanjoy@playingwithpointers.com>
To: gdb-patches@sourceware.org
Cc: Sanjoy Das <sanjoy@playingwithpointers.com>
Subject: [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects.
Date: Mon, 24 Sep 2012 04:48:00 -0000 [thread overview]
Message-ID: <1348462325-4891-3-git-send-email-sanjoy@playingwithpointers.com> (raw)
In-Reply-To: <1348462325-4891-1-git-send-email-sanjoy@playingwithpointers.com>
---
gdb/ChangeLog | 5 +++++
gdb/doc/ChangeLog | 4 ++++
gdb/doc/gdb.texinfo | 22 +++++++++++++---------
gdb/jit.c | 6 +++++-
4 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 13eaa5c..69e3e8f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2012-09-24 Sanjoy Das <sanjoy@playingwithpointers.com>
+ * 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 <sanjoy@playingwithpointers.com>
+
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 ba8231a..0546467 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-24 Sanjoy Das <sanjoy@playingwithpointers.com>
+ * gdb.texinfo (Using JIT Debug Info Readers): Change documentation
+ to reflect that jit-reader-load now supports absolute file-names.
+
2012-09-21 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 5fcbada..c28b803 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -33436,15 +33436,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} is a shared
+object specified as either an absolute or a relative file name. 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-unload} 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 eff2ed6..48a2dbb 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -25,6 +25,7 @@
#include "breakpoint.h"
#include "command.h"
#include "dictionary.h"
+#include "filenames.h"
#include "frame-unwind.h"
#include "gdbcmd.h"
#include "gdbcore.h"
@@ -208,7 +209,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 (IS_ABSOLUTE_PATH(args))
+ 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
next prev parent reply other threads:[~2012-09-24 4:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 4:48 [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Sanjoy Das
2012-09-24 4:48 ` [PATCH 1/3] Fix http://sourceware.org/bugzilla/show_bug.cgi?id=14550 Sanjoy Das
2012-09-24 8:12 ` Joel Brobecker
2012-09-27 20:59 ` Tom Tromey
2012-09-24 4:48 ` Sanjoy Das [this message]
2012-09-24 5:45 ` [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects Eli Zaretskii
2012-09-27 20:58 ` Tom Tromey
2012-09-24 4:48 ` [PATCH 3/3] Add a test case for the jit-reader interface Sanjoy Das
2012-09-27 21:00 ` Tom Tromey
-- strict thread matches above, loose matches on Subject: below --
2012-11-04 16:59 [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Sanjoy Das
2012-11-04 17:00 ` [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects Sanjoy Das
2013-01-09 9:36 ` Jan Kratochvil
2012-10-08 11:43 [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Sanjoy Das
2012-10-08 11:43 ` [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects Sanjoy Das
2012-10-08 12:34 ` Eli Zaretskii
2012-10-16 20:13 ` Tom Tromey
2012-09-18 4:30 [PATCH 0/3] Fix recent breakage in the JIT reader interface Sanjoy Das
2012-09-18 4:30 ` [PATCH 2/3] Make jit-reader-load accept absolute paths to reader shared objects Sanjoy Das
2012-09-18 6:59 ` Eli Zaretskii
2012-09-18 19:21 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348462325-4891-3-git-send-email-sanjoy@playingwithpointers.com \
--to=sanjoy@playingwithpointers.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox