Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: gdb-patches@sourceware.org, Doug Evans <dje@google.com>
Subject: Re: [patch] Add "debug jit" for easier tracing of JIT support internals
Date: Wed, 05 Jan 2011 23:28:00 -0000	[thread overview]
Message-ID: <201101052328.00646.pedro@codesourcery.com> (raw)
In-Reply-To: <AANLkTi=WA5fZ1iFp_XGWy+TwErZfsicbhk9acm-egqJU@mail.gmail.com>

On Wednesday 05 January 2011 23:15:31, Paul Pluzhnikov wrote:
> Right. It's actually specified as uint64_t in jit.h, not size_t ...
> 
> > while 'size_t' is about sizes of objects
> > on the host.  E.g., on a 32-bit GDB (cross) debugging a 64-bit
> > inferior, size_t will usually be a 32-bit type.  I think it'd be
> > better to make that a ULONGEST throughout (and then use phex
> > or pulongest)
> 
> Since this interface is frozen, and ULONGEST isn't available to clients,
> I'll just cast symfile_size to ULONGEST and print it with pulongest.

That's better than %z, but I don't see why making that uint64_t
be a ULONGEST would be a problem.  The definition of:

 struct jit_code_entry
 {
   CORE_ADDR next_entry;
   CORE_ADDR prev_entry;
   CORE_ADDR symfile_addr;
   uint64_t symfile_size;
 };

in jit.h, is not included by clients.

Clients should define it like so, as per the manual:

 struct jit_code_entry
 {
   struct jit_code_entry *next_entry;
   struct jit_code_entry *prev_entry;
   const char *symfile_addr;
   uint64_t symfile_size;
 };

GDB reads this out of the inferior like so:

  /* Fix the endianness to match the host.  */
  ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
  code_entry->next_entry = extract_typed_address (&entry_buf[0], ptr_type);
  code_entry->prev_entry =
      extract_typed_address (&entry_buf[ptr_size], ptr_type);
  code_entry->symfile_addr =
      extract_typed_address (&entry_buf[2 * ptr_size], ptr_type);
  code_entry->symfile_size =
      extract_unsigned_integer (&entry_buf[3 * ptr_size], 8, byte_order);

And, extract_unsigned_integer returns a ULONGEST...

-- 
Pedro Alves


  reply	other threads:[~2011-01-05 23:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05 19:36 Paul Pluzhnikov
2011-01-05 20:02 ` Doug Evans
2011-01-05 22:57   ` Pedro Alves
2011-01-05 23:16     ` Paul Pluzhnikov
2011-01-05 23:28       ` Pedro Alves [this message]
2011-01-05 23:49         ` Paul Pluzhnikov
2011-01-06  0:45           ` Pedro Alves
2011-01-06  1:09             ` Paul Pluzhnikov
2011-01-06  4:14               ` Eli Zaretskii
2011-01-05 23:26     ` Doug Evans
2011-01-05 23:34       ` Pedro Alves
2011-01-06 19:45         ` Tom Tromey
2011-01-06 19:52           ` Paul Pluzhnikov
2011-01-05 20:57 ` Eli Zaretskii
2011-01-05 21:53   ` Paul Pluzhnikov
2011-01-05 22:51     ` Pedro Alves
2011-01-06  4:00     ` Eli Zaretskii

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=201101052328.00646.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.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