diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 79192f8a..9c683625 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -585,7 +585,7 @@ QStringList CutterCore::autocomplete(const QString &cmd, RzLinePromptType prompt /** * @brief CutterCore::loadFile - * Load initial file. TODO Maybe use the "o" commands? + * Load initial file. * @param path File path * @param baddr Base (RzBin) address * @param mapaddr Map address @@ -2682,10 +2682,10 @@ QList CutterCore::getSeekHistory() { CORE_LOCK(); QList ret; - - QJsonArray jsonArray = cmdj("sj").array(); - for (const QJsonValue &value : jsonArray) - ret << value.toVariant().toULongLong(); + RzListIter *it; + RzCoreSeekItem *undo; + RzList *list = rz_core_seek_list(core); + CutterRListForeach(list, it, RzCoreSeekItem, undo) { ret << undo->offset; } return ret; } diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index 6a899239..0921293f 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -1127,14 +1127,26 @@ void MainWindow::updateHistoryMenu(QMenu *menu, bool redo) // not too short so that reasonable length c++ names can be seen most of the time const int MAX_NAME_LENGTH = 64; - auto hist = Core()->cmdj("sj"); + RzListIter *it; + RzCoreSeekItem *undo; + RzCoreLocked core(Core()); + RzList *list = rz_core_seek_list(core); + bool history = true; QList actions; - for (auto item : Core()->cmdj("sj").array()) { - QJsonObject obj = item.toObject(); - QString name = obj["name"].toString(); - RVA offset = obj["offset"].toVariant().toULongLong(); - bool current = obj["current"].toBool(false); + CutterRListForeach(list, it, RzCoreSeekItem, undo) { + RzFlagItem *f = rz_flag_get_at(core->flags, undo->offset, true); + char *fname = NULL; + if (f) { + if (f->offset != undo->offset) { + fname = rz_str_newf("%s+%" PFMT64d, f->name, undo->offset - f->offset); + } else { + fname = strdup(f->name); + } + } + QString name = fname; + RVA offset = undo->offset; + bool current = undo->is_current; if (current) { history = false; }