summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcpu.h
Commit message (Collapse)AuthorAgeFilesLines
* diexec: Add callback to allow debugger to break into the middle of wait-type ↵ AJR2024-11-171-1/+6
| | | | | | | | | | instructions whose execution time is normally indefinite. When this happens, a special message may be printed to the debug console stating the location of the last actual instruction executed before the wait (if there was one). Note that since the callback ignores the current value of the program counter, this special type of debugger break cannot be entered through breakpoints or instruction stepping commands. The callback also leaves no effect on PC history tracking or trace logs. * cpu/hd61700, cpu/tms32031: Add standard IRQ callback * cpu/m68000gen.py: Change name of invoked executable to bin/python3 * cpu/m6809: Eliminate PC "massaging" for SYNC and similar instructions
* Various optimisations to code generaton. Vas Crabb2023-03-261-3/+3
| | | | | | | | | | | | | | | util/bitmap.cpp, util/palette.cpp: Marked lots of things constexpr. Bitmaps don't throw exceptions on allocation failure, they just become invalid. Almost nothing in MAME actually checks for this. emu/profiler.cpp: Abort if the profile stack overflows rather than throwing an exception. This is a developer feature and if it overflows, the code is broken. Calling a noreturn noexcept function generates less code than throwing an exception, which adds up. util/strformat.cpp: Traded away some unnecessary flexibility for more compact code. The stream objects must derive from std::basic_ostream now - they can't just be any old objects with the expected operators.
* Interrupt callback rationalization AJR2023-03-111-1/+2
| | | | | | | | | | | - Make CPUs pass interrupt return PC as a second argument to standard_irq_callback - Add interrupt return PC to "Stopped at interrupt" message produced by debugger 'gint' command - Add messages to trace logs whenever interrupts are accepted - Attempt to step over interrupt routines for applicable debugger commands - Eliminate standard_irq_callback_member wrapper method - Update many CPU cores to invoke standard_irq_callback at the start of or during interrupt processing, rather than at the end or when the input line changes - Remove IRQ callbacks for some input lines that never cause interrupts - mb88xx, mcs48: Add IRQ callbacks for internal interrupts
* Debugger changes AJR2022-08-281-19/+26
| | | | | | | - Added exception points as a new class of "points" triggering on specific exception numbers, with a similar set of commands to breakpoints and registerpoints. - Removed the per-instruction callback hook from device_debug. Only one driver was using this (rmnimbus.cpp), and what it was doing with it could be done more cleanly with exception points. - Change the type of the action string parameter for "points"-creating methods and make some parameters optional for those. - Change trace file logging to use a std::ostream instead of FILE * to take better advantage of strformat.
* Debugger feature improvements AJR2022-03-271-4/+11
| | | | | | | | - Add 'gbt' and 'gbf' debugger commands to step until a true or false conditional branch has been detected. - Update over 100 of the disassemblers in MAME to output a new STEP_COND flag for all conditional branches. Besides being used for execution of the new 'gbt' and 'gbf' commands, this flag also now helps the debugger 'out' command to properly handle conditional return instructions. - Remove STEP_OVER from many instructions that aren't actually subroutine calls (e.g. DJNZ on Z80). A 'gni' debugger command (go next instruction) has been added to accommodate some of the misuse. - Add instruction flag support to several more disassemblers that lacked them entirely (e.g. st62xx) - Don't pass over delay slots for debugging in ASAP core
* Addressed some Lua scripting pitfalls. (#9294) Vas Crabb2022-02-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Addressed pure virtual function call crash on end of emulation session if you haven't explicitly removed all address space taps, memory corruption on end of emulation session if you haven't explicitly removed all address space change notifiers, and symbol being garbage-collected out from under you while you have parsed expressions or other symbol tables that depend on them. Removed the copy constructor for parsed expressions as the underlying C++ copy constructor appears to be broken, and simplified symbol table constructors. Also made symbol table add methods return the new entry to avoid the need for an extra lookup. Fixed breakpoint/watchpoint objects being inappropriately copied into the tables returned by bplist() and wplist(), allowing the enabled property to be modifiable for breakpoint and watchpoint objects in Lua. Fixed drivers and devices causing a new memory pass-through handler to be allocated on each soft reset, and fixed multiple instances of taps being installed in the event the machine is reset before the tap is removed. Added classes for managing broadcast subscriptions, and adapted address spaces to use this for change notifications.
* Various improvements to the user experience: Vas Crabb2021-10-131-4/+6
| | | | | | | | | | | | | | | | | | Extended the memory access prefixes in debugger expressions to support address space names. Made the debugger history command aware of how much history it has collected, and added a help topic for it to the built-in debugger help. Started updating the documentation for the web site, and corrected some of the more misleading built-in debugger help. Made some corrections to Chinese localisation after discussion with YuiFAN. Darkened the UI red colour a little. cpu/m6502/st2205u.h: Marked sound imperfect.
* Fix multiple issues with debug memory tracking AJR2021-10-041-1/+1
| | | | | | - Track write accesses rather than read accesses - Actually install the taps when the trackmem command is executed - Correct cell addresses for address-shifted spaces in Qt and Windows memory viewers
* Debugger-related feature removals and cleanup AJR2021-08-151-17/+0
| | | | | | | | - Remove the hotspot read tracker. This was never robustly implemented, but changes to the memory system made it much less useful, and the "speedup opportunities" which it aimed to determine are not very important from a current emulation standpoint. - Remove the CURSP/GENSP state symbol and the generic sp() getter. Stacking semantics vary too much between CPU architectures for this to be of much use. (A "SP" symbol has been added to a few CPU cores whose stack pointers were otherwise not being registered.) - Remove the cached pointer to device_state_interface and the state() fast accessor from device_t. Most users of device_state_interface either already had a pointer to the specific CPU device type or needed to check first for the presence of the interface. - Change the PC memory write tracker to use pcbase(), which works even when the instruction callback is masked out, instead of peeking at the PC history index. - Remove some obsolete watchpoint-related definitions from machine.h.
* Add 'wpsize' variable to access the data size from a watchpoint (#7837) Scott Percival2021-03-031-1/+2
|
* Debugger expression and memory access overhaul AJR2020-05-251-195/+14
| | | | | | | | | | | | | - Memory references in expressions no longer default to the console's visible CPU if no device name was specified, except when entered through the console itself. Expressions in view windows now use the context of the currently selected device instead. - The pcatmem debug command and similar qt mouseover function now produce an error message if the initial address translation fails. Related internal changes (nw) - The debugger_cpu class no longer interprets memory accesses. The existing routines have been moved into symbol_table (which used to invoke them as callbacks), and reimplemented in most other places. Thecode duplication is a bit messy, but could be potentially improved in the future with new utility classes. - The cheat engine no longer needs to hook into the debugger_cpu class or instantiate a dummy instance of it. - The inclusion of debug/express.h within emu.h has been undone. Some debugging structures now need unique_ptr to wrap the resulting incomplete classes; hopefully the performance impact of this is negligible. Another direct consequence is that the breakpoint, watchpoint and registerpoint classes are no longer inside device_debug and have their own source file. - The breakpoint list is now a std::multimap, using the addresses as keys to hopefully expedite lookup. - The visible CPU pointer has been removed from the debugger_cpu class, being now considered a property of the console instead. - Many minor bits of code have been simplified.
* Add optional condition parameter to debugger gex command AJR2020-05-031-1/+2
|
* Make expressions octal for applicable address spaces in disassembly view AJR2020-04-131-19/+8
| | | | | | | | | | debug/express.cpp, debugcpu.cpp: General cleanup (nw) - Change default base from hardcoded macro to dynamic parameter for parsed_expression - Change symbol table parameters and variables to references or std::reference_wrapper - Remove the (unused) ability to construct a parsed_expression without a symbol table - Eliminate symbol_table &table and void *memory_param arguments from callbacks (superfluous now that std::function can bind everything necessary) - Eliminate globalref pointer from symbol_table - Add explicitly defaulted move constructor and move assignment operator
* Use std::forward_list for breakpoint and registerpoint lists (nw) AJR2019-09-101-8/+5
|
* gdbstub: added new GDB stub debugger (#5456) Ramiro Polla2019-08-111-0/+6
| | | | | | | | | | | | * gdbstub: added new GDB stub debugger This debugger can be used to connect to an external debugger that communicates using the GDB Remote Serial Protocol, such as GDB itself or many other GDB frontends. Currently i386 (ct486), arm7 (gba), and ppc (pmac6100) are supported. * gdbstub: enable GDB stub debugger in mac and windows builds
* watchpoint: prevent recursive multiple installs [O. Galibert] Olivier Galibert2018-12-061-0/+1
|
* debugger: add 'gp' command Sven Schnelle2018-11-061-1/+6
| | | | | | | | | | | | | | gp 'go privilege' starts execution until the privilege mode changes. This can be used to break on task switches. I.e on m68k, one could do: gp { ~sr & 0x2000 && crp_aptr == 0x1234567 } which would execute until the privilege mode changes to user mode and the CPU root pointer is 0x1234567. for cpu code, all that is needed to make this work is calling debugger_privilege_hook() when the execution level changes.
* debugcpu.cpp: Move scripting functions down into console (nw) AJR2018-07-261-9/+0
|
* emumem: Backend modernization [O. Galibert] Olivier Galibert2018-06-291-21/+27
|
* Added suspend and resume debugger commands (#3411) GavinAndrews2018-04-021-0/+5
|
* Reshuffle some stuff: Vas Crabb2018-03-281-24/+27
| | | | | | * Move around the debugger hooks to get a small but measurable performance increase * Remove emucore from external tools * Improve performance of DSP16 interpreter a little by generating six variants of execution loop
* (nw) misc cleanup: start replacing auto_alloc_* with smart pointers, get Vas Crabb2017-12-011-12/+10
| | | | | rid of reference constants in the debugger in favour of capturing the value in the bind/lambda (less ugly casting)
* dvdisasm: Overhaul [O. Galibert] Olivier Galibert2017-11-261-1/+0
| | | | | | | | Disassemblers are now independant classes. Not only the code is cleaner, but unidasm has access to all the cpu cores again. The interface to the disassembly method has changed from byte buffers to objects that give a result to read methods. This also adds support for lfsr and/or paged PCs.
* This is too contentious, please put it up for review Vas Crabb2017-08-011-0/+35
| | | | | | Revert "Changes to debugger memory address translation" This reverts commit bb0964f9a284b15851773f5428bd602ca01cc28b.
* Changes to debugger memory address translation AJR2017-08-011-35/+0
| | | | | | - memory_translate now returns an address space number rather a boolean flag, permitting addresses in part of one space to map to an entirely different space. This is primarily intended to help MCUs which have blocks of internal memory that can be dynamically remapped, but may also allow for more accurate emulation of MMUs that drive multiple external address spaces, since the old limit of four address spaces per MAME device has been lifted. - memory_translate has also been made a const method, in spite of a couple of badly behaved CPU cores that can't honestly treat it as one. - The (read|write)_(byte|word|dword|qword|memory|opcode) accessors have been transferred from debugger_cpu to device_memory_interface, with somewhat modified arguments corresponding to the translate function it calls through to if requested.
* dimemory: Lift the cap on the number of address spaces per device [O. Galibert] Olivier Galibert2017-07-031-6/+7
|
* Changed a few 'const char *' ==> 'const std::string &' in the MAME debugger ↵ npwoods2017-06-241-2/+2
| | | | (#2170)
* general cleanup: Vas Crabb2017-05-231-5/+2
| | | | | | | | | | | * move rarely-used output and pty interfaces out of emu.h * consolidate and de-duplicate forward declarations, also remove some obsolete ones * clean up more #include guard macros * scope down a few more things (nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h - this will make it far easier to keep them in sync with declarations than having them scattered through all the other files.
* disable: reverse polarity (nw) Olivier Galibert2017-03-261-2/+2
|
* debugger: print octal addresses in the trace if CPU is octal. Sergey Svishchev2017-03-161-0/+1
|
* debugger_access: Refactor [O. Galibert] Olivier Galibert2017-03-021-3/+2
|
* srcclean (nw) Vas Crabb2017-01-221-1/+1
|
* Added a facility to allow logerror output to reside in traces Nathan Woods2017-01-161-2/+5
| | | | As a consequence, the debugger 'trace' command was changed so that the third parameter is a list of '|' delimited options
* XML refactoring: Vas Crabb2016-12-111-5/+5
| | | | | | | * move stuff to namespace util::xml * scope down some enums * split config load/save delegate types * make config load take const so it can't mangle data
* Revert "moved debugger_access() from address space to machine & removed the ↵ Vas Crabb2016-11-211-2/+0
| | | | | | anti-patterns that updated cascading address spaces. [smf]" This reverts commit 5f05fbf61348c65204fde1e2aeed72de4cb56593.
* moved debugger_access() from address space to machine & removed the ↵ smf-2016-11-191-0/+2
| | | | anti-patterns that updated cascading address spaces. [smf]
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-90/+90
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* Fix Visual Studio build (nw) Miodrag Milanovic2016-11-161-1/+1
|
* Turn xmlfile API into something that looks like C++ Vas Crabb2016-11-171-1/+1
| | | | It's still a bit quirky but it's far better encapsulated before, and it plays nice with const (nw)
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-10/+10
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-81/+81
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* some bool <-> int not needed conversions, also cleaned drivenum.* was using ↵ Miodrag Milanovic2016-10-211-2/+2
| | | | memset for clearing vector (nw)
* Cleanups and version bump Miodrag Milanovic2016-07-271-1/+1
|
* Make loop collation optional for debugger trace and traceover commands therealmogminer@gmail.com2016-07-141-2/+3
|
* Don't need debugcpu to translate (nw) AJR2016-07-031-3/+0
|
* Consolidate disassemble functions (nw) AJR2016-07-031-3/+0
|
* Merge pull request #994 from ajrhacker/dasm_override Miodrag Milanović2016-07-011-6/+0
|\ | | | | Move disasm overrides into interface, reducing driver-debugger depend…
| * Move disasm overrides into interface, reducing driver-debugger dependencies (nw) AJR2016-06-241-6/+0
| |
* | Cleanup and version bumpmame0175 Miodrag Milanovic2016-06-291-20/+19
|/
* Eliminate some unnecessary pass-through methods from debugcpu (nw) AJR2016-06-221-6/+1
|