Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kaushik Srenevasan <kaushik@twitter.com>
To: daniel.jacobowitz@gmail.com, palves@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: Fix GDB crash while trying to display the return type of a JIT frame.
Date: Tue, 05 Jun 2012 21:16:00 -0000	[thread overview]
Message-ID: <87d35dh36p.fsf@garudatw.twitter.com> (raw)
In-Reply-To: <CAN9gPaFRTvJkxxDxUWbNS7yiNP9xV02gWH3bPmq3c3GTRPavgQ@mail.gmail.com>	(Daniel Jacobowitz's message of "Tue, 5 Jun 2012 10:14:18 -0400")

Daniel Jacobowitz <daniel.jacobowitz@gmail.com> writes:
> Nit: second line should line up with the asterisk, not further in.
>
> Nits: watch out for the coding style, particularly space before open
> paren and 80 column limit.

Fixed.

Pedro Alves <palves@redhat.com> writes:
> Pedantically, it'd be better to write 'get_objfile_arch (objfile)' instead
> of target_gdbarch, even though the objfile's gdbarch is initialized
> to target_gdbarch presently.

Fixed.

   -Kaushik

2012-06-04  Kaushik Srenevasan  <kaushik@twitter.com>
       * jit.c (finalize_symtab): Set function's return type to 'void'
       by default.

diff --git a/gdb/jit.c b/gdb/jit.c
index f172e41..568d17b 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -660,6 +660,10 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
       struct block *new_block = allocate_block (&objfile->objfile_obstack);
       struct symbol *block_name = obstack_alloc (&objfile->objfile_obstack,
                                                  sizeof (struct symbol));
+      struct type *block_type = arch_type (get_objfile_arch (objfile),
+					   TYPE_CODE_VOID,
+					   1,
+					   "void");
 
       BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack,
                                                    NULL);
@@ -672,6 +676,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
       SYMBOL_DOMAIN (block_name) = VAR_DOMAIN;
       SYMBOL_CLASS (block_name) = LOC_BLOCK;
       SYMBOL_SYMTAB (block_name) = symtab;
+      SYMBOL_TYPE (block_name) = lookup_function_type (block_type);
       SYMBOL_BLOCK_VALUE (block_name) = new_block;
 
       block_name->ginfo.name = obsavestring (gdb_block_iter->name,


  reply	other threads:[~2012-06-05 21:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04 20:47 Kaushik Srenevasan
2012-06-05 14:14 ` Daniel Jacobowitz
2012-06-05 21:16   ` Kaushik Srenevasan [this message]
2012-06-13 21:16     ` Tom Tromey
2012-06-13 21:52       ` Kaushik Srenevasan
2012-06-05 15:38 ` Pedro Alves

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=87d35dh36p.fsf@garudatw.twitter.com \
    --to=kaushik@twitter.com \
    --cc=daniel.jacobowitz@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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