Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jerome Guitton <guitton@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] dwarf2loc, guard against null
Date: Mon, 17 Sep 2007 13:42:00 -0000	[thread overview]
Message-ID: <20070917134246.GA93930@adacore.com> (raw)
In-Reply-To: <20070917131951.GA13182@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Daniel Jacobowitz (drow@false.org):

> Yes, that's probably it.  If you stay connected to the target after
> mourning, you may want to look at the new target_mark_exited.  I
> haven't had time to contribute the target extended-remote bits that
> go along with that yet but soon, soon...

OK, thanks for your help.


> Assertion, please.  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.

OK, makes sense. I will commit the patch in attachment.

2007-09-17  Jerome Guitton  <guitton@adacore.com>

	* dwarf2loc.c (dwarf_expr_frame_base): Guard against NULL.
	Part of G917-008.
	* Makefile.in (dwarf2loc.o): Depend on gdb_assert.h.

[-- Attachment #2: dwarf2loc.c.diff --]
[-- Type: text/x-diff, Size: 1821 bytes --]

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.936
diff -u -p -r1.936 Makefile.in
--- gdb/Makefile.in	5 Sep 2007 00:14:02 -0000	1.936
+++ gdb/Makefile.in	17 Sep 2007 13:41:35 -0000
@@ -1963,7 +1963,7 @@ dwarf2-frame.o: dwarf2-frame.c $(defs_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) \
Index: gdb/dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.45
diff -u -p -r1.45 dwarf2loc.c
--- gdb/dwarf2loc.c	23 Aug 2007 18:08:28 -0000	1.45
+++ gdb/dwarf2loc.c	17 Sep 2007 13:41:36 -0000
@@ -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_
 
   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;

  reply	other threads:[~2007-09-17 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17 12:04 Jerome Guitton
2007-09-17 12:15 ` Daniel Jacobowitz
2007-09-17 12:27   ` Jerome Guitton
2007-09-17 12:30     ` Daniel Jacobowitz
2007-09-17 13:10       ` Jerome Guitton
2007-09-17 13:20         ` Daniel Jacobowitz
2007-09-17 13:42           ` Jerome Guitton [this message]
2007-09-17 13:52             ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070917134246.GA93930@adacore.com \
    --to=guitton@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox