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

Fix build failures when compiling Cutter with Rizin's dev #3247

Merged
merged 5 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cmake/BundledRizin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif()

# TODO: This version number should be fetched automatically
# instead of being hardcoded.
set (Rizin_VERSION 0.6)
set (Rizin_VERSION 0.7)

set (RZ_LIBS rz_core rz_config rz_cons rz_io rz_util rz_flag rz_asm rz_debug
rz_hash rz_bin rz_lang rz_il rz_analysis rz_parse rz_bp rz_egg rz_reg
Expand Down
2 changes: 1 addition & 1 deletion rizin
Submodule rizin updated 308 files
21 changes: 10 additions & 11 deletions src/core/Cutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,9 @@ void CutterCore::continueUntilSyscall()
} else {
if (!asyncTask(
[](RzCore *core) {
rz_cons_break_push(reinterpret_cast<RzConsBreak>(rz_debug_stop), core->dbg);
rz_cons_break_push(
[](void *x) { rz_debug_stop(reinterpret_cast<RzDebug *>(x)); },
core->dbg);
rz_reg_arena_swap(core->dbg->reg, true);
rz_debug_continue_syscalls(core->dbg, NULL, 0);
rz_cons_break_pop();
Expand Down Expand Up @@ -2681,8 +2683,8 @@ void CutterCore::addBreakpoint(const BreakpointDescription &config)
moduleNameData = config.positionExpression.toUtf8();
module = moduleNameData.data();
}
breakpoint = rz_debug_bp_add(core->dbg, address, (config.hw && watchpoint_prot == 0),
watchpoint_prot, watchpoint_prot, module, config.moduleDelta);
breakpoint = rz_debug_bp_add(core->dbg, address, config.size, config.hw, (watchpoint_prot != 0),
watchpoint_prot, module, config.moduleDelta);
if (!breakpoint) {
QMessageBox::critical(nullptr, tr("Breakpoint error"), tr("Failed to create breakpoint"));
return;
Expand Down Expand Up @@ -3107,16 +3109,14 @@ QList<ImportDescription> CutterCore::getAllImports()
if (!bf) {
return {};
}
const RzList *imports = rz_bin_object_get_imports(bf->o);
const RzPVector *imports = rz_bin_object_get_imports(bf->o);
if (!imports) {
return {};
}

QList<ImportDescription> qList;
RzBinImport *import;
RzListIter *iter;
bool va = core->io->va || core->bin->is_debugger;
CutterRzListForeach (imports, iter, RzBinImport, import) {
for (const auto &import : CutterPVector<RzBinImport>(imports)) {
if (RZ_STR_ISEMPTY(import->name)) {
continue;
}
Expand Down Expand Up @@ -3557,17 +3557,16 @@ QList<BinClassDescription> CutterCore::getAllClassesFromBin()
return {};
}

const RzList *cs = rz_bin_object_get_classes(bf->o);
const RzPVector *cs = rz_bin_object_get_classes(bf->o);
if (!cs) {
return {};
}

QList<BinClassDescription> qList;
RzListIter *iter, *iter2, *iter3;
RzBinClass *c;
RzListIter *iter2, *iter3;
RzBinSymbol *sym;
RzBinClassField *f;
CutterRzListForeach (cs, iter, RzBinClass, c) {
for (const auto &c : CutterPVector<RzBinClass>(cs)) {
BinClassDescription classDescription;
classDescription.name = c->name;
classDescription.addr = c->addr;
Expand Down
2 changes: 1 addition & 1 deletion src/translations
Submodule translations updated 1 files
+41 −41 de/cutter_de.ts
36 changes: 18 additions & 18 deletions src/widgets/Dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void Dashboard::updateContents()
int static_value = rz_bin_is_static(core->bin);
setPlainText(ui->staticEdit, tr(setBoolText(static_value)));

RzList *hashes = bf ? rz_bin_file_compute_hashes(core->bin, bf, UT64_MAX) : nullptr;
const RzPVector *hashes = bf ? rz_bin_file_compute_hashes(core->bin, bf, UT64_MAX) : nullptr;

// Delete hashesWidget if it isn't null to avoid duplicate components
if (hashesWidget) {
Expand All @@ -94,23 +94,23 @@ void Dashboard::updateContents()
ui->hashesVerticalLayout->addWidget(hashesWidget);

// Add hashes as a pair of Hash Name : Hash Value.
RzListIter *iter;
RzBinFileHash *hash;
CutterRzListForeach (hashes, iter, RzBinFileHash, hash) {
// Create a bold QString with the hash name uppercased
QString label = QString("<b>%1:</b>").arg(QString(hash->type).toUpper());

// Define a Read-Only line edit to display the hash value
QLineEdit *hashLineEdit = new QLineEdit();
hashLineEdit->setReadOnly(true);
hashLineEdit->setText(hash->hex);

// Set cursor position to begining to avoid long hashes (e.g sha256)
// to look truncated at the begining
hashLineEdit->setCursorPosition(0);

// Add both controls to a form layout in a single row
hashesLayout->addRow(new QLabel(label), hashLineEdit);
if (hashes != nullptr) {
for (const auto &hash : CutterPVector<RzBinFileHash>(hashes)) {
// Create a bold QString with the hash name uppercased
QString label = QString("<b>%1:</b>").arg(QString(hash->type).toUpper());

// Define a Read-Only line edit to display the hash value
QLineEdit *hashLineEdit = new QLineEdit();
hashLineEdit->setReadOnly(true);
hashLineEdit->setText(hash->hex);

// Set cursor position to begining to avoid long hashes (e.g sha256)
// to look truncated at the begining
hashLineEdit->setCursorPosition(0);

// Add both controls to a form layout in a single row
hashesLayout->addRow(new QLabel(label), hashLineEdit);
}
}

st64 fcns = rz_list_length(core->analysis->fcns);
Expand Down