diff options
author | 2017-01-17 12:20:59 -0500 | |
---|---|---|
committer | 2017-01-17 12:20:59 -0500 | |
commit | ec4b0ff9f70dfb4b2d453d671ef7fb2acff642dd (patch) | |
tree | 3cfb963f349f42369af783c23e0c0b37b513f4a1 /src/emu/debug/debugcpu.cpp | |
parent | c0c623883ed01d5d698cdd104fc62c2cf8c0e7ed (diff) | |
parent | e5d662adf7b991d1bdf3a374dd2b64ce408e04bd (diff) |
Merge pull request #1992 from npwoods/tracelogerror_debugger_option
Tracelogerror debugger option
Diffstat (limited to 'src/emu/debug/debugcpu.cpp')
-rw-r--r-- | src/emu/debug/debugcpu.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 98fa6c9f038..85c0b32dd73 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -1684,6 +1684,10 @@ device_debug::device_debug(device_t &device) if (m_state != nullptr && m_symtable.find("curpc") == nullptr) m_symtable.add("curpc", nullptr, get_current_pc); } + + // set up trace + using namespace std::placeholders; + m_device.machine().add_logerror_callback(std::bind(&device_debug::errorlog_write_line, this, _1)); } @@ -2623,14 +2627,14 @@ u32 device_debug::compute_opcode_crc32(offs_t pc) const // trace - trace execution of a given device //------------------------------------------------- -void device_debug::trace(FILE *file, bool trace_over, bool detect_loops, const char *action) +void device_debug::trace(FILE *file, bool trace_over, bool detect_loops, bool logerror, const char *action) { // delete any existing tracers m_trace = nullptr; // if we have a new file, make a new tracer if (file != nullptr) - m_trace = std::make_unique<tracer>(*this, *file, trace_over, detect_loops, action); + m_trace = std::make_unique<tracer>(*this, *file, trace_over, detect_loops, logerror, action); } @@ -3291,11 +3295,12 @@ bool device_debug::registerpoint::hit() // tracer - constructor //------------------------------------------------- -device_debug::tracer::tracer(device_debug &debug, FILE &file, bool trace_over, bool detect_loops, const char *action) +device_debug::tracer::tracer(device_debug &debug, FILE &file, bool trace_over, bool detect_loops, bool logerror, const char *action) : m_debug(debug) , m_file(file) , m_action((action != nullptr) ? action : "") , m_detect_loops(detect_loops) + , m_logerror(logerror) , m_loops(0) , m_nextdex(0) , m_trace_over(trace_over) @@ -3447,3 +3452,14 @@ device_debug::dasm_comment::dasm_comment(offs_t address, u32 crc, const char *te m_color(std::move(color)) { } + + +//------------------------------------------------- +// dasm_comment - constructor +//------------------------------------------------- + +void device_debug::errorlog_write_line(const char *line) +{ + if (m_trace && m_trace->logerror()) + trace_printf("%s", line); +}
\ No newline at end of file |