Commit Graph

31 Commits

Author SHA1 Message Date
Vas Crabb
360d3a5950
debugger: Extended target address syntax to include device/address space. (#8630)
Added a validity check to ensure address space names are tag-like and unique, since they're now used as identifiers in debugger commands.

Extended the syntax for target addresses to allow them to be qualified with a colon followed by an optional device tag and/or address space name.  If only the device needs to be specified, a debugger CPU number may also be used.  This makes commands like bpset and wpset more flexible, as they can operate on CPUs other than the currently visible CPU.  Commands like find, fill, dump and load are more flexible as they can access any space of any device.

Removed now-redundant CPU parameters from many commands, and renamed pcatmemp to pcatmem for consistency with other commands.  Extended region syntax for saver/loadr to support tags relative to the visible CPU (e.g. you can use "." for the region with the same name as the visible CPU, or "^sibling" syntax).  Added an optional root device parameter to memdump.  Changed interpretation of Boolean values to support numeric expressions as well as true/false strings and literal 1/0.

Added checks that the specified device is CPU-like to various commands that require a CPU (e.g. focus).  Previously these commands would crash or trigger an assertion failure if a tag for a non-CPU devices was specified.

Fixed the cpunum symbol so it uses the same rules for determining what is or isn't a CPU as parameter parsing.

Made device_t sanitise subtags better.  Previously you could cause an assertion failure or crash MAME by giving it unexpected relative tags via Lua or the debugger.

Added help topic alias support, and reworked the data structures to improve the performance of looking up debugger commands and help topics.  Removed the "ref" parameter from debugger command functions (std::bind can hold extra argument values for you if you need them).  Also added an error message if duplicate debugger commands are registered.

Updated help for commands that changed syntax, and also updated summaries for some commands that had changed in the past without corresponding help updates.
2021-10-01 05:26:11 +10:00
Vas Crabb
538221861b -emu/dirom.{h,ipp}: Cleaned up and made it stricter.
* Made it an error to specify address map and explicit ROM region.
 * Made it an error if explicitly specified ROM region is not found.
 * Made the ROM region tag apply relative to the current device.

-Cleaned up formatting for a couple more documentation pages.
2020-11-09 03:55:50 +11:00
AJR
1baa0775e6 device.cpp, dimemory.cpp: Correct typos in comments 2020-07-21 17:42:05 -04:00
hap
128640144a emu: correct some file headers (nw) 2020-06-19 12:38:41 +02:00
AJR
20677c7a1b Add rudimentary validity checking for address_space_config objects (nw) 2019-10-04 12:33:07 -04:00
AJR
b4e395e74e dimemory: Reimplement aa0d17757d9e5857bb99887841133045cc530655 correctly; reading past the end of a std::vector is not a good thing to do (nw) 2018-11-28 02:55:46 +11:00
AJR
6b39fdbc84 Revert "diemory: Still should be validating all configured address spaces, whether or not they have external maps (nw)"
At least on my build, MAME thinks maps are being configured for nonexistent AS_DATA spaces when they clearly aren't. This may be due to some subtle bug with device delegates.

This reverts commit aa0d17757d9e5857bb99887841133045cc530655.
2018-11-28 02:55:45 +11:00
AJR
868cfc5289 diemory: Still should be validating all configured address spaces, whether or not they have external maps (nw) 2018-11-28 02:55:45 +11:00
AJR
775ffe871a dimemory: Make validity checker warn about configured maps for nonexistent spaces (nw) 2018-11-28 02:55:45 +11:00
AJR
ac355d1559 Apply logical address mask properly in debug disassembly view
Associated core changes (nw)
- Move definition of address_space_config from dimemory.cpp to emumem.cpp (declaration was already in emumem.h)
- Add getters for more members of address_space_config with future privatization in mind (nw)
2018-08-24 22:20:54 -04:00
Olivier Galibert
a704ed7b1b emumem: Backend modernization [O. Galibert] 2018-06-29 20:04:28 +02:00
Olivier Galibert
c521964316 API change: Memory maps are now methods of the owner class [O. Galibert]
Also, a lot more freedom happened, that's going to be more visible
soon.
2018-02-12 10:04:52 +01:00
Olivier Galibert
7c8a1fa409 Pet peeving with extreme prejudice (nw) 2017-11-30 12:29:32 +01:00
Vas Crabb
1e8c0b23c3 This is too contentious, please put it up for review
Revert "Changes to debugger memory address translation"

This reverts commit bb0964f9a2.
2017-08-01 15:19:44 +10:00
AJR
bb0964f9a2 Changes to debugger memory address translation
- 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.
2017-08-01 00:21:19 -04:00
Vas Crabb
66de90675f Make device_memory_interface own its address_spaces 2017-07-13 15:35:18 +10:00
Vas Crabb
536b2153d9 make device_memory_interface slightly less of a special case, use a typedef to avoid nested templates everywhere (nw) 2017-07-10 19:35:07 +10:00
Olivier Galibert
cbbbd07484 dimemory: Lift the cap on the number of address spaces per device [O. Galibert] 2017-07-03 08:03:57 +02:00
Olivier Galibert
998e196d55 dimemory: Remove the magic bypass [O. Galibert] 2016-12-10 13:40:26 +01:00
Vas Crabb
8179a84458 Introduce u8/u16/u32/u64/s8/s16/s32/s64
* 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
2016-11-19 05:38:48 +11:00
Olivier Galibert
8536c82ba1 addrmap: Remove device parameter [O. Galibert] 2016-11-09 12:27:40 +01:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
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
2016-10-22 13:13:17 +02:00
AJR
af80bf0e69 Validity checking improvements
- Always print the name of each driver checked with -validate -verbose, and print before beginning the check to help detect crashes
- Fix already_checked test so that softlists get validated the first time, not every time but the first
- Remove #include "validity.h" where not required (nw)
- attotime::from_double cannot be constexpr because it uses floor (nw)
2016-07-27 09:12:55 -04:00
AJR
a7e393b36b Iterate over core classes C++11 style
C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.)

device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config.

memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
2016-03-31 09:43:53 -04:00
AJR
7750a10135 Make octal flag part of address_space/address_space_config, not (illogically) device_execute_interface (nw) 2016-02-04 17:10:53 -05:00
Miodrag Milanovic
4e8e3066f8 reverting:
SHA-1: 1f90ceab07

* tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
2016-01-20 21:42:13 +01:00
Miodrag Milanovic
1f90ceab07 tags are now strings (nw)
fix start project for custom builds in Visual Studio (nw)
2016-01-16 14:54:42 +01:00
AJR
de31dfcf58 Refactoring memory map validity checking 2015-12-19 18:22:19 -05:00
Miodrag Milanovic
91605d3f4d clang-modernize part 1 (nw) 2015-12-03 18:17:25 +01:00
Miodrag Milanovic
61d05aacb8 Fixed some suggestions by ReSharper C++ (nw) 2015-11-14 19:05:18 +01:00
Miodrag Milanovic
7c19aac60e Rename *.c -> *.cpp in our source (nw) 2015-11-08 12:56:12 +01:00