Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch][branch] Fix "save breakpoints" for watchpoints
@ 2011-04-08 20:42 Thiago Jung Bauermann
  2011-04-12 11:04 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Thiago Jung Bauermann @ 2011-04-08 20:42 UTC (permalink / raw)
  To: gdb-patches ml

Hi,

When I converted watchpoints to use the breakpoint_ops struct, I
inadvertently broke saving watchpoints to a file, because
save_breakpoints doesn't check whether tp->ops->print_recreate is NULL
before calling it (as is customary before calling breakpoint_ops
methods). This results in a segfault since I didn't provide an
implementation for that method for watchpoints (save_breakpoints is
capable of dealing with watchpoints). This simple patch fixes the bug.

No regressions on i386-linux. Ok for HEAD and the branch?


[0] - http://sourceware.org/ml/gdb-patches/2011-01/msg00228.html
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


2011-04-08  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* breakpoint.c (save_breakpoints): Verify whether
	breakpoint_ops.print_recreate is defined before calling it.

Index: gdb.git/gdb/breakpoint.c
===================================================================
--- gdb.git.orig/gdb/breakpoint.c	2011-04-08 16:09:31.000000000 -0300
+++ gdb.git/gdb/breakpoint.c	2011-04-08 16:23:24.000000000 -0300
@@ -12337,7 +12337,7 @@ save_breakpoints (char *filename, int fr
     if (filter && !filter (tp))
       continue;
 
-    if (tp->ops != NULL)
+    if (tp->ops != NULL && tp->ops->print_recreate != NULL)
       (tp->ops->print_recreate) (tp, fp);
     else
       {



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

* Re: [patch][branch] Fix "save breakpoints" for watchpoints
  2011-04-08 20:42 [patch][branch] Fix "save breakpoints" for watchpoints Thiago Jung Bauermann
@ 2011-04-12 11:04 ` Pedro Alves
  2011-04-13 18:34   ` Thiago Jung Bauermann
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2011-04-12 11:04 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thiago Jung Bauermann

On Friday 08 April 2011 21:41:56, Thiago Jung Bauermann wrote:

> No regressions on i386-linux. Ok for HEAD and the branch?

Okay, thanks.

-- 
Pedro Alves


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

* Re: [patch][branch] Fix "save breakpoints" for watchpoints
  2011-04-12 11:04 ` Pedro Alves
@ 2011-04-13 18:34   ` Thiago Jung Bauermann
  2011-04-14 11:49     ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Thiago Jung Bauermann @ 2011-04-13 18:34 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Joel Brobecker

On Tue, 2011-04-12 at 12:04 +0100, Pedro Alves wrote:
> On Friday 08 April 2011 21:41:56, Thiago Jung Bauermann wrote:
> 
> > No regressions on i386-linux. Ok for HEAD and the branch?
> 
> Okay, thanks.

Thanks for the review. Committed to HEAD. I assume I should wait for
Joel's OK for the branch?
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


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

* Re: [patch][branch] Fix "save breakpoints" for watchpoints
  2011-04-13 18:34   ` Thiago Jung Bauermann
@ 2011-04-14 11:49     ` Joel Brobecker
  2011-04-15  4:19       ` Thiago Jung Bauermann
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2011-04-14 11:49 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: Pedro Alves, gdb-patches

> On Tue, 2011-04-12 at 12:04 +0100, Pedro Alves wrote:
> > On Friday 08 April 2011 21:41:56, Thiago Jung Bauermann wrote:
> > 
> > > No regressions on i386-linux. Ok for HEAD and the branch?
> > 
> > Okay, thanks.
> 
> Thanks for the review. Committed to HEAD. I assume I should wait for
> Joel's OK for the branch?

Global Maintainers who reviewed the patch are also able to
approve pushes to the branch, as I think they often know more
about the patch than I do. However, I looked at this one, and
it looks fine for the branch :).

-- 
Joel


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

* Re: [patch][branch] Fix "save breakpoints" for watchpoints
  2011-04-14 11:49     ` Joel Brobecker
@ 2011-04-15  4:19       ` Thiago Jung Bauermann
  0 siblings, 0 replies; 5+ messages in thread
From: Thiago Jung Bauermann @ 2011-04-15  4:19 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Pedro Alves, gdb-patches

On Thu, 2011-04-14 at 07:48 -0400, Joel Brobecker wrote:
> > On Tue, 2011-04-12 at 12:04 +0100, Pedro Alves wrote:
> > > On Friday 08 April 2011 21:41:56, Thiago Jung Bauermann wrote:
> > > 
> > > > No regressions on i386-linux. Ok for HEAD and the branch?
> > > 
> > > Okay, thanks.
> > 
> > Thanks for the review. Committed to HEAD. I assume I should wait for
> > Joel's OK for the branch?
> 
> Global Maintainers who reviewed the patch are also able to
> approve pushes to the branch, as I think they often know more
> about the patch than I do.

Nice. I was just afraid of reading more into the approval than what
Pedro meant. Thanks for the clarification.

> However, I looked at this one, and
> it looks fine for the branch :).

Thanks! Committed to the branch.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


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

end of thread, other threads:[~2011-04-15  4:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08 20:42 [patch][branch] Fix "save breakpoints" for watchpoints Thiago Jung Bauermann
2011-04-12 11:04 ` Pedro Alves
2011-04-13 18:34   ` Thiago Jung Bauermann
2011-04-14 11:49     ` Joel Brobecker
2011-04-15  4:19       ` Thiago Jung Bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox