[bug #28940] Multible breakpoints on the same address

Dancie Reeves <[email protected]> Sat, 20 Feb 2010 12:19:11 +0000
Newsgroups gmane.comp.debugging.ddd.bugs
Message-ID <[email protected]>
URL:
  <http://savannah.gnu.org/bugs/?28940>

                 Summary: Multible breakpoints on the same address
                 Project: DDD
            Submitted by: dancie
            Submitted on: Sat 20 Feb 2010 12:19:10 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None

    _______________________________________________________

Details:

Ever since I have worked with ddd if you saved a session with one breakpoint
the next time you open the session there would appear many breakpoints on the
same address, sometimes ddd would run out of glymps (red dots). This is an
annoying bug. I have written a kludge to remove the extras on startup but as
yet cannot find in the code where the breakpoints are loaded or saved to the
init file. Here is the kludge. about line 4200 in SourceView.C. Can anyone
give me a hint where the breakpoints are installed on the startup of a
session.

	else
	{
	    // New breakpoint
		changed = true;
		BreakPoint *new_bp = 
		new BreakPoint(info_output, break_arg, bp_nr, file);
		bool isDouble = false;
		if(bp_nr > 1)
		{
			for(int bno = 1; bno <= max_breakpoint_number_seen;bno++)
			{
				BreakPoint *bp = bp_map.get(bno);
				if(bp != NULL)
				{
					if((new_bp->line_nr() == bp->line_nr()) && 
						(new_bp->type() == bp->type()))
					{
						isDouble = true;
						break;
					}
				}
			}
		}
		if(!isDouble)
		{
			bp_map.insert(bp_nr, new_bp);
			if (gdb->has_delete_command())
			{
				const string num = "@" + itostring(bp_nr) + "@";
				undo_commands << gdb->delete_command(num) << '\n';
			}
			else
			{
				undo_commands << delete_command(bp_nr) << '\n';
			}
			if (!added)
			{
				added = true;
				// Select this breakpoint only
				MapRef ref;
				for(BreakPoint* bp = bp_map.first(ref);
				bp != 0;
				bp = bp_map.next(ref))
				{
					bp->selected() = false;
				}
			}
			new_bp->selected() = true;
		}
		else
		{
			delete_bp(bp_nr);
			bp_nr = 0;
		}
	}
	max_breakpoint_number_seen = max(max_breakpoint_number_seen, bp_nr);
	}





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?28940>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/