[pushed] Fix bug in 'say_where' transform

Message ID 20230110233601.209503-1-tom@tromey.com
State Committed
Commit 066620dcfb9e3e4e68e2c20f60926cb2b016798c
Headers
Series [pushed] Fix bug in 'say_where' transform |

Commit Message

Tom Tromey Jan. 10, 2023, 11:36 p.m. UTC
  The patch to change say_where into a method introduced a bug.  This
patch fixes it.
---
 gdb/breakpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6762fad5d2c..00cc2ab401c 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11558,9 +11558,9 @@  code_breakpoint::say_where () const
 
       if (loc->next)
 	{
-	  struct bp_location *loc = loc;
+	  struct bp_location *iter = loc;
 	  int n = 0;
-	  for (; loc; loc = loc->next)
+	  for (; iter; iter = iter->next)
 	    ++n;
 	  gdb_printf (" (%d locations)", n);
 	}