changeset 32104:73720920057e stable

Fix restoring breakpoints from dbstatus breakpoint structure (bug #64271) * debug.cc (Fdbstop): Clear "lines" variable each time through loop to add breakpoints so that line numbers don't simply accumulate and aren't applied to the wrong file.
author Rik <rik@octave.org>
date Sat, 03 Jun 2023 20:28:33 -0700
parents 6cd803819bd2
children edbe81ee00c5 d617fca340fc
files libinterp/corefcn/debug.cc
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc	Mon May 22 16:20:51 2023 -0700
+++ b/libinterp/corefcn/debug.cc	Sat Jun 03 20:28:33 2023 -0700
@@ -236,6 +236,10 @@
           std::string unconditional = "";
           for (octave_idx_type i = 0; i < line.numel (); i++)
             {
+              // FIXME: This isn't very clear, but add_breakpoints_in_function
+              // requires this argument to be of type bp_table::bp_lines type
+              // which is std::set<int>.
+              lines.clear ();
               lines.insert (line(i).int_value ());
               bptab.add_breakpoints_in_function (name(i).string_value (),
                                                  "", lines,