This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] JIT read_debug_info callback takes target symfile addr


Andy Wingo <wingo@igalia.com> writes:
> Hi,
>
> The attached patch makes an incompatible change to the JIT reader
> interface to pass the target address of the symfile to the
> read_debug_info, instead of eagerly copying the symfile to GDB and
> passing the local address to the .so.  In many cases this allows the
> target to be simpler, as in many cases it's not necessary to allocate a
> symfile object at all.  In the case where you do need the memory in the
> GDB address space, well the target_read() callback is there for you.
>
> I have a patch coming that will allow JIT readers to be implemented in
> Guile.  It uses the JIT reader interface, though loaded from an
> extension instead of a shared library.  This patch would help extensions
> to be able to do JIT unwinding, as extensions have a much richer
> interface to GDB and in particular can query types and sizes from the
> inferior, without having to hard-code them from the reader side.  What
> you want is the target address, not the target's memory.
>
> WDYT?
>
>
> From 983216b213af8c2cf5853a814d2559062018fce4 Mon Sep 17 00:00:00 2001
> From: Andy Wingo <wingo@igalia.com>
> Date: Mon, 23 Feb 2015 15:06:09 +0100
> Subject: [PATCH] JIT read_debug_info callback takes target symfile address
>
> gdb/ChangeLog:
> 2015-02-23  Andy Wingo  <wingo@igalia.com>
>
> 	* NEWS: Announce JIT reader interface change.
> 	* jit-reader.in (GDB_READER_INTERFACE_VERSION): Bump to 2.
> 	(gdb_read_debug_info): Update typedef to express the memory as a
> 	target address, and update the comment.
> 	* jit.c (jit_reader_try_read_symtab): Don't read the symfile from
> 	target memory.  The JIT reader can do that if it likes using the
> 	gdb_symbol_callbacks structure.
>
> gdb/testsuite/ChangeLog:
> 2015-02-23  Andy Wingo  <wingo@igalia.com>
>
> 	* gdb.base/jitreader.c (read_debug_info): Update for changes in
> 	JIT reader interface and jithost.c test.
> 	* gdb.base/jithost.c (main): No need to allocate symfile objects
> 	with the new GDB_READER_INTERFACE_VERSION.
> 	* gdb.base/jithost.h: Removed.


Hi. A couple of high level comments.

1) My understanding is that we still need to support older versions of
the interface, at least for awhile.
Our currently deprecation policy is to never break anything
(or something within epsilon of that).
This doesn't scale. I'd like to see a formal policy where things
can live in a deprecated state for pre-specified awhile, after which
they can be deleted.

2) It's not clear to me whether we want to continue extending the JIT
interface, or just move it to the extension languages.
We'd still keep the existing interface, deprecated.
I'm not proposing we actually do this, at least not today.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]