Commit 07b11819 authored by hjk's avatar hjk
Browse files

debugger: Open memory editor at pointee address, not at pointer address

parent 5da667b4
...@@ -61,7 +61,7 @@ enum WatchRoles ...@@ -61,7 +61,7 @@ enum WatchRoles
TypeFormatListRole, TypeFormatListRole,
TypeFormatRole, // Used to communicate alternative formats to the view. TypeFormatRole, // Used to communicate alternative formats to the view.
IndividualFormatRole, IndividualFormatRole,
AddressRole, // Some memory address related to the object. AddressRole, // Address of the object.
}; };
enum IntegerFormat enum IntegerFormat
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "debuggerdialogs.h" #include "debuggerdialogs.h"
#include "debuggermanager.h" #include "debuggermanager.h"
#include "idebuggerengine.h" #include "idebuggerengine.h"
#include "watchutils.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
...@@ -299,9 +300,12 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) ...@@ -299,9 +300,12 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
const bool canShowMemory = engineCapabilities & ShowMemoryCapability; const bool canShowMemory = engineCapabilities & ShowMemoryCapability;
actWatchUnknownMemory->setEnabled(actionsEnabled && canShowMemory); actWatchUnknownMemory->setEnabled(actionsEnabled && canShowMemory);
if (canShowMemory && !address.isEmpty()) QString editAddress = address;
if (isPointerType(type))
editAddress = model()->data(mi1).toString();
if (canShowMemory && !editAddress.isEmpty())
actWatchKnownMemory = actWatchKnownMemory =
new QAction(tr("Open Memory Editor at %1").arg(address), &menu); new QAction(tr("Open Memory Editor at %1").arg(editAddress), &menu);
menu.addSeparator(); menu.addSeparator();
QAction *actSetWatchpoint = 0; QAction *actSetWatchpoint = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment