Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain
       [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
@ 2019-10-15  3:31 ` Simon Marchi (Code Review)
  2019-10-15  8:43 ` Christian Biesinger (Code Review)
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi (Code Review) @ 2019-10-15  3:31 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22/2/gdb/tui/tui-winsource.c 
File gdb/tui/tui-winsource.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22/2/gdb/tui/tui-winsource.c@447 
PS2, Line 447:       return false;
Did you really want to introduce this `return false`?



-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings


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

* Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain
       [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
                   ` (4 preceding siblings ...)
  2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
@ 2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
  5 siblings, 0 replies; 6+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-10-15 13:31 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches; +Cc: Simon Marchi

Sourceware to Gerrit sync has submitted this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
......................................................................

Make tui-winsource not use breakpoint_chain

That's an internal variable of breakpoint.c. Insted, use
iterate_over_breakpoints to update the breakpoint list.

gdb/ChangeLog:

2019-10-15  Christian Biesinger  <cbiesinger@google.com>

	* breakpoint.c (breakpoint_chain): Make static.
	* tui/tui-winsource.c: Call iterate_over_breakpoints instead
	of accessing breakpoint_chain.

Change-Id: Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429
---
M gdb/ChangeLog
M gdb/breakpoint.c
M gdb/tui/tui-winsource.c
3 files changed, 11 insertions(+), 8 deletions(-)


diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 39a8374..9d3ec1f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-10-15  Christian Biesinger  <cbiesinger@google.com>
 
+	* breakpoint.c (breakpoint_chain): Make static.
+	* tui/tui-winsource.c: Call iterate_over_breakpoints instead
+	of accessing breakpoint_chain.
+
+2019-10-15  Christian Biesinger  <cbiesinger@google.com>
+
 	* breakpoint.c (iterate_over_breakpoints): Change function pointer
 	to a gdb::function_view and return value to bool.
 	* breakpoint.h (iterate_over_breakpoints): Likewise.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9bbb28f..2fd2438 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -517,7 +517,7 @@
 
 /* Chains of all breakpoints defined.  */
 
-struct breakpoint *breakpoint_chain;
+static struct breakpoint *breakpoint_chain;
 
 /* Array is sorted by bp_locations_compare - primarily by the ADDRESS.  */
 
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index f1c9f95..3fbc49f 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -401,8 +401,6 @@
 
   for (i = 0; i < content.size (); i++)
     {
-      struct breakpoint *bp;
-      extern struct breakpoint *breakpoint_chain;
       struct tui_source_element *line;
 
       line = &content[i];
@@ -413,9 +411,7 @@
          do with it.  Identify enable/disabled breakpoints as well as
          those that we already hit.  */
       tui_bp_flags mode = 0;
-      for (bp = breakpoint_chain;
-           bp != NULL;
-           bp = bp->next)
+      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
         {
 	  struct bp_location *loc;
 
@@ -423,7 +419,7 @@
 		      || line->line_or_addr.loa == LOA_ADDRESS);
 
 	  if (bp == being_deleted)
-	    continue;
+	    return false;
 
 	  for (loc = bp->loc; loc != NULL; loc = loc->next)
 	    {
@@ -441,7 +437,8 @@
 		    mode |= TUI_BP_HARDWARE;
 		}
 	    }
-        }
+	  return false;
+        });
       if (line->break_mode != mode)
         {
           line->break_mode = mode;

-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings


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

* Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain
       [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
                   ` (3 preceding siblings ...)
  2019-10-15 12:26 ` Simon Marchi (Code Review)
@ 2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
  2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
  5 siblings, 0 replies; 6+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-10-15 13:31 UTC (permalink / raw)
  To: Christian Biesinger, Simon Marchi, gdb-patches

Sourceware to Gerrit sync has uploaded a new patch set version (#4) to the change originally created by Christian Biesinger.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
......................................................................

Make tui-winsource not use breakpoint_chain

That's an internal variable of breakpoint.c. Insted, use
iterate_over_breakpoints to update the breakpoint list.

gdb/ChangeLog:

2019-10-15  Christian Biesinger  <cbiesinger@google.com>

	* breakpoint.c (breakpoint_chain): Make static.
	* tui/tui-winsource.c: Call iterate_over_breakpoints instead
	of accessing breakpoint_chain.

Change-Id: Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429
---
M gdb/ChangeLog
M gdb/breakpoint.c
M gdb/tui/tui-winsource.c
3 files changed, 11 insertions(+), 8 deletions(-)



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 39a8374..9d3ec1f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-10-15  Christian Biesinger  <cbiesinger@google.com>
 
+	* breakpoint.c (breakpoint_chain): Make static.
+	* tui/tui-winsource.c: Call iterate_over_breakpoints instead
+	of accessing breakpoint_chain.
+
+2019-10-15  Christian Biesinger  <cbiesinger@google.com>
+
 	* breakpoint.c (iterate_over_breakpoints): Change function pointer
 	to a gdb::function_view and return value to bool.
 	* breakpoint.h (iterate_over_breakpoints): Likewise.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9bbb28f..2fd2438 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -517,7 +517,7 @@
 
 /* Chains of all breakpoints defined.  */
 
-struct breakpoint *breakpoint_chain;
+static struct breakpoint *breakpoint_chain;
 
 /* Array is sorted by bp_locations_compare - primarily by the ADDRESS.  */
 
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index f1c9f95..3fbc49f 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -401,8 +401,6 @@
 
   for (i = 0; i < content.size (); i++)
     {
-      struct breakpoint *bp;
-      extern struct breakpoint *breakpoint_chain;
       struct tui_source_element *line;
 
       line = &content[i];
@@ -413,9 +411,7 @@
          do with it.  Identify enable/disabled breakpoints as well as
          those that we already hit.  */
       tui_bp_flags mode = 0;
-      for (bp = breakpoint_chain;
-           bp != NULL;
-           bp = bp->next)
+      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
         {
 	  struct bp_location *loc;
 
@@ -423,7 +419,7 @@
 		      || line->line_or_addr.loa == LOA_ADDRESS);
 
 	  if (bp == being_deleted)
-	    continue;
+	    return false;
 
 	  for (loc = bp->loc; loc != NULL; loc = loc->next)
 	    {
@@ -441,7 +437,8 @@
 		    mode |= TUI_BP_HARDWARE;
 		}
 	    }
-        }
+	  return false;
+        });
       if (line->break_mode != mode)
         {
           line->break_mode = mode;

-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings


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

* Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain
       [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
                   ` (2 preceding siblings ...)
  2019-10-15  8:43 ` Christian Biesinger (Code Review)
@ 2019-10-15 12:26 ` Simon Marchi (Code Review)
  2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
  2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
  5 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi (Code Review) @ 2019-10-15 12:26 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
......................................................................


Patch Set 3: Code-Review+2

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22/2/gdb/tui/tui-winsource.c 
File gdb/tui/tui-winsource.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22/2/gdb/tui/tui-winsource.c@447 
PS2, Line 447:       return false;
> Ah, no, that was a mistake. Fixed.
Done



-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings


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

* Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain
       [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
  2019-10-15  3:31 ` Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain Simon Marchi (Code Review)
  2019-10-15  8:43 ` Christian Biesinger (Code Review)
@ 2019-10-15  8:43 ` Christian Biesinger (Code Review)
  2019-10-15 12:26 ` Simon Marchi (Code Review)
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Christian Biesinger (Code Review) @ 2019-10-15  8:43 UTC (permalink / raw)
  To: Christian Biesinger, gdb-patches; +Cc: Simon Marchi

Christian Biesinger has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
......................................................................


Uploaded patch set 3.

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22/2/gdb/tui/tui-winsource.c 
File gdb/tui/tui-winsource.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22/2/gdb/tui/tui-winsource.c@447 
PS2, Line 447:       return false;
> Did you really want to introduce this `return false`?
Ah, no, that was a mistake. Fixed.



-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings


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

* Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain
       [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
  2019-10-15  3:31 ` Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain Simon Marchi (Code Review)
@ 2019-10-15  8:43 ` Christian Biesinger (Code Review)
  2019-10-15  8:43 ` Christian Biesinger (Code Review)
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Christian Biesinger (Code Review) @ 2019-10-15  8:43 UTC (permalink / raw)
  To: Christian Biesinger, Simon Marchi, gdb-patches

Christian Biesinger has uploaded a new patch set version (#3).

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
......................................................................

Make tui-winsource not use breakpoint_chain

That's an internal variable of breakpoint.c. Insted, use
iterate_over_breakpoints to update the breakpoint list.

gdb/ChangeLog:

2019-10-09  Christian Biesinger  <cbiesinger@google.com>

	* breakpoint.c (breakpoint_chain): Make static.
	* tui/tui-winsource.c: Call iterate_over_breakpoints instead
	of accessing breakpoint_chain.

Change-Id: Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429
---
M gdb/breakpoint.c
M gdb/tui/tui-winsource.c
2 files changed, 5 insertions(+), 8 deletions(-)



diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9bbb28f..2fd2438 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -517,7 +517,7 @@
 
 /* Chains of all breakpoints defined.  */
 
-struct breakpoint *breakpoint_chain;
+static struct breakpoint *breakpoint_chain;
 
 /* Array is sorted by bp_locations_compare - primarily by the ADDRESS.  */
 
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index f1c9f95..3fbc49f 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -401,8 +401,6 @@
 
   for (i = 0; i < content.size (); i++)
     {
-      struct breakpoint *bp;
-      extern struct breakpoint *breakpoint_chain;
       struct tui_source_element *line;
 
       line = &content[i];
@@ -413,9 +411,7 @@
          do with it.  Identify enable/disabled breakpoints as well as
          those that we already hit.  */
       tui_bp_flags mode = 0;
-      for (bp = breakpoint_chain;
-           bp != NULL;
-           bp = bp->next)
+      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
         {
 	  struct bp_location *loc;
 
@@ -423,7 +419,7 @@
 		      || line->line_or_addr.loa == LOA_ADDRESS);
 
 	  if (bp == being_deleted)
-	    continue;
+	    return false;
 
 	  for (loc = bp->loc; loc != NULL; loc = loc->next)
 	    {
@@ -441,7 +437,8 @@
 		    mode |= TUI_BP_HARDWARE;
 		}
 	    }
-        }
+	  return false;
+        });
       if (line->break_mode != mode)
         {
           line->break_mode = mode;

-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/22
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings


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

end of thread, other threads:[~2019-10-15 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gerrit.1570928756000.Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429@gnutoolchain-gerrit.osci.io>
2019-10-15  3:31 ` Change in binutils-gdb[master]: Make tui-winsource not use breakpoint_chain Simon Marchi (Code Review)
2019-10-15  8:43 ` Christian Biesinger (Code Review)
2019-10-15  8:43 ` Christian Biesinger (Code Review)
2019-10-15 12:26 ` Simon Marchi (Code Review)
2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)
2019-10-15 13:31 ` Sourceware to Gerrit sync (Code Review)

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