put debug_view back in machine due to issues with QT (nw)

This commit is contained in:
Miodrag Milanovic 2016-01-12 12:00:56 +01:00
parent db0bd9e5e5
commit 807265ed21
16 changed files with 57 additions and 60 deletions

View File

@ -1158,7 +1158,7 @@ static void execute_comment(running_machine &machine, int ref, int params, const
/* Now try adding the comment */
cpu->debug()->comment_add(address, param[1], 0x00ff0000);
cpu->machine().debugger().view().update_all(DVT_DISASSEMBLY);
cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@ -1182,7 +1182,7 @@ static void execute_comment_del(running_machine &machine, int ref, int params, c
/* If it's a number, it must be an address */
/* The bankoff and cbn will be pulled from what's currently active */
cpu->debug()->comment_remove(address);
cpu->machine().debugger().view().update_all(DVT_DISASSEMBLY);
cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}

View File

@ -384,7 +384,7 @@ CMDERR debug_console_execute_command(running_machine &machine, const char *comma
/* update all views */
if (echo)
{
machine.debugger().view().update_all();
machine.debug_view().update_all();
machine.debugger().refresh_display();
}
return result;
@ -483,7 +483,7 @@ void CLIB_DECL debug_console_printf(running_machine &machine, const char *format
text_buffer_print(console_textbuf, buffer.c_str());
/* force an update of any console views */
machine.debugger().view().update_all(DVT_CONSOLE);
machine.debug_view().update_all(DVT_CONSOLE);
}
@ -501,7 +501,7 @@ void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *forma
text_buffer_print(console_textbuf, buffer.c_str());
/* force an update of any console views */
machine.debugger().view().update_all(DVT_CONSOLE);
machine.debug_view().update_all(DVT_CONSOLE);
}
@ -523,7 +523,7 @@ void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol,
text_buffer_print_wrap(console_textbuf, buffer.c_str(), wrapcol);
/* force an update of any console views */
machine.debugger().view().update_all(DVT_CONSOLE);
machine.debug_view().update_all(DVT_CONSOLE);
}
@ -549,7 +549,7 @@ void debug_errorlog_write_line(const running_machine &machine, const char *line)
text_buffer_print(errorlog_textbuf, line);
/* force an update of any log views */
machine.debugger().view().update_all(DVT_LOG);
machine.debug_view().update_all(DVT_LOG);
}

View File

