-
Notifications
You must be signed in to change notification settings - Fork 2.3k
cpu/mips3: Fix DRC debugger interaction for register and memory modifications #14944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ | |
|
|
||
| #include "emuopts.h" | ||
|
|
||
| #include "debug/express.h" | ||
|
|
||
| #include <cmath> | ||
|
|
||
| #define ENABLE_OVERFLOWS (0) | ||
|
|
@@ -180,6 +182,7 @@ mips3_device::mips3_device(const machine_config &mconfig, device_type type, cons | |
| , m_drcfe(nullptr) | ||
| , m_drcoptions(0) | ||
| , m_drc_cache_dirty(0) | ||
| , m_drc_iregs_dirty(0) | ||
| , m_entry(nullptr) | ||
| , m_nocode(nullptr) | ||
| , m_out_of_cycles(nullptr) | ||
|
|
@@ -239,6 +242,14 @@ void mips3_device::device_stop() | |
| } | ||
| } | ||
|
|
||
| void mips3_device::device_debug_setup() | ||
| { | ||
| if (!m_isdrc) return; | ||
| debug()->symtable().set_memory_modified_func( | ||
| [this]() { m_drc_cache_dirty = true; } | ||
| ); | ||
|
Comment on lines
+248
to
+250
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't want to be doing this for every memory modification from the debugger - it's too expensive when most of the time, people will just be modifying data memory.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cache invalidation is triggered when editing the ':maincpu' program space, not through any other spaces/regions. |
||
| } | ||
|
|
||
| /*************************************************************************** | ||
| EXECEPTION HANDLING | ||
| ***************************************************************************/ | ||
|
|
@@ -826,7 +837,7 @@ void mips3_device::state_import(const device_state_entry &entry) | |
| // this refers to HI as R32 and LO as R33 because I'm lazy | ||
| const unsigned regnum = entry.index() - MIPS3_R0; | ||
| if (m_regmap[regnum].is_int_register()) | ||
| logerror("debugger R%u = %08X, must update UML I%u\n", regnum, m_core->r[regnum], m_regmap[regnum].ireg() - uml::REG_I0); | ||
| m_drc_iregs_dirty = true; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rest of this file uses Allman brace style, so this should too for consistency.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's quite a few one line if/else statements in the file without braces, i kept it as it, should i update it and update the other occurrences or leave it ? |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,7 @@ | |
| #define DEBUG_STRICT_VERIFY 0 | ||
|
|
||
|
|
||
|
|
||
| /*************************************************************************** | ||
| MACROS | ||
| ***************************************************************************/ | ||
|
|
@@ -1366,9 +1367,15 @@ void mips3_device::generate_sequence_instruction(drcuml_block &block, compiler_s | |
| /* if we are debugging, call the debugger */ | ||
| if (debugger_enabled()) | ||
| { | ||
| uml::code_label skip_reload = compiler.labelnum++; | ||
| UML_MOV(block, mem(&m_core->pc), desc->pc); // mov [pc],desc->pc | ||
| save_fast_iregs(block); | ||
| UML_DEBUG(block, desc->pc); // debug desc->pc | ||
| UML_DEBUG(block, desc->pc); // debug desc->pc | ||
| UML_TEST(block, mem(&m_drc_iregs_dirty), 1); // test [debugger_iregs_dirty],1 | ||
| UML_JMPc(block, COND_Z, skip_reload); // jmp skip_reload,Z | ||
| UML_MOV(block, mem(&m_drc_iregs_dirty), 0); // mov [debugger_iregs_dirty],0 | ||
| load_fast_iregs(block); // <load fast integer registers> | ||
| UML_LABEL(block, skip_reload); // skip_reload: | ||
|
Comment on lines
-1371
to
+1378
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Considering how frequently this is going to occur, would it be better to turn it into a helper function to keep generated code size down?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure to understand what's expected to be done, any guidance ? |
||
| } | ||
|
|
||
| /* if we hit an unmapped address, fatal error */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also should be Allman style.