summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcpu.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Debugger: fix f10 step over of instructions with a branch delay slot [smf] smf-2018-02-211-1/+1
|
* *DUH*, also fix MT6857 (nw) Olivier Galibert2018-01-281-4/+4
|
* debugcpu.cpp: added missing initialization of m_vblank_occurred (nw) Oliver Stöneberg2018-01-061-0/+1
|
* debugcpu.cpp: Eliminate unnecessary downcast (nw) AJR2018-01-051-2/+5
|
* Eliminate machine().firstcpu (nw) AJR2018-01-041-1/+6
|
* space.machine -> machine (nw) Olivier Galibert2017-12-141-2/+2
|
* Revert "Revert "Merge branch 'master' of https://github.com/mamedev/mame"" Firehawke2017-12-131-65/+33
| | | | This reverts commit 54155441e9ba9941e85d80c4834a66376a11e791.
* Revert "Merge branch 'master' of https://github.com/mamedev/mame" Firehawke2017-12-131-33/+65
| | | | | This reverts commit f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4, reversing changes made to 0d70d798107d4e4e8fb9f230410aeb1e888d65c5.
* Fix watchpoint hit message for address-shifted processors (nw) AJR2017-12-061-2/+2
|
* Merge pull request #2897 from vadosnaprimer/rewind R. Belmont2017-12-061-0/+8
|\ | | | | Rewind feature and RAM savestates.
| * Rewind feature and RAM savestates. vadosnaprimer2017-12-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This starts the work requested in #2398. How RAM states work. Implemented using util::vectorstream. Instead of dumping m_save.m_entry_list to file, it writes them as binary to vectorstream. Compression is not used, as it would slow down the process. The header is written as usual, also in binary. When a state is loaded, the savestate data gets binary-read from vectorstream. How rewind works. Rewind is optional, it can be turned off through MAME GUI while not running. Rewind capacity is available there too. Rewind step hotkey is available from the standard hotkey menu. In the debugger you have the "rewind" command ("rw" shortcut) that works the same as the hotkey. Every time you advance a frame (pause step), rewinder captures a RAM savestate of the frame you were at. It does the same when you do step into/over/out in the debugger. Every time it captures a new state (and when you unpause), it marks as invalid all its states that go after the current machine time, because input might change, so they are not relevant anymore. It keeps their buffers allocated though, for future use. When rewinder runs out of allowed amount of savestates it can have, it invalidates the first state in the list and tosses its unique_ptr to the end of the list, then it uses its buffer to capture a new state. When you hit the rewind step key, or use "rewind" command in the debugger, it loads a state that is immediately before the current machine time. Invalid states between valid ones are not allowed to appear, as that breaks rewinder integrity and causes problems. Rewinder keeps its own set of ram states as a vector of unique_ptr's. All rewinder operations and errors get reported using machine().popmessage().
* | More fixes and simplifications (nw) Olivier Galibert2017-12-031-63/+23
|/
* Fix non-initialized member of debugcpu (nw) Olivier Galibert2017-11-301-0/+1
|
* (nw) misc cleanup: start replacing auto_alloc_* with smart pointers, get Vas Crabb2017-12-011-53/+43
| | | | | rid of reference constants in the debugger in favour of capturing the value in the bind/lambda (less ugly casting)
* emumem: API change [O. Galibert] Olivier Galibert2017-11-291-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * direct_read_data is now a template which takes the address bus shift as a parameter. * address_space::direct<shift>() is now a template method that takes the shift as a parameter and returns a pointer instead of a reference * the address to give to {read|write}_* on address_space or direct_read_data is now the address one wants to access Longer explanation: Up until now, the {read|write}_* methods required the caller to give the byte offset instead of the actual address. That's the same on byte-addressing CPUs, e.g. the ones everyone knows, but it's different on the word/long/quad addressing ones (tms, sharc, etc...) or the bit-addressing one (tms340x0). Changing that required templatizing the direct access interface on the bus addressing granularity, historically called address bus shift. Also, since everybody was taking the address of the reference returned by direct(), and structurally didn't have much choice in the matter, it got changed to return a pointer directly. Longest historical explanation: In a cpu core, the hottest memory access, by far, is the opcode fetching. It's also an access with very good locality (doesn't move much, tends to stay in the same rom/ram zone even when jumping around, tends not to hit handlers), which makes efficient caching worthwhile (as in, 30-50% faster core iirc on something like the 6502, but that was 20 years ago and a number of things changed since then). In fact, opcode fetching was, in the distant past, just an array lookup indexed by pc on an offset pointer, which was updated on branches. It didn't stay that way because more elaborate access is often needed (handlers, banking with instructions crossing a bank...) but it still ends up with a frontend of "if the address is still in the current range read from pointer+address otherwise do the slowpath", e.g. two usually correctly predicted branches plus the read most of the time. Then the >8 bits cpus arrived. That was ok, it just required to do the add to a u8 *, then convert to a u16/u32 * and do the read. At the asm level, it was all identical except for the final read, and read_byte/word/long being separate there was no test (and associated overhead) added in the path. Then the word-addressing CPUs arrived with, iirc, the tms cpus used in atari games. They require, to read from the pointer, to shift the address, either explicitely, or implicitely through indexing a u16 *. There were three possibilities: 1- create a new read_* method for each size and granularity. That amounts to a lot of copy/paste in the end, and functions with identical prototypes so the compiler can't detect you're using the wrong one. 2- put a variable shift in the read path. That was too expensive especially since the most critical cpus are byte-addressing (68000 at the time was the key). Having bit-adressing cpus which means the shift can either be right or left depending on the variable makes things even worse. 3- require the caller to do the shift himself when needed. The last solution was chosen, and starting that day the address was a byte offset and not the real address. Which is, actually, quite surprising when writing a new cpu core or, worse, when using the read/write methods from the driver code. But since then, C++ happened. And, in particular, templates with non-type parameters. Suddendly, solution 1 can be done without the copy/paste and with different types allowing to detect (at runtime, but systematically and at startup) if you got it wrong, while still generating optimal code. So it was time to switch to that solution and makes the address parameter sane again. Especially since it makes mucking in the rest of the memory subsystem code a lot more understandable.
* dvdisasm: Overhaul [O. Galibert] Olivier Galibert2017-11-261-85/+28
| | | | | | | | 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.
* Explicitly allow floating point values for state registers AJR2017-10-131-2/+6
| | | | Note that the internal debugger's expression interpreter is not set up to handle floating point values at all, so they remain disabled there.
* device_state_interface: Polymorphism and std::function for entries (nw) (#2690) ajrhacker2017-10-121-1/+1
| | | | | | | | | | | * device_state_interface: Polymorphism and std::function for entries (nw) - Create a templated subclass of device_state_entry to provide separate read/write interfaces for registers of varying widths. The efficiency impact of this should be minimal, given that this eliminates the need to make each byte width a subcase for reads and writes. - Create similarly templated "pseudo-register" versions of device_state_entry that provides custom read/write interfaces through std::function. The intent of this is to eventually replace the dummy register + state_export interface hitherto necessary to provide debugger access to bankswitched or computed state registers. - State registers can now be made read-only, and this is automatically done now when state_add is called with a std::function read handler but no write handler. This property is honored by MAME debug expressions. * Add override keyword (nw) * Remove explicit instantiations that were causing linking errors in tools build (nw)