@ -1729,8 +1729,8 @@ void device_debug::start_hook(const attotime &endtime)
// check for periodic updates
if (&m_device == global->visiblecpu && osd_ticks() > global->last_periodic_update_time + osd_ticks_per_second()/4)
{
m_device.machine().debugger().view().update_all();
m_device.machine().debugger().view().flush_osd_updates();
m_device.machine().debug_view().update_all();
m_device.machine().debug_view().flush_osd_updates();
global->last_periodic_update_time = osd_ticks();
}
@ -1869,8 +1869,8 @@ void device_debug::instruction_hook(offs_t curpc)
// update every 100 steps until we are within 200 of the end
else if ((m_flags & DEBUG_FLAG_STEPPING_OUT) == 0 && (m_stepsleft < 200 || m_stepsleft % 100 == 0))
{
machine.debugger().view().update_all();
machine.debugger().view().flush_osd_updates();
machine.debug_view().update_all();
machine.debug_view().flush_osd_updates();
machine.debugger().refresh_display();
}
}
@ -1918,7 +1918,7 @@ void device_debug::instruction_hook(offs_t curpc)
global->visiblecpu = &m_device;
// update all views
machine.debugger().view().update_all();
machine.debug_view().update_all();
machine.debugger().refresh_display();
// wait for the debugger; during this time, disable sound output
@ -1926,7 +1926,7 @@ void device_debug::instruction_hook(offs_t curpc)
while (global->execution_state == EXECUTION_STATE_STOPPED)
{
// flush any pending updates before waiting again
machine.debugger().view().flush_osd_updates();
machine.debug_view().flush_osd_updates();
// clear the memory modified flag and wait
global->memory_modified = false;
@ -1937,7 +1937,7 @@ void device_debug::instruction_hook(offs_t curpc)
// if something modified memory, update the screen
if (global->memory_modified)
{
machine.debugger().view().update_all(DVT_DISASSEMBLY);
machine.debug_view().update_all(DVT_DISASSEMBLY);
machine.debugger().refresh_display();
}

View File

@ -179,7 +179,7 @@ void debug_view_breakpoints::view_click(const int button, const debug_view_xy& p
// Enable / disable
m_buffer[bpIndex]->setEnabled(!m_buffer[bpIndex]->enabled());
machine().debugger().view().update_all(DVT_DISASSEMBLY);
machine().debug_view().update_all(DVT_DISASSEMBLY);
}
begin_update();

View File

@ -34,27 +34,22 @@ static int g_atexit_registered = FALSE;
debugger_manager::debugger_manager(running_machine &machine)
: m_machine(machine)
{
/* only if debugging is enabled */
if (machine.debug_flags & DEBUG_FLAG_ENABLED)
{
/* initialize the submodules */
m_debug_view = std::make_unique<debug_view_manager>(machine);
debug_cpu_init(machine);
debug_command_init(machine);
/* initialize the submodules */
debug_cpu_init(machine);
debug_command_init(machine);
g_machine = &machine;
g_machine = &machine;
/* register an atexit handler if we haven't yet */
if (!g_atexit_registered)
atexit(debugger_flush_all_traces_on_abnormal_exit);
g_atexit_registered = TRUE;
/* register an atexit handler if we haven't yet */
if (!g_atexit_registered)
atexit(debugger_flush_all_traces_on_abnormal_exit);
g_atexit_registered = TRUE;
/* listen in on the errorlog */
machine.add_logerror_callback(debug_errorlog_write_line);
/* listen in on the errorlog */
machine.add_logerror_callback(debug_errorlog_write_line);
/* initialize osd debugger features */
machine.osd().init_debugger();
}
/* initialize osd debugger features */
machine.osd().init_debugger();
}
/*-------------------------------------------------

View File

@ -14,7 +14,6 @@
#include "debug/debugcpu.h"
class debug_view_manager;
// ======================> debugger_manager
@ -32,11 +31,9 @@ public:
// getters
running_machine &machine() const { return m_machine; }
debug_view_manager &view() const { assert(m_debug_view != nullptr); return *m_debug_view; }
private:
// internal state
running_machine & m_machine; // reference to our machine
std::unique_ptr<debug_view_manager> m_debug_view; // internal data from debugvw.cpp
};

View File

@ -269,8 +269,12 @@ void running_machine::start()
m_network = std::make_unique<network_manager>(*this);
// initialize the debugger
m_debugger = std::make_unique<debugger_manager>(*this);
m_debugger->initialize();
if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
m_debug_view = std::make_unique<debug_view_manager>(*this);
m_debugger = std::make_unique<debugger_manager>(*this);
m_debugger->initialize();
}
m_render->resolve_tags();

View File

@ -84,6 +84,7 @@ class sound_manager;
class video_manager;
class ui_manager;
class tilemap_manager;
class debug_view_manager;
class network_manager;
class bookkeeping_manager;
class configuration_manager;
@ -178,6 +179,7 @@ public:
image_manager &image() const { assert(m_image != nullptr); return *m_image; }
rom_load_manager &rom_load() const { assert(m_rom_load != nullptr); return *m_rom_load; }
tilemap_manager &tilemap() const { assert(m_tilemap != nullptr); return *m_tilemap; }
debug_view_manager &debug_view() const { assert(m_debug_view != nullptr); return *m_debug_view; }
debugger_manager &debugger() const { assert(m_debugger != nullptr); return *m_debugger; }
driver_device *driver_data() const { return &downcast<driver_device &>(root_device()); }
template<class _DriverClass> _DriverClass *driver_data() const { return &downcast<_DriverClass &>(root_device()); }
@ -288,6 +290,7 @@ private:
std::unique_ptr<ui_manager> m_ui; // internal data from ui.cpp
std::unique_ptr<ui_input_manager> m_ui_input; // internal data from uiinput.cpp
std::unique_ptr<tilemap_manager> m_tilemap; // internal data from tilemap.cpp
std::unique_ptr<debug_view_manager> m_debug_view; // internal data from debugvw.cpp
std::unique_ptr<network_manager> m_network; // internal data from network.cpp
std::unique_ptr<bookkeeping_manager> m_bookkeeping;// internal data from bookkeeping.cpp
std::unique_ptr<configuration_manager> m_configuration; // internal data from config.cpp

View File

@ -674,8 +674,8 @@ void fd1094_regenerate_key(running_machine &machine)
(*key_changed)(machine);
/* force all memory and disassembly views to update */
machine.debugger().view().update_all(DVT_MEMORY);
machine.debugger().view().update_all(DVT_DISASSEMBLY);
machine.debug_view().update_all(DVT_MEMORY);
machine.debug_view().update_all(DVT_DISASSEMBLY);
/* reset keydirty */
keydirty = FALSE;
@ -1008,8 +1008,8 @@ static void execute_fdstate(running_machine &machine, int ref, int params, const
return;
fd1094_set_state(keyregion, newstate);
fd1094_regenerate_key(machine);
machine.debugger().view().update_all(DVT_MEMORY);
machine.debugger().view().update_all(DVT_DISASSEMBLY);
machine.debug_view().update_all(DVT_MEMORY);
machine.debug_view().update_all(DVT_DISASSEMBLY);
}
/* 0 parameters displays the current state */

View File

@ -189,7 +189,7 @@ public:
this->target = target;
//dv->container = render_target_get_component_container(target, name, &pos);
this->container = target->debug_alloc();
this->view = machine.debugger().view().alloc_view(type, dview_update, this);
this->view = machine.debug_view().alloc_view(type, dview_update, this);
this->type = type;
this->m_machine = &machine;
this->state = flags | VIEW_STATE_NEEDS_UPDATE | VIEW_STATE_VISIBLE;
@ -211,7 +211,7 @@ public:
~DView()
{
//this->target->debug_free(*this->container);
machine().debugger().view().free_view(*this->view);
machine().debug_view().free_view(*this->view);
}
running_machine &machine() const { assert(m_machine != nullptr); return *m_machine; }

View File

@ -8,7 +8,6 @@
#import "debugview.h"
#include "debugger.h"
#include "debug/debugcpu.h"
#include "modules/lib/osdobj_common.h"
@ -229,7 +228,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
return nil;
type = t;
machine = &m;
view = machine->debugger().view().alloc_view((debug_view_type)type, debugwin_view_update, self);
view = machine->debug_view().alloc_view((debug_view_type)type, debugwin_view_update, self);
if (view == nil) {
[self release];
return nil;
@ -261,7 +260,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (view != NULL) machine->debugger().view().free_view(*view);
if (view != NULL) machine->debug_view().free_view(*view);
if (font != nil) [font release];
if (text != nil) [text release];
[super dealloc];

View File

@ -188,7 +188,7 @@
}
// fail to do this and the display doesn't update
machine->debugger().view().update_all();
machine->debug_view().update_all();
machine->debugger().refresh_display();
}
}
@ -207,7 +207,7 @@
"Breakpoint %X %s\n",
(UINT32)bp->index(),
bp->enabled() ? "enabled" : "disabled");
machine->debugger().view().update_all();
machine->debug_view().update_all();
machine->debugger().refresh_display();
}
}

