Ver Fonte

Made '_' refer to value of memory breakpoint instead of addr

Brian Fiete há 5 anos atrás
pai
commit
d13d3ed3f8

+ 1 - 1
IDE/src/ui/ConditionDialog.bf

@@ -197,7 +197,7 @@ namespace IDE.ui
 					exprPre.Append("@C:");
 					exprPre.Append("@C:");
 				else
 				else
 					exprPre.Append("@Beef:");
 					exprPre.Append("@Beef:");
-				exprPost.AppendF(",_=({0}*)0x", addrVal);
+				exprPost.AppendF(",_=*({0}*)0x", addrVal);
 				mBreakpoint.mMemoryAddress.ToString(exprPost, "X", null);
 				mBreakpoint.mMemoryAddress.ToString(exprPost, "X", null);
 				exprPost.Append("L");
 				exprPost.Append("L");
 			}
 			}

+ 15 - 0
IDE/src/ui/WatchPanel.bf

@@ -2705,6 +2705,21 @@ namespace IDE.ui
 								}
 								}
 							}
 							}
 						});
 						});
+
+					let configItem = menu.AddItem("Configure Breakpoint");
+					configItem.mOnMenuItemSelected.Add(new (evt) =>
+						{
+							for (int breakIdx < gApp.mDebugger.mBreakpointList.Count)
+							{
+								let breakpoint = gApp.mDebugger.mBreakpointList[breakIdx];
+								if (breakpoint.mMemoryAddress == watchEntry.mMemoryBreakpointAddr)
+								{
+									ConditionDialog dialog = new ConditionDialog();
+									dialog.Init(breakpoint);
+									dialog.PopupWindow(listView.mWidgetWindow);
+								}
+							}
+						});
 				}
 				}
 
 
 				if (watchEntry.mResultType == .Pointer)
 				if (watchEntry.mResultType == .Pointer)

+ 14 - 2
IDEHelper/DbgExprEvaluator.cpp

@@ -3628,8 +3628,17 @@ DbgTypedValue DbgExprEvaluator::LookupIdentifier(BfAstNode* identifierNode, bool
 		return GetThis();
 		return GetThis();
 	if (findName == "_")
 	if (findName == "_")
 	{
 	{
-		if (mSubjectValue)
+		if (mSubjectValue)			
+		{
+			if (mSubjectValue.mSrcAddress != 0)
+			{
+				auto refreshVal = ReadTypedValue(mSubjectValue.mType, mSubjectValue.mSrcAddress, DbgAddrType_Target);
+				if (refreshVal)
+					mSubjectValue = refreshVal;
+			}
 			return mSubjectValue;
 			return mSubjectValue;
+		}
+		
 		if (!mSubjectExpr.IsEmpty())
 		if (!mSubjectExpr.IsEmpty())
 		{
 		{
 			DwFormatInfo formatInfo;
 			DwFormatInfo formatInfo;
@@ -5795,7 +5804,10 @@ void DbgExprEvaluator::PerformBinaryOperation(ASTREF(BfExpression*)& leftExpress
 	{
 	{
 		if ((binaryOp != BfBinaryOp_Equality) && (binaryOp != BfBinaryOp_InEquality))
 		if ((binaryOp != BfBinaryOp_Equality) && (binaryOp != BfBinaryOp_InEquality))
 		{
 		{
-			Fail("Invalid operation for objects", opToken);
+			if (resultType->IsPointer())
+				Fail("Invalid operation for pointers", opToken);
+			else
+				Fail("Invalid operation for objects", opToken);
 			return;
 			return;
 		}
 		}