aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2007-09-17 14:53:05 +0000
committerJerome Guitton <guitton@adacore.com>2007-09-17 14:53:05 +0000
commiteff4f95e29ab873b801945b3e6478089b0c1a934 (patch)
tree4216e6b1916c976b48abe8df499e9db4d627f459
parent916af0488c5c7f741cf92deb73451d3072b4e64e (diff)
downloadgdb-eff4f95e29ab873b801945b3e6478089b0c1a934.zip
gdb-eff4f95e29ab873b801945b3e6478089b0c1a934.tar.gz
gdb-eff4f95e29ab873b801945b3e6478089b0c1a934.tar.bz2
* dwarf2loc.c (dwarf_expr_frame_base): Guard against NULL.
* Makefile.in (dwarf2loc.o): Depend on gdb_assert.h.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/Makefile.in2
-rw-r--r--gdb/dwarf2loc.c6
3 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c70570d..e481858 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-17 Jerome Guitton <guitton@adacore.com>
+
+ * dwarf2loc.c (dwarf_expr_frame_base): Guard against NULL.
+ * Makefile.in (dwarf2loc.o): Depend on gdb_assert.h.
+
2007-09-16 Vladimir Prus <vladimir@codesourcery.com>
* mi/mi-cmds.c (mi_cmds): Register -list-features.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index c740831..65fc5b2 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1963,7 +1963,7 @@ dwarf2-frame.o: dwarf2-frame.c $(defs_h) $(dwarf2expr_h) $(elf_dwarf2_h) \
dwarf2loc.o: dwarf2loc.c $(defs_h) $(ui_out_h) $(value_h) $(frame_h) \
$(gdbcore_h) $(target_h) $(inferior_h) $(ax_h) $(ax_gdb_h) \
$(regcache_h) $(objfiles_h) $(exceptions_h) $(elf_dwarf2_h) \
- $(dwarf2expr_h) $(dwarf2loc_h) $(gdb_string_h)
+ $(dwarf2expr_h) $(dwarf2loc_h) $(gdb_string_h) $(gdb_assert_h)
dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \
$(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) $(demangle_h) \
$(expression_h) $(filenames_h) $(macrotab_h) $(language_h) \
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 81b2f87..76d7f6e 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -37,6 +37,7 @@
#include "dwarf2loc.h"
#include "gdb_string.h"
+#include "gdb_assert.h"
/* A helper function for dealing with location lists. Given a
symbol baton (BATON) and a pc value (PC), find the appropriate
@@ -145,6 +146,11 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length)
framefunc = get_frame_function (debaton->frame);
+ /* If we found a frame-relative symbol then it was certainly within
+ some function associated with a frame. If we can't find the frame,
+ something has gone wrong. */
+ gdb_assert (framefunc != NULL);
+
if (SYMBOL_OPS (framefunc) == &dwarf2_loclist_funcs)
{
struct dwarf2_loclist_baton *symbaton;