comparison src/debug.h @ 9183:94ae487acd1b

use set instead of map to keep track of debugger breakpoints
author jpswensen@compsci34-754-2010.compscidhcp.jhu.edu
date Tue, 05 May 2009 15:10:25 -0400
parents eb63fbe60fab
children 3c1762c7e787
comparison
equal deleted inserted replaced
9182:23af5910e5f5 9183:94ae487acd1b
22 22
23 #if !defined (octave_debug_h) 23 #if !defined (octave_debug_h)
24 #define octave_debug_h 1 24 #define octave_debug_h 1
25 25
26 #include <map> 26 #include <map>
27 #include <set>
27 #include "ov.h" 28 #include "ov.h"
28 #include "dRowVector.h" 29 #include "dRowVector.h"
29 30
30 class octave_value_list; 31 class octave_value_list;
31 class octave_user_code; 32 class octave_user_code;
114 return instance_ok () ? instance->do_have_breakpoints () : 0; 115 return instance_ok () ? instance->do_have_breakpoints () : 0;
115 } 116 }
116 117
117 private: 118 private:
118 119
119 // Map from function names to function objects for functions 120 typedef std::set<std::string>::const_iterator const_bp_set_iterator;
120 // containing at least one breakpoint. 121 typedef std::set<std::string>::iterator bp_set_iterator;
121 typedef std::map<std::string, octave_user_code *> breakpoint_map;
122 122
123 typedef breakpoint_map::const_iterator const_breakpoint_map_iterator; 123 // Set of function names containing at least one breakpoint.
124 typedef breakpoint_map::iterator breakpoint_map_iterator; 124 std::set<std::string> bp_set;
125
126 breakpoint_map bp_map;
127 125
128 static bp_table *instance; 126 static bp_table *instance;
129 127
130 intmap do_add_breakpoint (const std::string& fname, const intmap& lines); 128 intmap do_add_breakpoint (const std::string& fname, const intmap& lines);
131 129
136 134
137 void do_remove_all_breakpoints (void); 135 void do_remove_all_breakpoints (void);
138 136
139 fname_line_map do_get_breakpoint_list (const octave_value_list& fname_list); 137 fname_line_map do_get_breakpoint_list (const octave_value_list& fname_list);
140 138
141 bool do_have_breakpoints (void) { return (! bp_map.empty ()); } 139 bool do_have_breakpoints (void) { return (! bp_set.empty ()); }
142 }; 140 };
143 141
144 std::string get_file_line (const std::string& fname, size_t line); 142 std::string get_file_line (const std::string& fname, size_t line);
145 143
146 #endif 144 #endif