Previous 199869 Revisions Next

r35175 Saturday 21st February, 2015 at 11:53:18 UTC by Vasantha Crabb
Make behaviour of breakpoint control a bit more consistent with other debugger implementations
[src/osd/modules/debugger/win]disasmbasewininfo.c

trunk/src/osd/modules/debugger/win/disasmbasewininfo.c
r243686r243687
131131         else
132132            ModifyMenu(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND, ID_DISABLE_BREAKPOINT, TEXT("Enable breakpoint at cursor\tShift+F9"));
133133      }
134      EnableMenuItem(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND | (bp != NULL ? MF_ENABLED : MF_GRAYED));
134      bool const available = (bp != NULL) && (!is_main_console() || dasmview->source_is_visible_cpu());
135      EnableMenuItem(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND | (available ? MF_ENABLED : MF_GRAYED));
135136   }
136137   else
137138   {
r243686r243687
177178            }
178179
179180            // if it doesn't exist, add a new one
180            if (dasmview->source_is_visible_cpu())
181            if (!is_main_console())
181182            {
182               astring command;
183183               if (bpindex == -1)
184                  command.printf("bpset 0x%X", address);
185               else
186                  command.printf("bpclear 0x%X", bpindex);
187               debug_console_execute_command(machine(), command, 1);
188            }
189            else
190            {
191               if (bpindex == -1)
192184               {
193185                  bpindex = debug->breakpoint_set(address, NULL, NULL);
194186                  debug_console_printf(machine(), "Breakpoint %X set\n", bpindex);
r243686r243687
201193               machine().debug_view().update_all();
202194               debugger_refresh_display(machine());
203195            }
196            else if (dasmview->source_is_visible_cpu())
197            {
198               astring command;
199               if (bpindex == -1)
200                  command.printf("bpset 0x%X", address);
201               else
202                  command.printf("bpclear 0x%X", bpindex);
203               debug_console_execute_command(machine(), command, 1);
204            }
204205         }
205206         return true;
206207
r243686r243687
218219            // if it doesn't exist, add a new one
219220            if (bp != NULL)
220221            {
221               if (dasmview->source_is_visible_cpu())
222               if (!is_main_console())
222223               {
223                  astring command;
224                  command.printf(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", (UINT32)bp->index());
225                  debug_console_execute_command(machine(), command, 1);
226               }
227               else
228               {
229224                  debug->breakpoint_enable(bp->index(), !bp->enabled());
230225                  debug_console_printf(machine(), "Breakpoint %X %s\n", (UINT32)bp->index(), bp->enabled() ? "enabled" : "disabled");
231226                  machine().debug_view().update_all();
232227                  debugger_refresh_display(machine());
233228               }
229               else if (dasmview->source_is_visible_cpu())
230               {
231                  astring command;
232                  command.printf(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", (UINT32)bp->index());
233                  debug_console_execute_command(machine(), command, 1);
234               }
234235            }
235236         }
236237         return true;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team