Skip to content
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

Mips Support #14

Merged
merged 2 commits into from
Jun 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions rz-tracetest/adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,28 @@ class I8051TraceAdapter : public TraceAdapter {
}
};

class MipsTraceAdapter : public TraceAdapter {
public:
std::string RizinArch() const override {
return "mips";
}

int RizinBits(std::optional<std::string> mode, std::optional<uint64_t> machine) const override {
// if (mode) {
// return (mode.value() == FRAME_MODE_MIPS64) ? 64 : 32;
// }
return machine.value();
}

bool IgnorePCMismatch(ut64 pc_actual, ut64 pc_expect) const override {
return false;
}

bool IgnoreUnknownReg(const std::string &rz_reg_name) const {
return true;
}
};

std::unique_ptr<TraceAdapter> SelectTraceAdapter(frame_architecture arch) {
switch (arch) {
case frame_arch_6502:
Expand All @@ -278,6 +300,8 @@ std::unique_ptr<TraceAdapter> SelectTraceAdapter(frame_architecture arch) {
return std::unique_ptr<TraceAdapter>(new PPCTraceAdapter());
case frame_arch_8051:
return std::unique_ptr<TraceAdapter>(new I8051TraceAdapter());
case frame_arch_mips:
return std::unique_ptr<TraceAdapter>(new MipsTraceAdapter());
default:
return nullptr;
}
Expand Down