path: root/src/emu/debug/debugcpu.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Reallow debugger single-step command to break into subroutines during ↵ AJR2022-09-141-0/+4
| | | | over/out stepping
* Debugger changes AJR2022-08-281-66/+145
| | | | | | | - 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-17/+92
| | | | | | | | - 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
* Remove fileio.h from emu.h AJR2022-02-111-0/+1
* Addressed some Lua scripting pitfalls. (#9294) Vas Crabb2022-02-121-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+28
| | | | | | | | | | | | | | | | | | 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-4/+19
| | | | | | - 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
* Make debugger 'out' command step over return delay slots on SH architectures AJR2021-09-221-1/+9
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-4/+4
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* Debugger-related feature removals and cleanup AJR2021-08-151-90/+1
| | | | | | | | - 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/+3
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-1/+1
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Update state views when memory is modified through the debugger (since ↵ AJR2021-02-091-0/+1
| | | | registers can be memory-mapped)
* Much more core std::string_view modernization AJR2021-01-201-2/+2
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* frontend: Lua engine improvements. Vas Crabb2020-11-301-1/+2
| | | | | | | | | | | | | | Added methods for enabling and disabling breakpoints and watchpoints, and made debugger views update when breakpoints/watchpoints are manipulated from Lua. Made breakpoints and watchpoints objects rather than tables. (It’s not possible to enable/disable a breakpoint or watchpoint from the object itself, you have to go through its owners' debug interface.) Exposed more device_t members for dealing with child/sibling tags and devices. Also provided a way to get regions/shares/banks from a device using relative tags rather than going through the memory manager with absolute tags.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* -util/xmlfile: Escape attribute and element content. Vas Crabb2020-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | The previous behaviour was unintuitive - parsing an XML file and writing it out immediately would produce invalid XML if the file contained any characters that needed escaping. It makes far more sense to escape on writing rather than expecting the user to escape input. -Add preliminary support for visibility toggles to artwork system. This allows the user to show/hide related elements in a view, with nesting. The view can specify whether elements are shown or hidden by default. Settings are saved per host window/screen per view. There is no way to set the initial visibility state on the command line. Legacy "Space Invaders cabinet model" layers are mapped onto visibility toggles. This is not stable yet. In particular, the XML element/attribute names have not been finalised. The new features have not been added to to prevent them from being used before they're finalised.
* device_state_interface overhaul AJR2020-08-311-2/+2
| | | | | | | | | | | - device_state_entry::value and device_state_entry::set_value now do everything except the register lookup, allowing them to be made public. The debugger expression engine now uses these. - device_state_entry::dvalue and device_state_entry::set_dvalue have also been made public, theoretically permitting outside code layers to inspect and modify floating-point registers. - The double specialization of device_pseudo_state_register (now renamed device_functional_state_register) has been added to the core. - state_add now has an additional specialization that takes both a reference and a write function, using the former for reads only. - state_max_length has been eliminated in favor of obtaining the relevant info through device_state_entry::max_length. - The debugger state view no longer adds "flags" as "???" if none have been registered. - set_state_string has been removed. It was never properly implemented, and it is difficult to see how it could have been done in a useful and consistent way. - state_find_entry and its typical callers state_int and set_state_int have been inlined for some hopeful efficiency gains.
* Debugger expression and memory access overhaul AJR2020-05-251-1336/+59
| | | | | | | | | | | | | - 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.
* Fix recent debugger regression with systems such as fi6845/fi8275 where a ↵ AJR2020-05-081-1/+8
| | | | DMAC or other non-focusable executing device is scheduled first of all (nw)
* Fix focus command (nw) AJR2020-05-071-1/+4
* Add optional condition parameter to debugger gex command AJR2020-05-031-7/+24
* Add PC to debugger exception hit message AJR2020-05-031-1/+1
* Refocus debugger on CPU when one of its watchpoints is hit. This solution ↵ AJR2020-05-031-8/+25
| | | | may be less than ideal for some multiprocessing environments where CPUs share spaces, but it prevents the focus from shifting unpredictably to whichever CPU happens to be next in line to execute (e.g. when synchronization for a soundlatch write aborts the original CPU's timeslice).
* Make expressions octal for applicable address spaces in disassembly view AJR2020-04-131-155/+56
| | | | | | | | | | 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
* (nw) Cleanup on the way: Vas Crabb2020-03-101-2/+2
| | | | | | | | | | * Add doxygen comments for bit manipulation functions * Add an overload of BIT that works like the AArch64 UBFX instruction * Kill off some of the silly concatenating overloads for emu_file::open * Make searchpath acually useful for devices This is a checkpoint - I'm planning to improve ROM loading behaviour at least a little.
* Use std::forward_list for breakpoint and registerpoint lists (nw) AJR2019-09-101-59/+59
* 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
* Fix fatal error when attempting to set watchpoint covering unaligned ↵ AJR2019-06-121-4/+7
| | | | portions of two adjacent native words
* mu100: Add missing roms, also some wip [Guru, O. Galibert] Olivier Galibert2018-12-061-3/+3
* watchpoint: prevent recursive multiple installs [O. Galibert] Olivier Galibert2018-12-061-6/+13
* debugger: add 'gp' command Sven Schnelle2018-11-061-1/+47
| | | | | | | | | | | | | | 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: Fixed watchpoints for CPUs with a negative address shift. [Ryan Holtz] mooglyguy2018-09-301-2/+2
* Don't apply logical address masks to physical addresses in debug memory ↵ AJR2018-08-121-76/+72
| | | | accesses (nw)
* debugcpu.cpp: Move scripting functions down into console (nw) AJR2018-07-261-70/+2
* (nw) srcclean and some cleanup: Vas Crabb2018-07-221-1/+1
| | | | | | * Make more #include guards follow standard format - using MAME_ as the prefix makes it easy to see which ones come from our code in a preprocessor dump, and having both src/devices/machine/foo.h and src/mame/machine/foo.h causes issues anyway * Get #include "emu.h" out of headers - it should only be the first thing in a complilation unit or we get differences in behaviour with PCH on/off * Add out-of-line destructors to some devices - it forces the compiler to instantiate the vtable in a certain location and avoids some non-deterministic compiler behaviours
* Fix some watchpoints (nw) Olivier Galibert2018-07-131-2/+2
* Watchpoint fixes (segfaults, wpclear not clearing) (nw) Olivier Galibert2018-07-091-2/+6
* Various watchpoint fixes (nw) Olivier Galibert2018-07-011-2/+4
* Oops (nw) Olivier Galibert2018-06-291-1/+1
* emumem: Backend modernization [O. Galibert] Olivier Galibert2018-06-291-227/+342
* Kludge some absolute tag lookups in the core that can't really be helped (nw) AJR2018-05-211-2/+2
* debug: Simplify now obsolete and buggy memory access code [O. Galibert] Olivier Galibert2018-05-111-94/+24
* srcclean (nw) Vas Crabb2018-04-221-6/+6
* remove safe_pc() and safe_pcbase() (nw) smf-2018-04-131-4/+4
* Added suspend and resume debugger commands (#3411) GavinAndrews2018-04-021-0/+23
* fix scheduling session events from debugger (nw) Vas Crabb2018-03-291-1/+1
* Reshuffle some stuff: Vas Crabb2018-03-281-89/+35
| | | | | | * 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
* Remove all uses of first_screen() from core files, nw Ryan Holtz2018-03-111-9/+22
* Grammar police (nw) Olivier Galibert2018-02-241-9/+9