View File

@ -165,7 +165,7 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo)
cpuinfo->breakpoint_clear(bpindex);
debug_console_printf(*m_machine, "Breakpoint %X cleared\n", bpindex);
}
m_machine->debugger().view().update_all();
m_machine->debug_view().update_all();
m_machine->debugger().refresh_display();
}
@ -190,7 +190,7 @@ void DasmWindow::enableBreakpointAtCursor(bool changedTo)
{
cpuinfo->breakpoint_enable(bp->index(), !bp->enabled());
debug_console_printf(*m_machine, "Breakpoint %X %s\n", (UINT32)bp->index(), bp->enabled() ? "enabled" : "disabled");
m_machine->debugger().view().update_all();
m_machine->debug_view().update_all();
m_machine->debugger().refresh_display();
}
}

View File

@ -5,7 +5,6 @@
#include <QtGui/QPainter>
#include <QtGui/QKeyEvent>
#include "debugger.h"
#include "debuggerview.h"
#include "modules/lib/osdobj_common.h"
@ -28,7 +27,7 @@ DebuggerView::DebuggerView(const debug_view_type& type,
viewFontRequest.setPointSize((selectedFontSize <= 0) ? 11 : selectedFontSize);
setFont(viewFontRequest);
m_view = m_machine->debugger().view().alloc_view(type,
m_view = m_machine->debug_view().alloc_view(type,
DebuggerView::debuggerViewUpdate,
this);
@ -42,7 +41,7 @@ DebuggerView::DebuggerView(const debug_view_type& type,
DebuggerView::~DebuggerView()
{
if (m_machine && m_view)
m_machine->debugger().view().free_view(*m_view);
m_machine->debug_view().free_view(*m_view);
}
void DebuggerView::paintEvent(QPaintEvent* event)

View File

@ -63,7 +63,7 @@ debugview_info::debugview_info(debugger_windows_interface &debugger, debugwin_in
goto cleanup;
// create the debug view
m_view = machine().debugger().view().alloc_view(type, &debugview_info::static_update, this);
m_view = machine().debug_view().alloc_view(type, &debugview_info::static_update, this);
if (m_view == NULL)
goto cleanup;
@ -80,7 +80,7 @@ cleanup:
DestroyWindow(m_wnd);
m_wnd = NULL;
if (m_view != NULL)
machine().debugger().view().free_view(*m_view);
machine().debug_view().free_view(*m_view);
m_view = NULL;
}
@ -90,7 +90,7 @@ debugview_info::~debugview_info()
if (m_wnd != NULL)
DestroyWindow(m_wnd);
if (m_view)
machine().debugger().view().free_view(*m_view);
machine().debug_view().free_view(*m_view);
}
@ -733,7 +733,7 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam)
debug_view_xy topleft = m_view->visible_position();
topleft.x = process_scroll(LOWORD(wparam), (HWND)lparam);
m_view->set_visible_position(topleft);
machine().debugger().view().flush_osd_updates();
machine().debug_view().flush_osd_updates();
break;
}
@ -743,7 +743,7 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam)
debug_view_xy topleft = m_view->visible_position();
topleft.y = process_scroll(LOWORD(wparam), (HWND)lparam);
m_view->set_visible_position(topleft);
machine().debugger().view().flush_osd_updates();
machine().debug_view().flush_osd_updates();
break;
}

View File

@ -190,7 +190,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam)
debug->breakpoint_clear(bpindex);
debug_console_printf(machine(), "Breakpoint %X cleared\n", bpindex);
}
machine().debugger().view().update_all();
machine().debug_view().update_all();
machine().debugger().refresh_display();
}
else if (dasmview->source_is_visible_cpu())
@ -223,7 +223,7 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam)
{
debug->breakpoint_enable(bp->index(), !bp->enabled());
debug_console_printf(machine(), "Breakpoint %X %s\n", (UINT32)bp->index(), bp->enabled() ? "enabled" : "disabled");
machine().debugger().view().update_all();
machine().debug_view().update_all();
machine().debugger().refresh_display();
}
else if (dasmview->source_is_visible_cpu())