public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH/gdbtk] Fix crash when running insight with pending breakpoints
@ 2012-04-19  9:45 Roland Schwingel
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Schwingel @ 2012-04-19  9:45 UTC (permalink / raw)
  To: insight

Hi ...

 > > 2012-04-11 Roland Schwingel <roland.schwingel@onevision.com>
 > >
 > > * generic/gdbtk-bp.c: Updated copyright.
 > > (gdb_find_bp_at_line): Don't access location struct
 > > of breakpoint if it is NULL.
 > >
 > > Any comments? Is this ok?
 >
 > Yes, please commit.
Done now.

 > Thank you for the patch!
Thanks for reviewing.

Roland

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH/gdbtk] Fix crash when running insight with pending breakpoints
  2012-04-11 12:28 Roland Schwingel
@ 2012-04-19  0:12 ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2012-04-19  0:12 UTC (permalink / raw)
  To: Roland Schwingel; +Cc: insight

On 04/11/2012 05:28 AM, Roland Schwingel wrote:
> Changelog:
>
> 2012-04-11 Roland Schwingel <roland.schwingel@onevision.com>
>
> * generic/gdbtk-bp.c: Updated copyright.
> (gdb_find_bp_at_line): Don't access location struct
> of breakpoint if it is NULL.
>
> Any comments? Is this ok?

Yes, please commit.

Thank you for the patch!

Keith

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH/gdbtk] Fix crash when running insight with pending breakpoints
@ 2012-04-11 12:28 Roland Schwingel
  2012-04-19  0:12 ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Schwingel @ 2012-04-11 12:28 UTC (permalink / raw)
  To: insight

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

Hi...

When I set breakpoints in insight it remembers it after restart. If the 
breakpoint is in a shared library (dll) it is created as pending 
breakpoint after restart. But when I restart insight it is crashing as 
soon as I click the "Run" button top left in the source window.

This is reasoned by the fact that pending breakpoint has a NULL location 
pointer, but the location is dereferenced by.

The attached simple patch fixes this.

Changelog:

2012-04-11  Roland Schwingel  <roland.schwingel@onevision.com>

	* generic/gdbtk-bp.c: Updated copyright.
	(gdb_find_bp_at_line): Don't access location struct
	of breakpoint if it is NULL.

Any comments? Is this ok?

Roland

[-- Attachment #2: pending_bp_crash.patch --]
[-- Type: text/plain, Size: 792 bytes --]

diff -ruNp gdbtk_orig/generic/gdbtk-bp.c gdbtk/generic/gdbtk-bp.c
--- gdbtk_orig/generic/gdbtk-bp.c	2012-03-20 15:17:33.000000000 +0100
+++ gdbtk/generic/gdbtk-bp.c	2012-04-11 14:02:19.285142700 +0200
@@ -1,6 +1,5 @@
 /* Tcl/Tk command definitions for Insight - Breakpoints.
-   Copyright (C) 2001, 2002, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -254,7 +253,7 @@ gdb_find_bp_at_line (ClientData clientDa
   Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
   ALL_BREAKPOINTS (b)
   {
-    if (b->loc->line_number == line
+    if (b->loc && b->loc->line_number == line
 	&& !strcmp (b->loc->source_file, s->filename))
       {
 	Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-19  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  9:45 [PATCH/gdbtk] Fix crash when running insight with pending breakpoints Roland Schwingel
  -- strict thread matches above, loose matches on Subject: below --
2012-04-11 12:28 Roland Schwingel
2012-04-19  0:12 ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).