aboutsummaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-04-22 23:15:43 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-04-22 23:15:43 +0000
commitc0201579c8cd0c319fa851c98b0adf21ac013489 (patch)
tree16da9856639cf50456ca57f90fa738059ead5304 /gdb/parser-defs.h
parent793b0ff8d7126cf5ec1631fc07ffec5b5664b226 (diff)
downloadgdb-c0201579c8cd0c319fa851c98b0adf21ac013489.zip
gdb-c0201579c8cd0c319fa851c98b0adf21ac013489.tar.gz
gdb-c0201579c8cd0c319fa851c98b0adf21ac013489.tar.bz2
gdb/
Fix crashes on dangling display expressions. * ada-lang.c (ada_operator_check): New function. (ada_exp_descriptor): Fill-in the field operator_check. * c-lang.c (exp_descriptor_c): Fill-in the field operator_check. * jv-lang.c (exp_descriptor_java): Likewise. * m2-lang.c (exp_descriptor_modula2): Likewise. * scm-lang.c (exp_descriptor_scm): Likewise. * parse.c (exp_descriptor_standard): Likewise. (operator_check_standard): New function. (exp_iterate, exp_uses_objfile_iter, exp_uses_objfile): New functions. * parser-defs.h (struct exp_descriptor): New field operator_check. (operator_check_standard, exp_uses_objfile): New declarations. * printcmd.c: Remove the inclusion of solib.h. (display_uses_solib_p): Remove the function. (clear_dangling_display_expressions): Call lookup_objfile_from_block and exp_uses_objfile instead of display_uses_solib_p. * solist.h (struct so_list) <objfile>: New comment. * symtab.c (lookup_objfile_from_block): Remove the static qualifier. * symtab.h (lookup_objfile_from_block): New declaration. (struct general_symbol_info) <obj_section>: Extend the comment. gdb/testsuite/ Fix crashes on dangling display expressions. * gdb.base/solib-display.exp: Call gdb_gnu_strip_debug if LIBSEPDEBUG is SEP. (lib_flags): Remove the "debug" keyword. (libsepdebug): New variable for iterating new loop. (save_pf_prefix): New variable wrapping the loop. (sep_lib_flags): New variable derived from LIB_FLAGS. Use it. * lib/gdb.exp (gdb_gnu_strip_debug): Document the return code.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r--gdb/parser-defs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index c4eb1a0..a37bbca 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -192,6 +192,11 @@ extern void operator_length (struct expression *, int, int *, int *);
extern void operator_length_standard (struct expression *, int, int *, int *);
+extern int operator_check_standard (struct expression *exp, int pos,
+ int (*objfile_func)
+ (struct objfile *objfile, void *data),
+ void *data);
+
extern char *op_name_standard (enum exp_opcode);
extern struct type *follow_types (struct type *);
@@ -270,6 +275,19 @@ struct exp_descriptor
the number of subexpressions it takes. */
void (*operator_length) (struct expression*, int, int*, int *);
+ /* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being
+ referenced by the single operator of EXP at position POS. Operator
+ parameters are located at positive (POS + number) offsets in EXP.
+ The functions should never be called with NULL TYPE or NULL OBJFILE.
+ Functions should get passed an arbitrary caller supplied DATA pointer.
+ If any of the functions returns non-zero value then (any other) non-zero
+ value should be immediately returned to the caller. Otherwise zero
+ should be returned. */
+ int (*operator_check) (struct expression *exp, int pos,
+ int (*objfile_func) (struct objfile *objfile,
+ void *data),
+ void *data);
+
/* Name of this operator for dumping purposes. */
char *(*op_name) (enum exp_opcode);
@@ -302,4 +320,6 @@ extern void print_subexp_standard (struct expression *, int *,
extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3);
+extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
+
#endif /* PARSER_DEFS_H */