Fix bug in 'say_where' transform
authorTom Tromey <tom@tromey.com>
Tue, 10 Jan 2023 23:35:08 +0000 (16:35 -0700)
committerTom Tromey <tom@tromey.com>
Tue, 10 Jan 2023 23:36:48 +0000 (16:36 -0700)
The patch to change say_where into a method introduced a bug.  This
patch fixes it.

gdb/breakpoint.c

index 6762fad5d2c74f4a49fc0e3a5a4fcc24579ac138..00cc2ab401c8de1e58afcd8d4b6cc1c6d034f05f 100644 (file)
@@ -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);
        }