summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debugger.c
blob: 3ec7cae249ce2ecc9b0f216c344fb3292da05763 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*********************************************************************

    debugger.c

    Front-end debugger interfaces.

    Copyright Nicola Salmoria and the MAME Team.
    Visit http://mamedev.org for licensing and usage restrictions.

*********************************************************************/

#include "driver.h"
#include "debugger.h"
#include "debug/debugcpu.h"
#include "debug/debugcmd.h"
#include "debug/debugcmt.h"
#include "debug/debugcon.h"
#include "debug/express.h"
#include "debug/debugvw.h"
#include <ctype.h>



/***************************************************************************
    FUNCTION PROTOTYPES
***************************************************************************/

static void debugger_flush_traces(void);



/***************************************************************************
    CENTRAL INITIALIZATION POINT
***************************************************************************/

/*-------------------------------------------------
    debugger_init - start up all subsections
-------------------------------------------------*/

void debugger_init(running_machine *machine)
{
	/* only if debugging is enabled */
	if (machine->debug_flags & DEBUG_FLAG_ENABLED)
	{
		debug_cpu_init(machine);
		debug_command_init(machine);
		debug_console_init(machine);
		debug_view_init(machine);
		debug_comment_init(machine);
		atexit(debugger_flush_traces);
		add_logerror_callback(machine, debug_errorlog_write_line);
	}
}


/*-------------------------------------------------
    debugger_refresh_display - redraw the current
    video display
-------------------------------------------------*/

void debugger_refresh_display(running_machine *machine)
{
	video_frame_update(machine, TRUE);
}


/*-------------------------------------------------
    debugger_flush_traces - flush any traces in
    the event of an aborted execution
-------------------------------------------------*/

static void debugger_flush_traces(void)
{
	extern running_machine *Machine;
	if (Machine != NULL)
		debug_cpu_flush_traces(Machine);
}