From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Sanjoy Das <sanjoy@playingwithpointers.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] Fix segfault when unwinding JIT frames using a custom reader.
Date: Sat, 01 Dec 2012 20:25:00 -0000 [thread overview]
Message-ID: <20121201202522.GA22812@host2.jankratochvil.net> (raw)
In-Reply-To: <1352048631-25042-2-git-send-email-sanjoy@playingwithpointers.com>
On Sun, 04 Nov 2012 18:03:49 +0100, Sanjoy Das wrote:
> Issue http://sourceware.org/bugzilla/show_bug.cgi?id=14550
[...]
> --- a/gdb/jit.c
> +++ b/gdb/jit.c
> @@ -724,8 +724,18 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
> gdb_block_iter = gdb_block_iter->next)
> {
> if (gdb_block_iter->parent != NULL)
> - BLOCK_SUPERBLOCK (gdb_block_iter->real_block) =
> - gdb_block_iter->parent->real_block;
> + {
> + /* If the plugin specifically mentioned a parent block, we
> + use that. */
> + BLOCK_SUPERBLOCK (gdb_block_iter->real_block) =
> + gdb_block_iter->parent->real_block;
> + }
> + else
> + {
> + /* And if not, we set a default parent block. */
> + BLOCK_SUPERBLOCK (gdb_block_iter->real_block) =
> + BLOCKVECTOR_BLOCK (symtab->blockvector, STATIC_BLOCK);
> + }
While I find this patch correct:
(1) The interface for JIT readers was AFAIK designed to be easier than what
GDB provides internally. Therefore I think gdb_block->parent should not
exist, it can be rebuilt from gdb_block->begin and gdb_block->end,
together with some assumption about gdb_block->next ordering.
(2) Otherwise to keep it ABI compatible one should at least sanity check and
error if gdb_block->begin and gdb_block->end do not match the ordering via
gdb_block->parent.
Thanks,
Jan
next prev parent reply other threads:[~2012-12-01 20:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 1/3] Fix segfault when unwinding JIT frames using a custom reader Sanjoy Das
2012-12-01 20:25 ` Jan Kratochvil [this message]
2012-11-04 17:00 ` [PATCH 3/3] Add a test case for the jit-reader interface Sanjoy Das
2012-12-01 20:48 ` Jan Kratochvil
2012-12-07 9:15 ` Sanjoy Das
2012-12-10 16:38 ` Jan Kratochvil
2013-01-08 20:40 ` Sanjoy Das
2013-01-09 12:37 ` Jan Kratochvil
2013-01-13 21:58 ` Sanjoy Das
2013-01-14 3:52 ` Jan Kratochvil
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-11-08 21:06 ` [PATCH 0/3] Address review, "fix recent breakage in the JIT reader interface" Tom Tromey
-- strict thread matches above, loose matches on Subject: below --
2012-10-08 11:43 Sanjoy Das
2012-10-08 11:43 ` [PATCH 1/3] Fix segfault when unwinding JIT frames using a custom reader Sanjoy Das
2012-10-16 20:14 ` 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=20121201202522.GA22812@host2.jankratochvil.net \
--to=jan.kratochvil@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