diff -uprN -x '*~' gdb-6.8/gdb/buildsym.c gdb-6.8-vala/gdb/buildsym.c --- gdb-6.8/gdb/buildsym.c 2008-01-01 23:53:09.000000000 +0100 +++ gdb-6.8-vala/gdb/buildsym.c 2008-08-11 13:06:39.000000000 +0100 @@ -658,14 +658,14 @@ start_subfile (char *name, char *dirname /* If the filename of this subfile ends in .C, then change the language of any pending subfiles from C to C++. We also accept any other C++ suffixes accepted by deduce_language_from_filename. */ - /* Likewise for f2c. */ + /* Likewise for f2c and Vala. */ if (subfile->name) { struct subfile *s; enum language sublang = deduce_language_from_filename (subfile->name); - if (sublang == language_cplus || sublang == language_fortran) + if (sublang == language_cplus || sublang == language_fortran || sublang == language_vala) for (s = subfiles; s != NULL; s = s->next) if (s->language == language_c) s->language = sublang; @@ -675,7 +675,8 @@ start_subfile (char *name, char *dirname if (subfile->language == language_c && subfile->next != NULL && (subfile->next->language == language_cplus - || subfile->next->language == language_fortran)) + || subfile->next->language == language_fortran + || subfile->next->language == language_vala)) { subfile->language = subfile->next->language; } diff -uprN -x '*~' gdb-6.8/gdb/c-lang.c gdb-6.8-vala/gdb/c-lang.c --- gdb-6.8/gdb/c-lang.c 2008-02-05 23:17:40.000000000 +0100 +++ gdb-6.8-vala/gdb/c-lang.c 2008-08-11 13:06:39.000000000 +0100 @@ -35,13 +35,12 @@ #include "cp-support.h" extern void _initialize_c_language (void); -static void c_emit_char (int c, struct ui_file * stream, int quoter); /* Print the character C on STREAM as part of the contents of a literal string whose delimiter is QUOTER. Note that that format for printing characters and strings is language specific. */ -static void +void c_emit_char (int c, struct ui_file *stream, int quoter) { const char *escape; diff -uprN -x '*~' gdb-6.8/gdb/c-lang.h gdb-6.8-vala/gdb/c-lang.h --- gdb-6.8/gdb/c-lang.h 2008-01-01 23:53:09.000000000 +0100 +++ gdb-6.8-vala/gdb/c-lang.h 2008-08-11 13:06:39.000000000 +0100 @@ -52,6 +52,8 @@ extern void c_printstr (struct ui_file * unsigned int length, int width, int force_ellipses); +extern void c_emit_char (int, struct ui_file *, int); + extern void scan_macro_expansion (char *expansion); extern int scanning_macro_expansion (void); extern void finished_macro_expansion (void); diff -uprN -x '*~' gdb-6.8/gdb/defs.h gdb-6.8-vala/gdb/defs.h --- gdb-6.8/gdb/defs.h 2008-01-18 18:07:39.000000000 +0100 +++ gdb-6.8-vala/gdb/defs.h 2008-08-11 13:06:39.000000000 +0100 @@ -182,6 +182,7 @@ enum language language_pascal, /* Pascal */ language_ada, /* Ada */ language_scm, /* Guile Scheme */ + language_vala, /* Vala */ language_minimal, /* All other languages, minimal support only */ nr_languages }; diff -uprN -x '*~' gdb-6.8/gdb/dwarf2read.c gdb-6.8-vala/gdb/dwarf2read.c --- gdb-6.8/gdb/dwarf2read.c 2008-03-10 15:18:10.000000000 +0100 +++ gdb-6.8-vala/gdb/dwarf2read.c 2008-08-11 13:06:39.000000000 +0100 @@ -7255,7 +7255,7 @@ new_symbol (struct die_info *die, struct memset (sym, 0, sizeof (struct symbol)); /* Cache this symbol's name and the name's demangled form (if any). */ - SYMBOL_LANGUAGE (sym) = cu->language; + SYMBOL_LANGUAGE (sym) = current_subfile->language; SYMBOL_SET_NAMES (sym, name, strlen (name), objfile); /* Default assumptions. diff -uprN -x '*~' gdb-6.8/gdb/eval.c gdb-6.8-vala/gdb/eval.c --- gdb-6.8/gdb/eval.c 2008-02-04 01:23:04.000000000 +0100 +++ gdb-6.8-vala/gdb/eval.c 2008-08-11 13:06:39.000000000 +0100 @@ -2079,7 +2079,10 @@ evaluate_subexp_standard (struct type *e case OP_THIS: (*pos) += 1; - return value_of_this (1); + if (current_language->la_value_of_this) + return current_language->la_value_of_this (1); + else + error (_("internal error : `this' is not defined for current language")); case OP_OBJC_SELF: (*pos) += 1; diff -uprN -x '*~' gdb-6.8/gdb/linespec.c gdb-6.8-vala/gdb/linespec.c --- gdb-6.8/gdb/linespec.c 2008-01-01 23:53:11.000000000 +0100 +++ gdb-6.8-vala/gdb/linespec.c 2008-08-11 13:06:39.000000000 +0100 @@ -33,6 +33,7 @@ #include "parser-defs.h" #include "block.h" #include "objc-lang.h" +#include "vala-lang.h" #include "linespec.h" #include "exceptions.h" #include "language.h" @@ -182,7 +183,7 @@ total_number_of_methods (struct type *ty CHECK_TYPEDEF (type); if (TYPE_CPLUS_SPECIFIC (type) == NULL) - return 0; + return 1; /* to be used by vala */ count = TYPE_NFN_FIELDS_TOTAL (type); for (n = 0; n < TYPE_N_BASECLASSES (type); n++) @@ -1380,6 +1381,7 @@ lookup_prefix_sym (char **argptr, char * { char *p1; char *copy; + struct symbol* sym; /* Extract the class name. */ p1 = p; @@ -1398,8 +1400,17 @@ lookup_prefix_sym (char **argptr, char * /* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA", argptr->"inA::fun" */ - return lookup_symbol (copy, 0, STRUCT_DOMAIN, 0, + sym = lookup_symbol (copy, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL); + if (sym == NULL) + { + /* In Vala, a class ClassName will give a struct _ClassName */ + char* _name = concat ("_", copy, NULL); + sym = lookup_symbol (_name, 0, STRUCT_DOMAIN, 0, + (struct symtab **) NULL); + xfree (_name); + } + return sym; } /* This finds the method COPY in the class whose type is T and whose @@ -1450,6 +1461,19 @@ find_method (int funfirstline, char ***c { char *tmp; + /* try looking up a vala method*/ + sym = lookup_symbol (vala_member_name(VALA_TYPE_NAME(t), copy), NULL, + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL); + if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) + { + values.sals = (struct symtab_and_line *) + xmalloc (sizeof (struct symtab_and_line)); + values.nelts = 1; + values.sals[0] = find_function_start_sal (sym, + funfirstline); + return values; + } + if (is_operator_name (copy)) { tmp = (char *) alloca (strlen (copy + 3) + 9); diff -uprN -x '*~' gdb-6.8/gdb/Makefile.in gdb-6.8-vala/gdb/Makefile.in --- gdb-6.8/gdb/Makefile.in 2008-03-17 13:15:08.000000000 +0100 +++ gdb-6.8-vala/gdb/Makefile.in 2008-08-11 13:06:39.000000000 +0100 @@ -631,6 +631,7 @@ SFILES = ada-exp.y ada-lang.c ada-typepr typeprint.c \ ui-out.c utils.c ui-file.h ui-file.c \ user-regs.c \ + vala-lang.c \ valarith.c valops.c valprint.c value.c varobj.c vec.c \ wrapper.c \ xml-tdesc.c xml-support.c @@ -1056,6 +1057,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $ jv-lang.o jv-valprint.o jv-typeprint.o \ m2-lang.o p-lang.o p-typeprint.o p-valprint.o \ scm-exp.o scm-lang.o scm-valprint.o \ + vala-lang.o \ sentinel-frame.o \ complaints.o typeprint.o \ ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o \ @@ -2919,6 +2921,11 @@ v850-tdep.o: v850-tdep.c $(defs_h) $(fra $(frame_unwind_h) $(dwarf2_frame_h) $(gdbtypes_h) $(inferior_h) \ $(gdb_string_h) $(gdb_assert_h) $(gdbcore_h) $(arch_utils_h) \ $(regcache_h) $(dis_asm_h) $(osabi_h) +vala-lang.o: vala-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \ + $(jv_lang_h) $(gdbcore_h) $(block_h) $(demangle_h) $(dictionary_h) \ + $(gdb_assert_h) valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(target_h) $(language_h) $(gdb_string_h) \ $(doublest_h) $(dfp_h) $(infcall_h) diff -uprN -x '*~' gdb-6.8/gdb/stack.c gdb-6.8-vala/gdb/stack.c --- gdb-6.8/gdb/stack.c 2008-03-17 16:06:24.000000000 +0100 +++ gdb-6.8-vala/gdb/stack.c 2008-08-11 13:06:39.000000000 +0100 @@ -43,6 +43,7 @@ #include "regcache.h" #include "solib.h" #include "valprint.h" +#include "vala-lang.h" #include "gdb_assert.h" #include @@ -1376,13 +1377,17 @@ print_block_frame_locals (struct block * case LOC_STATIC: case LOC_BASEREG: case LOC_COMPUTED: - values_printed = 1; - for (j = 0; j < num_tabs; j++) - fputs_filtered ("\t", stream); - fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); - fputs_filtered (" = ", stream); - print_variable_value (sym, frame, stream); - fprintf_filtered (stream, "\n"); + if (current_language->la_language != language_vala || + strncmp (SYMBOL_PRINT_NAME (sym), "_tmp", 4)) + { + values_printed = 1; + for (j = 0; j < num_tabs; j++) + fputs_filtered ("\t", stream); + fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); + fputs_filtered (" = ", stream); + print_variable_value (sym, frame, stream); + fprintf_filtered (stream, "\n"); + } break; default: diff -uprN -x '*~' gdb-6.8/gdb/symfile.c gdb-6.8-vala/gdb/symfile.c --- gdb-6.8/gdb/symfile.c 2008-01-29 23:47:20.000000000 +0100 +++ gdb-6.8-vala/gdb/symfile.c 2008-08-11 13:06:39.000000000 +0100 @@ -2693,6 +2693,7 @@ init_filename_language_table (void) add_filename_language (".ads", language_ada); add_filename_language (".a", language_ada); add_filename_language (".ada", language_ada); + add_filename_language (".vala", language_vala); } } diff -uprN -x '*~' gdb-6.8/gdb/vala-lang.c gdb-6.8-vala/gdb/vala-lang.c --- gdb-6.8/gdb/vala-lang.c 1970-01-01 00:00:00.000000000 +0000 +++ gdb-6.8-vala/gdb/vala-lang.c 2008-08-11 14:28:28.000000000 +0100 @@ -0,0 +1,494 @@ +#include "defs.h" +#include "symtab.h" +#include "gdbtypes.h" +#include "expression.h" +#include "parser-defs.h" +#include "language.h" +#include "gdb_string.h" +#include "value.h" +#include "vala-lang.h" +#include "c-lang.h" +#include "jv-lang.h" +#include + +extern void _initialize_vala_language (void); +static void vala_print_class (struct type *, struct ui_file *, int, int); + +/* defined in c-lang.c */ +extern const struct op_print c_op_print_tab[]; + +char* +vala_member_name (const char* type_name, const char* method_name) +{ + char *result = NULL; + int first = 1; + const char *c; + char low[2]; + low[1]='\0'; + + if (type_name[0] == 'G' && isupper(type_name[1])) + { + /* a special case for glib */ + result = strdup ("g_"); + type_name++; + } + for (c = type_name; *c != '\0'; c++) + { + if (!first && isupper (*c)) + { + /* current character is upper case and + * we're not at the beginning */ + if (!isupper (*(c-1)) || (strlen (c) >= 2 && !isupper (*(c+1)))) + { + /* previous character wasn't upper case or + * next character isn't upper case*/ + long len = strlen (result); + if (len != 1 && *(result + len - 2) != '_') + { + /* we're not creating 1 character words */ + result = reconcat (result, result, "_", NULL); + } + } + } + low[0] = tolower (*c); + result = reconcat (result, result ? result : "", low, NULL); + first = 0; + } + result = reconcat (result, result, "_", method_name, NULL); + /*printf ("class %s, method %s: %s", type_name, method_name, result);*/ + return result; +} + +struct value* +vala_value_field(struct value *arg1, int fieldno, int private) +{ + return NULL; +} + +struct value* +vala_search_method (char *name, struct value **arg1p, + struct value **args, int offset, + int *static_memfuncp, struct type *type) +{ + char *methodname; + struct symbol* methodsym; + struct value * method; + + /*char *classname; + struct type *classtype, *typeinstance; + struct value *class, *g_arg1p, *method = NULL;*/ + + methodname = vala_member_name (VALA_TYPE_NAME(type), name); + methodsym = lookup_symbol(methodname, NULL, VAR_DOMAIN, NULL, NULL); + if (methodsym != NULL) + { + /* FIXME : check if args match */ + method = value_of_variable (methodsym, NULL); + } + else if (check_field(*arg1p, "parent_instance")) + { + *arg1p = value_field (*arg1p, 0); + method = vala_search_method (name, arg1p, args, offset, static_memfuncp, + check_typedef (TYPE_FIELD(type, 0).type)); + } + + /* lookup virtual methods first */ + /* CLASS = (Class*) (((GTypeInstance*) arg1p)->g_class) */ + /* typeinstance = lookup_pointer_type (basic_lookup_transparent_type ("_GTypeInstance")); + + classname = concat (TYPE_TAG_NAME(type), "Class", NULL); + classtype = basic_lookup_transparent_type (classname); + if (classtype != NULL) + classtype = lookup_pointer_type (classtype); + else + { + classname = reconcat (classname, TYPE_TAG_NAME(type), "Iface", NULL); + classtype = basic_lookup_transparent_type (classname); + xfree(classname); + + if (classtype != NULL) + classtype = lookup_pointer_type (classtype); + else + return NULL; + } + + g_arg1p = value_cast_pointers(typeinstance, value_addr(*arg1p)); + class = value_field(value_ind(g_arg1p), 0); + class = value_cast_pointers (classtype, class); + + method = value_struct_elt (&class, args, name, static_memfuncp, NULL);*/ + + + return method; +} + +CORE_ADDR +vala_skip_trampoline (struct frame_info *frame, CORE_ADDR pc) +{ + struct symbol * func; + char* func_name; + + func = get_frame_function (frame); + if (func == NULL) + return 0; + + func_name = SYMBOL_PRINT_NAME (func); + + + /* isn't there an equivalent for g_str_has_suffix ?*/ + if (streq (func_name + (strlen(func_name) - 9), "_get_type") || + streq (func_name + (strlen(func_name) - 4), "_ref") || + streq (func_name + (strlen(func_name) - 6), "_unref")) + { + //printf ("function %s going to be skipped\n", func_name); + return frame_pc_unwind (frame); + } + + return 0; +} + +struct field* +vala_type_get_fields (struct type* type, int* nfields) +{ + int offset = 0; + + if (TYPE_CODE(type) != TYPE_CODE_STRUCT) + /* error */ + return NULL; + + if (TYPE_FIELDS (type) != NULL && VALA_TYPE_IS_CLASS(type)) + { + offset = 1; + if (VALA_TYPE_HAS_PRIV(type)) + { + offset = 2; + } + } + if (nfields != NULL) + *nfields = TYPE_NFIELDS (type) - offset; + return TYPE_FIELDS (type) + offset; +} + +struct field* +vala_type_get_private_fields (struct type* type, int* nfields) +{ + struct type* priv; + + if (TYPE_CODE(type) != TYPE_CODE_STRUCT) + /* error */ + return NULL; + + if (VALA_TYPE_IS_CLASS(type) && VALA_TYPE_HAS_PRIV(type)) + { + priv = check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD(type,1).type)); + if (nfields != NULL) + { + *nfields = TYPE_NFIELDS(priv); + } + return TYPE_FIELDS(priv); + } + + return NULL; +} +/* This method does the inverse of what vala_member_name does. Unfortunately, + there are 3 possible inverses for name : Name, NAme, and NAME. I'm testing + only for the first one. + (FIXME: should also take care of foreach) */ +char * +vala_demangle (const char *mangled, int options) +{ + char* part; + char* class_name = strdup (""); + char* method_name; + struct type* type = NULL; + char* name; + + /* classname = xmalloc(strlen(physname)+1);*/ + name = strdup (mangled); + part = strtok (name, "_"); + /* FIXME : strtok (name, ...) only once */ + while (type == NULL && part != NULL) + { + part[0] = toupper (part[0]); + class_name = reconcat (class_name, class_name, part, NULL); + type = vala_lookup_transparent_type (class_name); + part = strtok (NULL, "_"); + } + xfree (class_name); + + if (type != NULL) + { + int creation_method = 0; + class_name = VALA_TYPE_NAME(type); + + if (streq (part, "new")) + { + /* creation method */ + creation_method = 1; + method_name = strdup (".new"); + } + else if (strcmp (part, "real") != 0) + /* not a virtual method implementation */ + method_name = strdup (part); + + if (part + strlen (part) < name + strlen (mangled)) + { + method_name = reconcat (method_name, method_name, creation_method ? "." : "_", + part + strlen (part), NULL); + } + + xfree (name); + //printf ("vala : demangling %s : %s.%s\n", mangled, class_name, method_name); + return reconcat (method_name, class_name, ".", method_name, NULL); + } + + xfree (name); + return NULL; +} + +/* Return the name of the class containing method PHYSNAME. */ +static char * +vala_class_name_from_physname (const char *physname) +{ + //printf ("vala_class_name_from_physname : %s\n", physname); + return NULL; +} +struct value * +vala_value_of_this (int complain) +{ + struct value* self = value_of_local ("self", 0); + if (self != NULL) + return self; + + /* in overriding methods this argument is called base + * and is sometimes not casted */ + self = value_of_local ("base", 0); + if (self != NULL) + return self; + + if (complain) + error (_("`this' undefined in this context")); + + return NULL; +} + +struct type* +vala_lookup_transparent_type (const char* name) +{ + char* _name; + struct type* type; + + type = basic_lookup_transparent_type (name); + if (type == NULL && name[0] != '_') + { + _name = concat ("_", name, NULL); + type = basic_lookup_transparent_type (_name); + xfree (_name); + } + + return type; +} +void +vala_print_type (struct type *type, char *varstring, struct ui_file *stream, + int show, int level) +{ + struct type *true_type; + char *name; + int offset; + + switch (TYPE_CODE (type)) + { + case TYPE_CODE_PTR: + true_type = check_typedef (TYPE_TARGET_TYPE (type)); + if (TYPE_CODE (true_type) == TYPE_CODE_STRUCT) + { + /* it's either a class or a ptr to a struct */ + if (VALA_TYPE_IS_CLASS (true_type)) + { + struct field *fields, *privfields; + int nfields, nprivfields; + + /* it's a GType based class */ + if (show > 0) + fputs_filtered ("class ", stream); + + fputs_filtered (VALA_TYPE_NAME(true_type), stream); + + if (show > 0) + { + name = VALA_TYPE_NAME (VALA_TYPE_BASE_CLASS (true_type)); + if (strcmp (name, "GTypeInstance") != 0) + { + fputs_filtered (" : ", stream); + fputs_filtered (name, stream); + } + fields = vala_type_get_fields (true_type, &nfields); + privfields = vala_type_get_private_fields (true_type, &nprivfields); + if (nfields + nprivfields > 0) + { + int i,j; + + fputs_filtered (" {\n", stream); + + for (i = 0; i < nfields; i++) + { + struct field f = fields[i]; + for (j=0;j 0) + { + fputs_filtered (TYPE_CODE(type) == TYPE_CODE_STRUCT ? + "struct " : "enum ", stream); + } + fputs_filtered (VALA_TYPE_NAME(type), stream); + if (show > 0 && TYPE_NFIELDS (type) > 0) + { + int i; + fputs_filtered (" {\n", stream); + for (i = 0; i < TYPE_NFIELDS (type); i++) + { + struct field f = TYPE_FIELD (type, i); + vala_print_type (f.type, f.name, stream, show, level); + } + fputs_filtered ("}", stream); + } + break; + case TYPE_CODE_VOID: + fputs_filtered ("void", stream); + break; + case TYPE_CODE_TYPEDEF: + if (streq (TYPE_NAME(type), "gboolean")) + { + fputs_filtered ("bool", stream); + } + else if (TYPE_NAME(type)[0] == 'g') + { + /* this should cover most glib types */ + fputs_filtered (TYPE_NAME(type)+1, stream); + fputs_filtered (varstring, stream); + } + else + { + vala_print_type(TYPE_TARGET_TYPE (type), + varstring, stream, show, level); + } + break; + case TYPE_CODE_FUNC: + vala_print_type (TYPE_TARGET_TYPE(type), "", stream, show, level); + fputs_filtered (" (", stream); + for (offset = 0; offset < TYPE_NFIELDS(type); ++offset) + { + vala_print_type (TYPE_FIELDS(type)[offset].type, + TYPE_FIELDS(type)[offset].name, + stream, show-1, 0); + } + fputs_filtered (");", stream); + break; + default : + /* use c_print_type as a fallback */ + c_print_type (type, varstring, stream, show, level); + } + if (varstring != NULL && *varstring != '\0') + { + fputs_filtered (" ", stream); + fputs_filtered (varstring, stream); + fputs_filtered (";\n", stream); + } +} + +/*static int +vala_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, + CORE_ADDR address, struct ui_file *stream, int format, + int deref_ref, int recurse, enum val_prettyprint pretty) +{ + return 0; +} + +static int +vala_value_print (struct value *val, struct ui_file *stream, int format, + enum val_prettyprint pretty) +{ + return 0; + }*/ + +const struct language_defn vala_language_defn = { + "vala", /* Language name */ + language_vala, + range_check_off, + type_check_off, + case_sensitive_on, + array_row_major, + &exp_descriptor_standard, + java_parse, + java_error, + null_post_parser, + c_printchar, /* Print a character constant */ + c_printstr, /* Function to print string constant */ + c_emit_char, /* Function to print a single character */ + vala_print_type, /* Print a type using appropriate syntax */ + c_val_print, /* Print a value using appropriate syntax */ + c_value_print, /* Print a top-level value */ + vala_skip_trampoline, /* Language specific skip_trampoline */ + vala_value_of_this, /* value_of_this */ + basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ + vala_lookup_transparent_type, /* lookup_transparent_type */ + vala_demangle, /* Language specific symbol demangler */ + vala_class_name_from_physname,/* Language specific class name */ + c_op_print_tab, /* expression operators for printing */ + 1, /* c-style arrays */ + 0, /* String lower bound */ + default_word_break_characters, + default_make_symbol_completion_list, + c_language_arch_info, + default_print_array_index, + default_pass_by_reference, + LANG_MAGIC +}; + +void +_initialize_vala_language (void) +{ + add_language (&vala_language_defn); +} diff -uprN -x '*~' gdb-6.8/gdb/vala-lang.h gdb-6.8-vala/gdb/vala-lang.h --- gdb-6.8/gdb/vala-lang.h 1970-01-01 00:00:00.000000000 +0000 +++ gdb-6.8-vala/gdb/vala-lang.h 2008-08-11 13:06:39.000000000 +0100 @@ -0,0 +1,23 @@ + + +extern struct field* vala_type_get_fields (struct type* type, int* nfields); +extern struct field* vala_type_get_private_fields (struct type* type, int* nfields); + +extern char* vala_member_name (const char*, const char*); +extern char* vala_demangle (const char *, int); +extern struct value* vala_search_method (char *, struct value **, struct value **, + int, int *, struct type *); +extern struct value* vala_value_field (struct value *arg1, int fieldno, int private); + +struct type* vala_lookup_transparent_type (const char* name); + +#define VALA_TYPE_NAME(type) ((TYPE_TAG_NAME (type) != NULL && \ + TYPE_TAG_NAME (type)[0] == '_') ? \ + TYPE_TAG_NAME (type) + 1 : TYPE_TAG_NAME (type)) + +#define VALA_TYPE_IS_CLASS(type) (TYPE_FIELDS (type) != NULL && \ + (strcmp (TYPE_FIELD(type, 0).name, "parent_instance") == 0 \ + || strcmp (TYPE_FIELD(type, 0).name, "g_type_instance") == 0)) +#define VALA_TYPE_BASE_CLASS(class) (TYPE_FIELDS (class)[0].type) +#define VALA_TYPE_HAS_PRIV(type) (TYPE_NFIELDS (type) >= 2 && \ + strcmp (TYPE_FIELD(type,1).name, "priv") == 0) diff -uprN -x '*~' gdb-6.8/gdb/valops.c gdb-6.8-vala/gdb/valops.c --- gdb-6.8/gdb/valops.c 2008-02-04 01:23:04.000000000 +0100 +++ gdb-6.8-vala/gdb/valops.c 2008-08-11 13:06:39.000000000 +0100 @@ -36,6 +36,7 @@ #include "infcall.h" #include "dictionary.h" #include "cp-support.h" +#include "vala-lang.h" #include "dfp.h" #include @@ -1468,6 +1469,13 @@ search_struct_method (char *name, struct } } + if (current_language->la_language == language_vala) + { + v = vala_search_method (name, arg1p, args, offset, static_memfuncp, type); + if (v != NULL) + return v; + } + for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { int base_offset;