Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Sanjoy Das <sanjoy@playingwithpointers.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] jit-reader.h: describe interface implemented by the JIT readers.
Date: Thu, 14 Jul 2011 17:43:00 -0000	[thread overview]
Message-ID: <m339i8epww.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1310588446-23904-1-git-send-email-sanjoy@playingwithpointers.com>	(Sanjoy Das's message of "Thu, 14 Jul 2011 01:50:45 +0530")

>>>>> "Sanjoy" == Sanjoy Das <sanjoy@playingwithpointers.com> writes:

Sanjoy> Generating ELF files in memory is usually too much work for JIT
Sanjoy> compilers, since they usually don't have the related routines (as
Sanjoy> opposed to a regular static compiler). One way to simplify this is to
Sanjoy> have the JIT vendor themselves provide a shared object which is loaded
Sanjoy> and used to parse the debug information. This patch exposes a
Sanjoy> simplified interface for the debug info parser.

The idea makes sense to me.  I'd like this to go in.

Sanjoy> This patch adds a header file (`jit-reader.h') which can be included
Sanjoy> and implemented in a shared object to build a working JIT
Sanjoy> debug-reader.

This header should be installed somewhere, I think $includedir/gdb/.

The whole header should have conditional 'extern "C"' wrapping, just in case.

Sanjoy> +#define GDB_JIT_SUCCESS          1
Sanjoy> +#define GDB_JIT_FAIL             0

Not an enum?

Sanjoy> +#ifndef __GDB__INTERNAL /* Only defined when being compiled in GDB. */
Sanjoy> +typedef long long CORE_ADDR;
Sanjoy> +#endif

I think long long isn't portable.  One approach would be to take the
configury stuff from gdb and put it into a new header with the
appropriate namespace prefixes.  The auto-configured bits could be done
at build time by extracting stuff from config.h.

We should be namespace-safe always, so it should be GDB_CORE_ADDR or
GDB_JIT_CORE_ADDR.

Sanjoy> +typedef void (gdbjit_symtab_add_line_mapping)
Sanjoy> +(struct gdbjit_symtab_callbacks * callbacks, struct gdbjit_symtab *symtab,

Indentation.

Sanjoy> +typedef struct gdbjit_reg_value (gdbjit_unwind_reg_get)
Sanjoy> +  (struct gdbjit_unwind_callbacks *callback, int regnum);

I would have expected this to take a frame as well.
Why doesn't it?

Maybe I don't understand the overall plan here.

Sanjoy> +/* Called once for each new inferior program. It should also initialize the
Sanjoy> +   private pointer (to which a pointer is passed here) if the it needs one.

s/the//

Sanjoy> +   Should return GDB_JIT_SUCESS on success and GDB_JIT_FAIL on error. */

Typo, "GDB_JIT_SUCCESS"

Sanjoy> +extern int gdbjit_read_debug_info (void *private,
Sanjoy> +                                   struct gdbjit_symtab_callbacks *callbacks,
Sanjoy> +                                   CORE_ADDR memory, long memory_sz);

I don't understand the point of this one.


This change needs a patch for the manual.

I already forgot... did we get you started on the copyright assignment
process?

Tom


      parent reply	other threads:[~2011-07-14 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 20:23 Sanjoy Das
2011-07-13 20:23 ` [PATCH 2/2] Add symbol-handling callbacks to the jit-reader interface Sanjoy Das
2011-07-14 17:54   ` Tom Tromey
2011-07-22 16:42     ` Joel Brobecker
2011-07-22 17:12       ` Tom Tromey
2011-07-14 17:43 ` Tom Tromey [this message]

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=m339i8epww.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sanjoy@playingwithpointers.com \
    /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