summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug (follow)
Commit message (Collapse)AuthorAgeFilesLines
* emu/debug/debugcmd.cpp: Add NUL-terminated string argument support to ↵ Patrick Mackinlay8 days2-33/+84
| | | | | | | printf/logerror. (#12124) * Use %s to read NUL-terminated strings from emulated memory. Precision sets maximum length. * Also added left-justification option for numeric and string formats. * Made documentation more consistent and removed duplication.
* emu/debug/debugcmd.cpp: Added support for lowercase hex to printf/logerror. ↵ Vas Crabb9 days3-71/+49
| | | | | | | | | [Patrick Mackinlay] Also simplified implementation by better leveraging util/strformat.h. This is from pull request #12124, to get some testing for the fundamental change before freeze.
* coreutil.h: Eliminate core_crc32 wrapper function in favor of ↵ AJR2024-02-261-2/+1
| | | | util::crc32_creator
* Clean up several sprintf() deprecation warningss in non-3rdparty code. [R. ↵ arbee2023-06-033-6/+6
| | | | Belmont]
* debughlp: document gp command Patrick Mackinlay2023-05-231-1/+23
|
* Restored ability of for image devices to report specific error messages. Vas Crabb2023-04-081-4/+12
| | | | | | | | | | | | | | Restores ability to give specific/detailed messages removed in 6f7e4141ea14acaaf9cb973c66788fabb3457023 while pandering to obsession with single return value. Moved responsibility for displaying the error message in the UI to the caller rather than device_image_interface, and made device_image_interface always log the error along with the full path and error condition content. Gave several image devices more detailed error messages. Added some FIXME comments for apparent bugs.
* Improvements to debugger 'map' command AJR2023-04-021-4/+5
| | | | | - Add names of physical and logical spaces now that one space can map to another - Correct usage of address space masks
* API change for device_image_interface AJR2023-03-301-2/+3
| | | | | | | | | - Remove the seterror method for recording error messages and conditions. Condition codes have been made return values for call_load, call_create and various related callbacks. Error messages (which many devices weren't generating) are now displayed through osd_printf_error. - Eliminate the image_init_result and image_verify_result pass/fail enumeration types. Update many functions that were returning these enumerations or simply bools to return std::error_condition instead. In some cases, this type is now passed down from internal parsing/loading functions which were already returning it. In various other cases, the former default UNSPECIFIED has been used as a catchall for I/O errors; anticipated future refactorings should make these error returns more specific. - Expand the image_error categories to include INVALIDLENGTH, NOSOFTWARE and BADSOFTWARE. The first is largely self-explanatory. The second is generated by the core to indicate failure to find software items in lists. The third is provided for devices to indicate semantic errors in software list entries. - Change the return type of floppy_image_device::identify to a pair so the potential error condition can be passed along to the UI without storing it in a member variable. - Move device_image_interface::message down into snapshot_image_device and change its implementation to use string_format instead of printf. - Correct a typo in the shortname of the generic snapshot device.
* debugbuf.cpp: Note flaw in design AJR2023-03-301-0/+2
|
* Apply workaround for debugger history command consuming ridiculous amounts ↵ AJR2023-03-291-1/+1
| | | | of memory when jumping around large address spaces
* Various optimisations to code generaton. Vas Crabb2023-03-264-14/+14
| | | | | | | | | | | | | | | 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.
* mcs96: Translate first 256 bytes of main memory space to register space AJR2023-03-191-0/+2
| | | | * dvmemory.cpp: Fix oversight in recent refactoring (uninitialized variable)
* dimemory: Add the target address space to translate, wrap the constants Olivier Galibert2023-03-184-90/+121
| | | | divtlb: Wrap the constants
* Interrupt callback rationalization AJR2023-03-112-7/+68
| | | | | | | | | | | - 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
* Fix debugger exception point hit message AJR2023-03-091-2/+2
|
* Various updates, mostly around Lua: Vas Crabb2023-03-071-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compile Lua as C++. When Lua is compiled as C, it uses setjmp/longjmp for error handling, resulting in failure to unwind intermediate stack frames. Trying to ensure no objects with non-trivial destructors are in scope when raising a Lua error is error-prone. In particular, converting an exception to a Lua error becomes convoluted, and raising a Lua error from a constructor is effectively impossible. Updated Lua to 5.4.4 - this includes a brand-new garbage collector implementation with better performance. The main thing removed is the deprecated bitlib. Updated sol2 to version 3.3.0 - this adds support for Lua 5.4 and fixes a number of issues, including not correctly handling errors when Lua is built as C++. Updated LuaFileSystem to version 1.8.0 - this adds support for symbolic links on Windows, as well as Lua 5.4 compatibility. Updated LuaSQLite3 to version 0.9.5 - this fixes issues in multi-threaded environments, as well as Lua 5.4 compatibility. Fixed double-free after attempting to construct a debugger expression from Lua with an invalid string, and exposed expression error to Lua in a better way. Added warning level print function to Lua. Fixed saving cheats with shift operators in expressions, although this code isn't actually used as there's no cheat editor.
* debughlp.cpp: Use ovectorstream instead of static char array and sprintf AJR2023-02-122-8/+11
|
* Various input and OSD refactoring: Vas Crabb2023-01-292-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd: Supply OSD object to modules on initialisation. Encapsulated some event handling in the OSD objects rather than leaving it in free functions. Put various stuff in namespaces. osd/modules/input: Enabled dinput, xinput and winhybrid modules for Windows SDL builds, and enabled background input for dinput and xinput (and by extension winhybrid) modules. Also fixed some COM and X11 resource leaks. osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match Windows, and exposed vertical and horizontal scroll as Z and rZ axes. Moved SDL UI event handling out of input devices into OSD object. osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's correctly identified as a relative axis (it maps to the scroll wheel equivalent). osd: Added an option to choose the network provider module. Mostly useful if you build with both TUN/TAP and pcap support included, or if you want to disable emulated networking completely. emu/input.cpp: Use a better strategy for assembling input code names that uses fewer temporary strings and doesn't require use of the non-Unicode-aware space trimming function (fixes MT08552). osd/modules/input_dinput.cpp: Improved polling logic. osd: Made various parts of the input code less dependent on concrete emu objects, and reduced inappropriately passing around the machine object. Made input modules less dependent on OSD implementation. Encapsulated some stuff and got rid of some vestigial newui and SDL1 support code. Cleaned up some interfaces. Moved OSD options classes to their own files. Prepare to remove main.h from emu.h - it's mostly used to get the application name, which the vast majority of emulated devices don't need to do.
* debugcon.h: Remove long-obsolete macros AJR2023-01-081-4/+0
|
* debugbuf.cpp: Don't use paged formats for addresses in disassembler output ↵ AJR2023-01-071-2/+2
| | | | unless logical address width exceeds page size
* Revert "Make numbers signed in debugger where it matters" Vas Crabb2022-11-272-29/+31
| | | | | | | | | | | | | | This reverts commit 922d5b3c81459173ce99970dca0e44825f0a4494. This broke an important use case with MIPS3 address comparisons no longer behaving intutively. It's also another case of a debugger change that wasn't followed through properly, with absolutely no attempt to update the internal debugger help or the documentation for the web site. I realise signed maths woud be a useful feature, for the debugger, but it needs to be done in a way that doesn't break important use cases.
* Make numbers signed in debugger where it matters AJR2022-11-162-31/+29
| | | | | | | - Perform signed calculations for /, %, >>, /=, %=, >>=, <, >, <=, >= operators in debugger expressions - Eliminate workarounds in debugger printf method for system printf not reliably handling 64-bit integers (a previous refactoring adopted strformat for this) - Output signed decimals for %d in debugger printf formats; also add %u format - Add two-argument sext function to debugger
* Move debugger command parameter validation helpers into debugger_console AJR2022-10-294-613/+619
|
* Reallow debugger single-step command to break into subroutines during ↵ AJR2022-09-141-0/+4
| | | | over/out stepping
* Fix regressions in debugger trace command from ↵ AJR2022-09-021-2/+3
| | | | d8d588262de1f11a529b208e470cff9b89a4cba6, including use-after-move issue
* Debugger changes AJR2022-08-289-152/+596
| | | | | | | - 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.
* misc: remove unused variables that may give compiler warning hap2022-08-231-2/+0
|
* ui/icorender.cpp: Revert initialisations that can hide real bugs. Vas Crabb2022-08-031-8/+7
| | | | | | | | | | | | | | | | | | MSVC isn't smart enough to detect that these can only be used after being assigned while clang and GCC can work it out fine. Initialising them to zero at declaration has the potential to mask real bugs if some code path tries to use them without assigning them. Code flow analysis (e.g. Coverity) or memory analysers (e.g. valgrind or Purify) won't pick up on the buggy path because the variable will technically be initialised. MSVC is problematic when it comes to warnings about uninitialised variables in general. Unfortunately MSVC has no option to selectively treat warnings as errors, unlike clang/GCC which have -Wno-error= which we use extensively. Until Microsoft addresses these issues, you'll have to use NOWERROR=1 when building with MSVC. Also, some cleanup.
* Change debugger command handler parameter vector element type from ↵ AJR2022-08-024-255/+267
| | | | std::string to std::string_view
* Prevent debugger commands from being evaluated when they are assignment ↵ AJR2022-06-111-1/+3
| | | | expressions and only supposed to be validated at the moment
* dvmemory.cpp: Small refactoring; verify that data written to memory spaces ↵ AJR2022-05-222-10/+38
| | | | read back as the same values
* debugger: Impose an arbitrary upper limit on the count parameter of the gni ↵ AJR2022-05-222-1/+8
| | | | command to prevent denial of service
* Add time command to MAME debugger. Returns current machine time. (#9727) tedgreen992022-05-083-0/+19
|
* Debugger feature improvements AJR2022-03-275-21/+220
| | | | | | | | - 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
* Fixed some debugger memory view annoyances and cleaned up Lua bindings. Vas Crabb2022-03-161-3/+17
| | | | | | | | | | | | Made the debugger memory view not depend on isprint which is affected by the global locale. Assume the OSD will display as ISO-8869-1 and replace problematic printable characters. Started changing Lua function bindings to use set_function to avoid potential issues related to ThePhD/sol2#608, and worked out what was causing problems with symbol table read_memory/write_memory. (They aren't really essential - you can do the same thing with the address space object itself, but they're easier to parameterise.)
* docs: Added page describing how MAME searches for media. Vas Crabb2022-03-101-5/+5
| | | | | | | Also made error messages for missing CHDs and missing files for software parts using the image file loader show search paths, and changed the (poorly named) bitbanger device to use the image file loader rather than the ROM loader for software items.
* debugcmd.cpp: Modernize implementation details of mini_printf AJR2022-02-282-50/+47
|
* debugcon.cpp: Use std::string_view in command parsing and eliminate initial ↵ AJR2022-02-212-140/+118
| | | | buffer copy
* Delete some unnecessary c_str() calls AJR2022-02-131-2/+2
|
* vegas.cpp: Cleanup: Vas Crabb2022-02-131-2/+2
| | | | | | | * Combine DUART interrupts. * Disabled SIO logging that had been left on. * Added system LED output and added it to sf0249 layout (hidden by default).
* Remove fileio.h from emu.h AJR2022-02-114-5/+11
|
* Addressed some Lua scripting pitfalls. (#9294) Vas Crabb2022-02-126-77/+88
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* frontend: Exposed memory pass-through handlers (address space taps) to Lua. Vas Crabb2022-02-101-40/+44
|
* Render-related cleanup AJR2021-12-301-0/+1
| | | | | | | - Undo inclusion of screen.h within render.h and update many source files that were stealth-including the former - Move texture_format enum to rendertypes.h - rendlay.h: Make a few methods static - ui/info.cpp: Use C++11-style iteration for render targets
* fixed size prefix in find command [smf] smf-2021-12-281-1/+1
|
* fixes for variables set but not used smf-2021-11-071-6/+6
|
* Debug memory view improvements AJR2021-10-272-37/+112
| | | | | | | | - Add options for 1-byte, 2-byte, 4-byte and 8-byte octal data display, which are selected automatically for memory spaces configured as octal. Octal data has also been made editable. - Add options for displaying addresses in decimal or octal as alternatives to the typical hexadecimal format. This also affects the address expression box. - Prevent the cursor from moving left from the first address or right from the maximum address. Note that the new options have only been hooked up for the Qt debugger. The Windows and OS X debuggers should also be updated to include them.
* srcclean in preparation for branching 0.237 release Vas Crabb2021-10-241-1/+1
|
* debugger: Memory accesses in expressions don't support taking the first ↵ Vas Crabb2021-10-201-3/+3
| | | | exposed space (yet).
* express.cpp: Fix regression in interpreting db@, ib@, ob@ and similar memory ↵ AJR2021-10-191-0/+4
| | | | access operators