mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed IDE "Find on Stack" functionality
This commit is contained in:
parent
237b507745
commit
ac67046afc
5 changed files with 21 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System
|
||||
{
|
||||
|
@ -95,16 +96,16 @@ namespace System
|
|||
}
|
||||
}
|
||||
|
||||
public static Result<int, ParseError> Parse(StringView val)
|
||||
public static Result<int, ParseError> Parse(StringView val, NumberStyles style = .Number, CultureInfo cultureInfo = null)
|
||||
{
|
||||
if (sizeof(Self) == sizeof(int64))
|
||||
{
|
||||
var result = Int64.Parse(val);
|
||||
var result = Int64.Parse(val, style, cultureInfo);
|
||||
return *(Result<int, ParseError>*)&result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = Int32.Parse(val);
|
||||
var result = Int32.Parse(val, style, cultureInfo);
|
||||
return *(Result<int, ParseError>*)&result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System.Globalization;
|
||||
namespace System
|
||||
{
|
||||
#unwarn
|
||||
|
@ -85,16 +86,16 @@ namespace System
|
|||
((uint32)this).ToString(outString, format, formatProvider);
|
||||
}
|
||||
|
||||
public static Result<uint, ParseError> Parse(StringView val)
|
||||
public static Result<uint, ParseError> Parse(StringView val, NumberStyles style = .Number, CultureInfo cultureInfo = null)
|
||||
{
|
||||
if (sizeof(Self) == sizeof(uint64))
|
||||
{
|
||||
var result = UInt64.Parse(val);
|
||||
var result = Int64.Parse(val, style, cultureInfo);
|
||||
return *(Result<uint, ParseError>*)&result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = UInt32.Parse(val);
|
||||
var result = Int32.Parse(val, style, cultureInfo);
|
||||
return *(Result<uint, ParseError>*)&result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -879,6 +879,10 @@ namespace IDE.ui
|
|||
{
|
||||
String.NewOrSet!(watch.mEditInitialize, scope String(memberVals[1]));
|
||||
}
|
||||
else if (memberVals0 == ":pointer")
|
||||
{
|
||||
String.NewOrSet!(watch.mPointer, scope String(memberVals[1]));
|
||||
}
|
||||
else if (memberVals0 == ":break")
|
||||
{
|
||||
watch.mMemoryBreakpointAddr = (int)Int64.Parse(memberVals[1], .HexNumber);
|
||||
|
|
|
@ -47,7 +47,8 @@ namespace IDE.ui
|
|||
public String mAddrValueExpr ~ delete _;
|
||||
public String mPointeeExpr ~ delete _;
|
||||
public bool mCanEdit;
|
||||
public String mEditInitialize ~ delete _;
|
||||
public String mPointer ~ delete _;
|
||||
public String mEditInitialize ~ delete _;
|
||||
public bool mHadValue;
|
||||
public bool mHasValue;
|
||||
public bool mIsNewExpression;
|
||||
|
@ -4487,7 +4488,7 @@ namespace IDE.ui
|
|||
|
||||
if (watchEntry.mResultType.HasFlag(.Pointer))
|
||||
{
|
||||
if (int.Parse(watchEntry.mEditInitialize) case .Ok(let addr))
|
||||
if (int.Parse(watchEntry.mPointer ?? watchEntry.mEditInitialize, .AllowHexSpecifier) case .Ok(let addr))
|
||||
{
|
||||
int threadId;
|
||||
gApp.mDebugger.GetStackAllocInfo(addr, out threadId, null);
|
||||
|
|
|
@ -9723,6 +9723,8 @@ String WinDebugger::EvaluateContinue(DbgPendingExpr* pendingExpr, BfPassInstance
|
|||
underlyingType->IsBfObject() ? "" : "*");
|
||||
val += EncodeDataPtr(exprResult.mPtr, true);
|
||||
}
|
||||
|
||||
val += "\n:pointer\t" + EncodeDataPtr(exprResult.mPtr, true);
|
||||
}
|
||||
|
||||
if (val[0] == '!')
|
||||
|
@ -9761,6 +9763,10 @@ String WinDebugger::EvaluateContinue(DbgPendingExpr* pendingExpr, BfPassInstance
|
|||
{
|
||||
if (canEdit)
|
||||
val += "\n:canEdit";
|
||||
if (exprResult.mType->mTypeCode == DbgType_Ptr)
|
||||
{
|
||||
val += "\n:editVal\t" + EncodeDataPtr(exprResult.mPtr, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue