2012-06-13 Kaushik Srenevasan <kaushik@twitter.com>
authorTom Tromey <tromey@redhat.com>
Wed, 13 Jun 2012 21:16:49 +0000 (21:16 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 13 Jun 2012 21:16:49 +0000 (21:16 +0000)
* jit.c (finalize_symtab): Set function's return type to 'void' by
default.

gdb/ChangeLog
gdb/jit.c

index 7a54241d6725569a60653b297c13dbcda256ed19..34b75ceb91d1f93e05fe52676e1e2f7d4a7094ab 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-13  Kaushik Srenevasan  <kaushik@twitter.com>
+
+       * jit.c (finalize_symtab): Set function's return type to 'void' by
+       default.
+
 2012-06-13  Mark Kettenis  <kettenis@gnu.org>
            H.J. Lu  <hongjiu.lu@intel.com>
 
index f172e41b726f21fc244749010724f6a8cf830e93..568d17be0f9576d6feffa515621c1c58066101a4 100644 (file)
--- 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,