debugger: Add list of input and output registers.

So the debugger can show them during stepping.
The fmt_* functions now take a PPCDisasmContext instead of just the ctx->instr_str so that they can alter the context.
Some fmt_* functions have an alternate (e.g. fmt_twoop_in for fmt_twoop) to indicate a difference in input/output registers.
The mtsrin and mfsrin instructions use a register to indicate which sr register to use.
The string instructions may affect multiple registers but only the first is included in the list.
Removed some extra blank lines.

Fixes:
lscbx: Add r0 check.
mftb: Do simplified if the spr is illegal. Maybe should do illegal opcode instead?
This commit is contained in:
joevt 2023-08-07 12:41:29 -07:00 committed by dingusdev
parent cd77e361ab
commit c5ac862cef
2 changed files with 734 additions and 204 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,12 +24,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <cinttypes>
#include <string>
#include <vector>
typedef struct PPCDisasmContext {
uint32_t instr_addr;
uint32_t instr_code;
std::string instr_str;
bool simplified; /* true if we should output simplified mnemonics */
std::vector<std::string> regs_in;
std::vector<std::string> regs_out;
} PPCDisasmContext;
std::string disassemble_single(PPCDisasmContext* ctx);