From c0201579c8cd0c319fa851c98b0adf21ac013489 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 22 Apr 2010 23:15:43 +0000 Subject: 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) : New comment. * symtab.c (lookup_objfile_from_block): Remove the static qualifier. * symtab.h (lookup_objfile_from_block): New declaration. (struct general_symbol_info) : 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. --- gdb/solist.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gdb/solist.h') diff --git a/gdb/solist.h b/gdb/solist.h index 77eb2ae..bcba0ad 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -63,7 +63,12 @@ struct so_list bfd *abfd; char symbols_loaded; /* flag: symbols read in yet? */ - struct objfile *objfile; /* objfile for loaded lib */ + + /* objfile with symbols for a loaded library. Target memory is read from + ABFD. OBJFILE may be NULL either before symbols have been loaded, if + the file cannot be found or after the command "nosharedlibrary". */ + struct objfile *objfile; + struct target_section *sections; struct target_section *sections_end; -- cgit v1.1