From 9b87d93b72d7af0892b5561976358fb643af94d0 Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Wed, 29 Sep 2021 22:55:53 +0800 Subject: [PATCH] - enhancement: view memory when debugging --- NEWS.md | 2 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 80672 -> 80775 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 577 ++++++++++++++++--------------- RedPandaIDE/debugger.cpp | 62 +++- RedPandaIDE/debugger.h | 14 +- RedPandaIDE/mainwindow.cpp | 36 ++ RedPandaIDE/mainwindow.h | 4 +- RedPandaIDE/mainwindow.ui | 122 ++++--- RedPandaIDE/systemconsts.h | 4 +- 9 files changed, 464 insertions(+), 357 deletions(-) diff --git a/NEWS.md b/NEWS.md index a454e886..78b5bc9b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,9 +10,11 @@ Version 0.2.2 - enhancement: redesign charset selection in the project options dialog's file widget - fix: can't correctly load last open files / project with non-asii characters in path - fix: can't coorectly load last open project + - fix: can't coorectly show code completion for array elements - enhancement: show caret when show code/header completions - fix: correctly display pointer info in watch console - enhancement: search in project + - enhancement: view memory when debugging Version 0.2.1 - fix: crash when load last opens diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 4cc6142d99c087781ce178c7efbaaa2a967f1562..dee41697b6f599b835545ca98d3e16b3f5f0e179 100644 GIT binary patch delta 5947 zcmX|_d0b8T|Ht3w+;h&o=dN0Bg|dY(#n{Qd7BR@EP@%F5VWyeU9YP_Zqm(33lawq; zqGbp*mJ-<`gR+D~H1^-C?)UNg!{h0k&iQ;k=lyxVUhntk?)|`pHFDc*4gV2w5>Z?@ zxC1-{MuXSD7_brCNwljK7z+*q`6S)kIL(e%wkYp@QVBBJkih?^5kRQw#D(SfMXT;ftvh&E>s_ZRMO z{e!sE98pX*ab;jEp1W#~@2Ubv5+idUu3{V3$q;wbofuZVO7daCJlEiI3(js`_1;=7L`MllWCOSJkk z@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Model - + Function 函数 - + Filename 文件名 - + Line @@ -45,17 +45,17 @@ BreakpointModel - + Filename 文件名 - + Line - + Condition 条件 @@ -702,28 +702,28 @@ Are you really want to continue? 找不到调试器程序"%1" - - + + Execute to evaluate 执行以求值 - + Not found in current context 不在当前语境中 - + Compile 编译 - + Source file is more recent than executable. 源文件比程序文件新。 - + Recompile? 重新编译? @@ -2304,7 +2304,7 @@ Are you really want to continue? - + Issues 编译器 @@ -2314,29 +2314,29 @@ Are you really want to continue? 编译日志 - + File 文件 - + Tools 工具 - - + + Run 运行 - + Edit 编辑 - + Project 项目 @@ -2361,81 +2361,81 @@ Are you really want to continue? - - - + + + Debug 调试 - + Evaluate: 求值 - + Debug Console 调试主控台 - + Call Stack 调用栈 - + Breakpoints 断点 - + Locals 本地变量 - - + + Search 查找 - + History: 历史: - + Search Again 重新查找 - + Replace with: 替换为: - + Replace 替换 - + Close 关闭 - + Execute 运行 - - + + Code 代码 - + Window 窗口 @@ -2453,558 +2453,569 @@ Are you really want to continue? 新建 - + Ctrl+N Ctrl+N - + Open... 打开... - + Ctrl+O Ctrl+O - + Save 保存 - + Ctrl+S Ctrl+S - + Save As... 另存为... - + Save As 另存为 - + Save All 全部保存 - + Ctrl+Shift+S Ctrl+Shift+S - + Options 选项 - - - - - - - + + + + + + + Compile 编译 - + F9 F9 - + F10 F10 - + Undo 恢复 - + Ctrl+Z Ctrl+Z - + Redo 重做 - + Ctrl+Y Ctrl+Y - + Cut 剪切 - + Ctrl+X Ctrl+X - - + + Copy 复制 - + Ctrl+C Ctrl+C - + Paste 粘贴 - + Ctrl+V Ctrl+V - + Select All 选择全部 - + Ctrl+A Ctrl+A - + Indent 缩进 - + UnIndent 取消缩进 - + Toggle Comment 切换注释 - + Ctrl+/ Ctrl+/ - + Collapse All 全部收起 - + Uncollapse All 全部展开 - + Encode in ANSI 使用ANSI编码 - + Encode in UTF-8 使用UTF-8编码 - + Auto Detect 自动检测 - + Convert to ANSI 转换为ANSI编码 - + Convert to UTF-8 转换为UTF-8编码 - - + + Compile & Run 编译运行 - + F11 F11 - - + + Rebuild All 全部重编译 - + F12 F12 - + Stop Execution 停止执行 - + F6 F6 - + F5 F5 - + Step Over 单步跳过 - + F7 F7 - + Step Into 单步进入 - + + Memory + 内存 + + + + Address Expression: + Address: + 地址表达式: + + + Main 主工具栏 - + Compiler Set 编译器配置集 - - + + New Source File 新建源代码文件 - + F8 F8 - + Step Out 单步跳出 - + Ctrl+F8 Ctrl+F8 - + Run To Cursor 执行到光标处 - + Ctrl+F5 Ctrl+F5 - + Continue 继续执行 - + F4 F4 - + Add Watch... 添加监视 - + View CPU Window... 打开CPU信息窗口... - + Exit 退出 - + Find... 查找... - + Ctrl+F Ctrl+F - + Find in Files... 在文件中查找... - + Ctrl+Shift+F Ctrl+Shift+F - + Replace... 替换 - + Ctrl+R Ctrl+R - + Find Next 查找下一个 - + F3 F3 - + Find Previous 查找前一个 - + Shift+F3 Shift+F3 - + Remove Watch 删除监视 - + Remove All 清除全部监视 - + Modify Watch... 修改监视值 - + Reformat Code 对代码重新排版 - + Ctrl+Shift+A Ctrl+Shift+A - + Go back 前一次编辑位置 - + Ctrl+Alt+Left Ctrl+Alt+Left - + Forward 后一次编辑位置 - + Ctrl+Alt+Right Ctrl+Alt+Right - + Ctrl+W Ctrl+W - + Close All 全部关闭 - + Ctrl+Shift+W Ctrl+Shift+W - + Maximize Editor 最大化编辑器 - + Ctrl+F11 Ctrl+F11 - + Next 下一窗口 - + Ctrl+Tab Ctrl+Tab - + Previous 前一窗口 - + Ctrl+Shift+Tab Ctrl+Shift+Tab - + Toggle breakpoint 切换断点 - + Ctrl+F4 Ctrl+F4 - - + + Clear all breakpoints 删除所有断点 - + Breakpoint property... 设置断点条件... - + Goto Declaration 跳转到声明处 - + Goto Definition 跳转到定义处 - + Find references 查找符号的引用 - + Open containing folder 打开所在的文件夹 - + Ctrl+B Ctrl+B - + Open a terminal here 打开命令行窗口 - + File Properties... 文件属性... - + Close Project 关闭项目 - + Project options 项目属性 - + New Project... 新建项目... - + New File 新建项目文件 - + Add to project... 添加到项目... - + Remove from project 从项目删除 - + View Makefile 查看Makefile - + Clean 清理构建文件 - + Open Folder in Explorer 在浏览器中打开 - + Open In Terminal 在终端中打开 - + File Encoding 文件编码 @@ -3014,32 +3025,32 @@ Are you really want to continue? 文件历史 - - + - + + Debugging 正在调试 - - + - + + Running 正在运行 - - + - + + Compiling 正在编译 @@ -3048,349 +3059,349 @@ Are you really want to continue? 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5 - + Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5 - + Read Only 只读 - + Insert 插入 - + Overwrite 覆写 - + Close project 关闭项目 - + Are you sure you want to close %1? 你确定要关闭'%1'吗? - - + + Confirm 确认 - - - + + + Source file is not compiled. 源文件尚未编译。 - - + + Compile now? 现在编译? - - + + Source file is more recent than executable. 源文件比可执行程序新。 - + Recompile now? 重新编译? - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 - - + + Enable debugging 启用调试参数 - - + + You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now? 当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题? - + Project not built 项目尚未构建 - + Project hasn't been built. Build it now? 项目尚未构建。是否构建? - + Host applcation missing 宿主程序不存在 - + DLL project needs a host application to run. 动态链接库(DLL)需要一个宿主程序来运行。 - + But it's missing. 但它不存在。 - + Host application not exists 宿主程序不存在 - + Host application file '%1' doesn't exist. 宿主程序'%1'不存在。 - + Recompile? 重新编译? - - + + Save last open info error 保存上次打开信息失败 - + Can't remove old last open information file '%1' 无法删除旧上次打开信息文件'%1' - + Can't save last open info file '%1' 无法保存上次打开信息文件'%1' - + Load last open info error 载入上次打开信息失败 - + Can't load last open info file '%1' 无法载入上次打开信息文件'%1' - + Copy all 全部复制 - + Clear 清除 - + Remove this search 清除这次搜索 - + Clear all searches 删除所有搜索 - + Breakpoint condition... 断点条件... - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Remove all breakpoints 清除所有断点 - + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 - + Remove Folder 删除文件夹 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + Character sets 字符集 - + %1 files autosaved 已自动保存%1个文件 - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - + Do you want to save it? 需要保存吗? - + Do you really want to clear all breakpoints in this file? 您真的要清除该文件的所有断点吗? - + New project 新建项目 - + Close %1 and start new project? 关闭'%1'以打开新项目? - + Folder not exist 文件夹不存在 - + Folder '%1' doesn't exist. Create it now? 文件夹'%1'不存在。是否创建? - + Can't create folder 无法创建文件夹 - + Failed to create folder '%1'. 创建文件夹'%1'失败。 - + Save new project as - + Red panda Dev-C++ project file (*.dev) 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + Add to project 添加到项目 - - - - - - - - - + + + + + + + + + Error 错误 @@ -3400,75 +3411,75 @@ Are you really want to continue? 项目历史 - + File '%1' was changed. 磁盘文件'%1'已被修改。 - + Reload its content from disk? 是否重新读取它的内容? - + File '%1' was removed. 磁盘文件'%1'已被删除。 - + Keep it open? 是否保持它在小熊猫C++中打开的编辑窗口? - + Open 打开 - + Compile Failed 编译失败 - + Run Failed 运行失败 - - + + Confirm Convertion 确认转换 - - + + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 - + Enter Watch Expression (it is recommended to use 'this->' for class members): 输入监视表达式 - + Parsing file %1 of %2: "%3" (%1/%2)正在解析文件"%3" - - + + Done parsing %1 files in %2 seconds 完成%1个文件的解析,用时%2秒 - + (%1 files per second) (每秒%1个文件) @@ -3813,7 +3824,7 @@ Are you really want to continue? 编码 - + Override build command: 自定义构建命令 @@ -3824,9 +3835,13 @@ Are you really want to continue? - ANSI(System default) + ANSI ANSI + + ANSI(System default) + ANSI + UTF-8 @@ -4860,17 +4875,17 @@ Are you really want to continue? RegisterModel - + Register 寄存器 - + Value(Hex) 值(HEX) - + Value(Dec) 值(DEC) @@ -4984,8 +4999,8 @@ Are you really want to continue? - - + + Find 查找 @@ -4995,19 +5010,19 @@ Are you really want to continue? 取消 - + Find in files 在文件中查找 - - - + + + Replace 替换 - + Replace this occurrence of ''%1''? 替换这里的"%1"? @@ -5445,12 +5460,12 @@ Are you really want to continue? WatchModel - + Expression 表达式 - + Value diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index ba0308e4..be138e8f 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -48,8 +48,7 @@ bool Debugger::start() connect(mReader, &QThread::finished,this,&Debugger::clearUpReader); connect(mReader, &DebugReader::parseFinished,this,&Debugger::syncFinishedParsing,Qt::BlockingQueuedConnection); connect(mReader, &DebugReader::changeDebugConsoleLastLine,this,&Debugger::onChangeDebugConsoleLastline); - connect(mReader, &DebugReader::addLocalLine,this,&Debugger::onAddLocalLine); - connect(mReader, &DebugReader::clearLocals,this,&Debugger::onClearLocals); + connect(this, &Debugger::localsReady,pMainWindow,&MainWindow::onLocalsReady); connect(mReader, &DebugReader::cmdStarted,pMainWindow, &MainWindow::disableDebugActions); connect(mReader, &DebugReader::cmdFinished,pMainWindow, &MainWindow::enableDebugActions); @@ -102,16 +101,6 @@ void Debugger::clearUpReader() } } -void Debugger::onAddLocalLine(const QString &text) -{ - pMainWindow->txtLocals()->appendPlainText(text); -} - -void Debugger::onClearLocals() -{ - pMainWindow->txtLocals()->clear(); -} - RegisterModel *Debugger::registerModel() const { return mRegisterModel; @@ -458,6 +447,18 @@ void Debugger::syncFinishedParsing() mReader->doevalready = false; } + if (mReader->doupdatememoryview) { + emit memoryExamineReady(mReader->mMemoryValue); + mReader->mMemoryValue.clear(); + mReader->doupdatememoryview=false; + } + + if (mReader->doupdatelocal) { + emit localsReady(mReader->mLocalsValue); + mReader->mLocalsValue.clear(); + mReader->doupdatelocal=false; + } + // show command output if (pSettings->debugger().showCommandLog() || (mReader->mCurrentCmd && mReader->mCurrentCmd->showInConsole)) { @@ -648,6 +649,8 @@ AnnotationType DebugReader::getAnnotation(const QString &s) } else if ((mCurrentCmd) && (mCurrentCmd->command == "disas")) { // Another hack to catch assembler result = AnnotationType::TInfoAsm; + } else if ((mCurrentCmd) && (mCurrentCmd->command.startsWith("x/"))) { + result = AnnotationType::TMemory; } return result; } else if (s == "error-begin") { @@ -980,7 +983,7 @@ void DebugReader::handleLocalOutput() line += s; // emit addLocalWithoutLinebreak(s); } else { - emit addLocalLine(line); + mLocalsValue.append(line); line = s; } nobreakLine=false; @@ -992,18 +995,42 @@ void DebugReader::handleLocalOutput() break; } if (!line.isEmpty()) { - emit addLocalLine(line); + mLocalsValue.append(line); } } void DebugReader::handleLocals() { - emit clearLocals(); + mLocalsValue.clear(); handleLocalOutput(); } +void DebugReader::handleMemory() +{ + doupdatememoryview = true; + // name(spaces)hexvalue(tab)decimalvalue + mMemoryValue.clear(); + QString s = getNextFilledLine(); + bool isAnnotation = false; + while (true) { + if (!s.startsWith("\032\032")) { + s = s.trimmed(); + if (!s.isEmpty()) { + mMemoryValue.append(s); + } + isAnnotation = false; + } else { + isAnnotation = true; + } + s = getNextLine(); + if (!isAnnotation && s.isEmpty()) + break; + } +} + void DebugReader::handleParams(){ handleLocalOutput(); + doupdatelocal = true; } void DebugReader::handleRegisters() @@ -1129,6 +1156,8 @@ void DebugReader::processDebugOutput() dodisassemblerready = false; doregistersready = false; doevalready = false; + doupdatememoryview = false; + doupdatelocal = false; doprocessexited = false; doupdateexecution = false; doreceivedsignal = false; @@ -1168,6 +1197,9 @@ void DebugReader::processDebugOutput() case AnnotationType::TParam: handleParams(); break; + case AnnotationType::TMemory: + handleMemory(); + break; case AnnotationType::TErrorBegin: handleError(); break; diff --git a/RedPandaIDE/debugger.h b/RedPandaIDE/debugger.h index 0f24fb17..687a414f 100644 --- a/RedPandaIDE/debugger.h +++ b/RedPandaIDE/debugger.h @@ -36,7 +36,7 @@ enum class AnnotationType { TFieldBegin, TFieldEnd, TFieldValue, TFieldNameEnd, TInfoReg, TInfoAsm, TUnknown, TEOF, - TLocal, TParam + TLocal, TParam, TMemory }; struct DebugCommand{ @@ -238,6 +238,8 @@ public: signals: void evalValueReady(const QString& s); + void memoryExamineReady(const QStringList& s); + void localsReady(const QStringList& s); public slots: void stop(); @@ -252,8 +254,7 @@ private slots: void syncFinishedParsing(); void onChangeDebugConsoleLastline(const QString& text); void clearUpReader(); - void onAddLocalLine(const QString& text); - void onClearLocals(); + private: bool mExecuting; bool mCommandChanged; @@ -291,8 +292,6 @@ signals: void updateWatch(); void processError(QProcess::ProcessError error); void changeDebugConsoleLastLine(const QString& text); - void addLocalLine(const QString& text); - void clearLocals(); void cmdStarted(); void cmdFinished(); private: @@ -312,6 +311,7 @@ private: void handleFrames(); void handleLocalOutput(); void handleLocals(); + void handleMemory(); void handleParams(); void handleRegisters(); void handleSignal(); @@ -348,6 +348,8 @@ private: QString mBreakPointFile; QString mOutput; QString mEvalValue; + QStringList mMemoryValue; + QStringList mLocalsValue; QString mSignal; bool mUseUTF8; @@ -361,6 +363,8 @@ private: bool doupdateexecution; bool doreceivedsignal; bool doreceivedsfwarning; + bool doupdatememoryview; + bool doupdatelocal; bool mStop; friend class Debugger; diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 636f581a..f65b8553 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -120,6 +120,8 @@ MainWindow::MainWindow(QWidget *parent) connect(ui->debugConsole,&QConsole::commandInput,this,&MainWindow::onDebugCommandInput); connect(ui->cbEvaluate->lineEdit(), &QLineEdit::returnPressed, this, &MainWindow::onDebugEvaluateInput); + connect(ui->cbMemoryAddress->lineEdit(), &QLineEdit::returnPressed, + this, &MainWindow::onDebugMemoryAddressInput); mSearchResultTreeModel = std::make_shared(&mSearchResultModel); mSearchResultListModel = std::make_shared(&mSearchResultModel); @@ -556,6 +558,7 @@ void MainWindow::updateDebugEval(const QString &value) { ui->txtEvalOutput->clear(); ui->txtEvalOutput->appendPlainText(value); + ui->txtEvalOutput->moveCursor(QTextCursor::Start); } void MainWindow::rebuildOpenedFileHisotryMenu() @@ -2124,6 +2127,7 @@ void MainWindow::disableDebugActions() ui->actionRun_To_Cursor->setEnabled(false); ui->actionContinue->setEnabled(false); ui->cbEvaluate->setEnabled(false); + ui->cbMemoryAddress->setEnabled(false); } void MainWindow::enableDebugActions() @@ -2134,6 +2138,7 @@ void MainWindow::enableDebugActions() ui->actionRun_To_Cursor->setEnabled(true); ui->actionContinue->setEnabled(true); ui->cbEvaluate->setEnabled(true); + ui->cbMemoryAddress->setEnabled(true); } void MainWindow::prepareProjectForCompile() @@ -3017,6 +3022,16 @@ void MainWindow::onDebugEvaluateInput() } } +void MainWindow::onDebugMemoryAddressInput() +{ + QString s=ui->cbMemoryAddress->currentText().trimmed(); + if (!s.isEmpty()) { + connect(mDebugger, &Debugger::memoryExamineReady, + this, &MainWindow::onMemoryExamineReady); + mDebugger->sendCommand("x/64bx",s,false); + } +} + void MainWindow::onParserProgress(const QString &fileName, int total, int current) { // Mention every 5% progress @@ -3068,6 +3083,27 @@ void MainWindow::onEvalValueReady(const QString &value) this, &MainWindow::onEvalValueReady); } +void MainWindow::onMemoryExamineReady(const QStringList &value) +{ + ui->txtMemoryView->clear(); + foreach (QString s, value) { + s.replace("\t"," "); + ui->txtMemoryView->appendPlainText(s); + } + ui->txtMemoryView->moveCursor(QTextCursor::Start); + disconnect(mDebugger, &Debugger::memoryExamineReady, + this, &MainWindow::onMemoryExamineReady); +} + +void MainWindow::onLocalsReady(const QStringList &value) +{ + ui->txtLocals->clear(); + foreach (QString s, value) { + ui->txtLocals->appendPlainText(s); + } + ui->txtLocals->moveCursor(QTextCursor::Start); +} + void MainWindow::on_actionFind_triggered() { Editor *e = mEditorList->getEditor(); diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index ef506e72..ac3206f7 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -88,7 +88,6 @@ public: void saveLastOpens(); void loadLastOpens(); - QPlainTextEdit* txtLocals(); CPUDialog *cpuDialog() const; @@ -125,10 +124,13 @@ public slots: void cleanUpCPUDialog(); void onDebugCommandInput(const QString& command); void onDebugEvaluateInput(); + void onDebugMemoryAddressInput(); void onParserProgress(const QString& fileName, int total, int current); void onStartParsing(); void onEndParsing(int total, int updateView); void onEvalValueReady(const QString& value); + void onMemoryExamineReady(const QStringList& value); + void onLocalsReady(const QStringList& value); void onEditorContextMenu(const QPoint& pos); void onEditorTabContextMenu(const QPoint& pos); void disableDebugActions(); diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index 1db97d3c..091c2b7a 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -288,7 +288,7 @@ QTabWidget::South - 3 + 2 @@ -416,67 +416,43 @@ QFrame::Raised - + - 0 + 11 - 0 + 11 - 0 + 11 - 0 + 11 - - - - QFrame::StyledPanel + + + + Evaluate: - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Evaluate: - - - - - - - - 0 - 0 - - - - true - - - QComboBox::InsertAtTop - - - - - + + + + + 0 + 0 + + + + true + + + QComboBox::InsertAtTop + + + + false @@ -493,7 +469,7 @@ QTabWidget::North - 3 + 4 @@ -623,6 +599,46 @@ + + + Memory + + + + + + Address Expression: + + + + + + + + 0 + 0 + + + + true + + + QComboBox::InsertAtTop + + + + + + + QPlainTextEdit::NoWrap + + + true + + + + + @@ -801,7 +817,7 @@ 0 0 946 - 25 + 22 diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 2eb50a3b..81cd2f83 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -3,6 +3,8 @@ #include +#define DEVCPP_VERSION "0.2.2" + #ifdef Q_OS_WIN #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #define GCC_PROGRAM "gcc.exe" @@ -51,8 +53,6 @@ #error "Only support windows and linux now!" #endif -#define DEVCPP_VERSION "0.2.0" - class SystemConsts { public: