summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/debugint.cpp
diff options
context:
space:
mode:
author mahlemiut <bsr@xnet.co.nz>2015-12-17 19:09:16 +1300
committer mahlemiut <bsr@xnet.co.nz>2015-12-17 19:10:31 +1300
commit043eed6171d1c706954218afae9eaea48591f3a5 (patch)
tree6bd02d61f8bebfdd0c130d184ff8580dd2ac9ee3 /src/osd/modules/debugger/debugint.cpp
parent40768ae7dd57d77ad8cc61d9684c7a17f47613af (diff)
Make new internal debugger windows appear in a cascade-like position, and give some windows better default sizes. Change render_target::debug_top() to put targets at the end of the target list, fixing the order in which windows are rendered (nothing else uses this function).
Diffstat (limited to 'src/osd/modules/debugger/debugint.cpp')
-rw-r--r--src/osd/modules/debugger/debugint.cpp79
1 files changed, 65 insertions, 14 deletions
diff --git a/src/osd/modules/debugger/debugint.cpp b/src/osd/modules/debugger/debugint.cpp
index 6b65c3a564e..a9f77f79422 100644
--- a/src/osd/modules/debugger/debugint.cpp
+++ b/src/osd/modules/debugger/debugint.cpp
@@ -17,6 +17,8 @@
#include "debug/debugvw.h"
#include "debug/dvdisasm.h"
#include "debug/dvmemory.h"
+#include "debug/dvbpoints.h"
+#include "debug/dvwpoints.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
@@ -275,6 +277,7 @@ static DView * focus_view;
static ui_menu * menu;
static DView_edit * cur_editor;
+static int win_count;
static void set_focus_view(DView *dv)
{
@@ -289,7 +292,7 @@ static void set_focus_view(DView *dv)
focus_view = dv;
LIST_REMOVE(list, dv, DView);
LIST_ADD_FRONT(list, dv, DView);
- dv->target->debug_top(*dv->container);
+ dv->target->debug_append(*dv->container);
}
}
@@ -1012,6 +1015,10 @@ static void on_memory_window_activate(DView *dv, const ui_menu_event *event)
ndv->editor.container = &dv->machine().render().ui_container();
source = ndv->view->source();
dview_set_title(ndv, source->name());
+ ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
+ ndv->bounds.setx(0,500);
+ win_count++;
+
set_focus_view(ndv);
}
@@ -1028,8 +1035,9 @@ static void on_disassembly_window_activate(DView *dv, const ui_menu_event *event
ndv->editor.container = &dv->machine().render().ui_container();
source = ndv->view->source();
dview_set_title(ndv, source->name());
+ ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
+ win_count++;
set_focus_view(ndv);
-
}
static void on_disasm_cpu_activate(DView *dv, const ui_menu_event *event)
@@ -1055,6 +1063,37 @@ static void on_log_window_activate(DView *dv, const ui_menu_event *event)
target = &dv->machine().render().ui_target();
ndv = dview_alloc(target, dv->machine(), DVT_LOG, 0);
dview_set_title(ndv, "Log");
+ ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
+ ndv->bounds.setx(0,600);
+ win_count++;
+ set_focus_view(ndv);
+}
+
+static void on_bp_window_activate(DView *dv, const ui_menu_event *event)
+{
+ DView *ndv;
+ render_target *target;
+
+ target = &dv->machine().render().ui_target();
+ ndv = dview_alloc(target, dv->machine(), DVT_BREAK_POINTS, 0);
+ dview_set_title(ndv, "Breakpoints");
+ ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
+ ndv->bounds.setx(0,600);
+ win_count++;
+ set_focus_view(ndv);
+}
+
+static void on_wp_window_activate(DView *dv, const ui_menu_event *event)
+{
+ DView *ndv;
+ render_target *target;
+
+ target = &dv->machine().render().ui_target();
+ ndv = dview_alloc(target, dv->machine(), DVT_WATCH_POINTS, 0);
+ dview_set_title(ndv, "Watchpoints");
+ ndv->ofs_x = ndv->ofs_y = win_count * TITLE_HEIGHT;
+ ndv->bounds.setx(0,600);
+ win_count++;
set_focus_view(ndv);
}
@@ -1062,6 +1101,7 @@ static void on_close_activate(DView *dv, const ui_menu_event *event)
{
if (focus_view == dv)
set_focus_view(dv->next);
+ win_count--;
dview_free(dv);
}
@@ -1299,6 +1339,12 @@ static void CreateMainMenu(running_machine &machine)
case DVT_STATE:
title = "State:";
break;
+ case DVT_BREAK_POINTS:
+ title = "Breakpoints:";
+ break;
+ case DVT_WATCH_POINTS:
+ title = "Watchpoints:";
+ break;
}
menu->item_append(title.append(focus_view->title).c_str(), nullptr, MENU_FLAG_DISABLE, nullptr);
@@ -1356,6 +1402,8 @@ static void CreateMainMenu(running_machine &machine)
menu->item_append("New Memory Window", nullptr, 0, (void *)on_memory_window_activate);
menu->item_append("New Disassembly Window", nullptr, 0, (void *)on_disassembly_window_activate);
menu->item_append("New Error Log Window", nullptr, 0, (void *)on_log_window_activate);
+ menu->item_append("New Breakpoints Window", nullptr, 0, (void *)on_bp_window_activate);
+ menu->item_append("New Watchpoints Window", nullptr, 0, (void *)on_wp_window_activate);
menu->item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
menu->item_append("Run", nullptr, 0, (void *)on_run_activate);
menu->item_append("Run and Hide Debugger", nullptr, 0, (void *)on_run_h_activate);
@@ -1568,15 +1616,10 @@ static void dview_update_view(DView *dv)
static void update_views(void)
{
- DView *dv, *prev;
+ DView *dv;
- LIST_GET_LAST(list, dv);
- while (dv != nullptr)
- {
+ for(dv=list;dv!=nullptr;dv=dv->next)
dview_update_view(dv);
- LIST_GET_PREVIOUS(list, dv, prev);
- dv = prev;
- }
}
@@ -1587,20 +1630,28 @@ void debug_internal::wait_for_debugger(device_t &device, bool firststop)
render_target *target = &device.machine().render().ui_target();
//set_view_by_name(target, "Debug");
+ win_count = 0;
DView *disassembly = dview_alloc(target, device.machine(), DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
disassembly->editor.active = TRUE;
disassembly->editor.container = &device.machine().render().ui_container();
- disassembly->ofs_x = 300;
-
- dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
-
+ disassembly->ofs_x = 500;
+ disassembly->bounds.setx(0,600);
+ win_count++;
+
+ DView *statewin = dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
+ statewin->ofs_x = 350;
+ statewin->bounds.set(0,150,0,600);
+ win_count++;
+
DView *console = dview_alloc(target, device.machine(), DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
dview_set_title(console, "Console");
console->editor.active = TRUE;
console->editor.container = &device.machine().render().ui_container();
console->bounds.setx(0,600);
- console->ofs_x = 600;
+ console->ofs_x = 500;
+ console->ofs_y = 300;
+ win_count++;
set_focus_view(console);
}