summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debugger.h
blob: d1e5243f6a359fa00347f92e65b3cc6498ad65fe (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
/****************************************************************************

    debugger.h

    General debugging interfaces

    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
    Visit http://mamedev.org for licensing and usage restrictions.

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

#pragma once

#ifndef __DEBUGGER_H__
#define __DEBUGGER_H__

#include "mame.h"


/***************************************************************************
    MACROS
***************************************************************************/

/* handy macro for hard-coding debugger breaks */
#ifdef MAME_DEBUG
#define DEBUGGER_BREAK			if (Machine->debug_mode) mame_debug_break();
#else
#define DEBUGGER_BREAK
#endif


/* handy macro for CPU cores */
#ifdef MAME_DEBUG
#define CALL_MAME_DEBUG			if (Machine->debug_mode) mame_debug_hook();
#else
#define CALL_MAME_DEBUG
#endif



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

/* initialize the debugger */
void mame_debug_init(running_machine *machine);

/* call this once per instruction from CPU cores */
void mame_debug_hook(void);

/* call this to break into the debugger as soon as possible */
void mame_debug_break(void);

/* call this to determine if the debugger is currently active (broken) */
int mame_debug_is_active(void);



/***************************************************************************
    STUBS
***************************************************************************/

#ifndef MAME_DEBUG
#define mame_debug_init(m) do { } while (0)
#define mame_debug_hook() do { } while (0)
#define mame_debug_break() do { } while (0)
#define mame_debug_is_active() FALSE
#endif


#endif	/* __DEBUGGER_H__ */