Index: gdb/language.h |
diff --git a/gdb/language.h b/gdb/language.h |
index 1ebae167bdb57efd0d7257a93d78ebd117f17182..38c48305c2dbe962973b773ffb47ac82119f1234 100644 |
--- a/gdb/language.h |
+++ b/gdb/language.h |
@@ -136,6 +136,16 @@ struct language_arch_info |
struct type *bool_type_default; |
}; |
+/* A pointer to a function expected to return nonzero if |
+ SYMBOL_SEARCH_NAME matches the given LOOKUP_NAME. |
+ |
+ SYMBOL_SEARCH_NAME should be a symbol's "search" name. |
+ LOOKUP_NAME should be the name of an entity after it has been |
+ transformed for lookup. */ |
+ |
+typedef int (*symbol_name_cmp_ftype) (const char *symbol_search_name, |
+ const char *lookup_name); |
+ |
/* Structure tying together assorted information about a language. */ |
struct language_defn |
@@ -230,17 +240,26 @@ struct language_defn |
OPTIONS are the formatting options to be used when |
printing. */ |
- int (*la_val_print) (struct type *type, |
- const gdb_byte *contents, |
- int embedded_offset, CORE_ADDR address, |
- struct ui_file *stream, int recurse, |
- const struct value *val, |
- const struct value_print_options *options); |
+ void (*la_val_print) (struct type *type, |
+ const gdb_byte *contents, |
+ int embedded_offset, CORE_ADDR address, |
+ struct ui_file *stream, int recurse, |
+ const struct value *val, |
+ const struct value_print_options *options); |
/* Print a top-level value using syntax appropriate for this language. */ |
- int (*la_value_print) (struct value *, struct ui_file *, |
- const struct value_print_options *); |
+ void (*la_value_print) (struct value *, struct ui_file *, |
+ const struct value_print_options *); |
+ |
+ /* Given a symbol VAR, and a stack frame id FRAME, read the value |
+ of the variable an return (pointer to a) struct value containing |
+ the value. |
+ |
+ Throw an error if the variable cannot be found. */ |
+ |
+ struct value *(*la_read_var_value) (struct symbol *var, |
+ struct frame_info *frame); |
/* PC is possibly an unknown languages trampoline. |
If that PC falls in a trampoline belonging to this language, |
@@ -287,10 +306,10 @@ struct language_defn |
/* The list of characters forming word boundaries. */ |
char *(*la_word_break_characters) (void); |
- /* Should return a NULL terminated array of all symbols which |
- are possible completions for TEXT. WORD is the entire command |
- on which the completion is being made. */ |
- char **(*la_make_symbol_completion_list) (char *text, char *word); |
+ /* Should return a vector of all symbols which are possible |
+ completions for TEXT. WORD is the entire command on which the |
+ completion is being made. */ |
+ VEC (char_ptr) *(*la_make_symbol_completion_list) (char *text, char *word); |
/* The per-architecture (OS/ABI) language information. */ |
void (*la_language_arch_info) (struct gdbarch *, |
@@ -318,19 +337,13 @@ struct language_defn |
void (*la_get_string) (struct value *value, gdb_byte **buffer, int *length, |
struct type **chartype, const char **charset); |
- /* Compare two symbol names according to language rules. For |
- instance, in C++, we might want to ignore whitespaces in |
- the symbol name. Or some case-insensitive language might |
- want to ignore casing during the match. |
- |
- Both STR1 and STR2 are expected to be demangled name, except |
- for Ada, where STR1 and STR2 are expected to be encoded names. |
- The latter is because searches are performed using the encoded |
- name in Ada. |
+ /* Return a pointer to the function that should be used to match |
+ a symbol name against LOOKUP_NAME. This is mostly for languages |
+ such as Ada where the matching algorithm depends on LOOKUP_NAME. |
- The return value follows the same spirit as strcmp. */ |
- |
- int (*la_symbol_name_compare) (const char *str1, const char *str2); |
+ This field may be NULL, in which case strcmp_iw will be used |
+ to perform the matching. */ |
+ symbol_name_cmp_ftype (*la_get_symbol_name_cmp) (const char *lookup_name); |
/* Find all symbols in the current program space matching NAME in |
DOMAIN, according to this language's rules. |
@@ -343,13 +356,13 @@ struct language_defn |
argument. If CALLBACK returns zero, the iteration ends at that |
point. |
- This field can be NULL, meaning that this language doesn't need |
- any special code aside from ordinary searches of the symbol |
- table. */ |
+ This field may not be NULL. If the language does not need any |
+ special processing here, 'iterate_over_symbols' should be |
+ used as the definition. */ |
void (*la_iterate_over_symbols) (const struct block *block, |
const char *name, |
domain_enum domain, |
- int (*callback) (struct symbol *, void *), |
+ symbol_found_callback_ftype *callback, |
void *data); |
/* Add fields above this point, so the magic number is always last. */ |
@@ -473,26 +486,8 @@ extern enum language set_language (enum language); |
/* Type predicates */ |
-extern int simple_type (struct type *); |
- |
-extern int ordered_type (struct type *); |
- |
-extern int same_type (struct type *, struct type *); |
- |
-extern int integral_type (struct type *); |
- |
-extern int numeric_type (struct type *); |
- |
-extern int character_type (struct type *); |
- |
-extern int boolean_type (struct type *); |
- |
-extern int float_type (struct type *); |
- |
extern int pointer_type (struct type *); |
-extern int structured_type (struct type *); |
- |
/* Checks Binary and Unary operations for semantic type correctness. */ |
/* FIXME: Does not appear to be used. */ |
#define unop_type_check(v,o) binop_type_check((v),NULL,(o)) |