mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Allow clicking on reg in mem window, other minor fixes
This commit is contained in:
parent
4dcd7f9c6a
commit
2618b29daa
13 changed files with 96 additions and 32 deletions
|
@ -141,9 +141,13 @@ namespace System.FFI
|
||||||
{
|
{
|
||||||
NotSet = 0,
|
NotSet = 0,
|
||||||
StdCall = 1,
|
StdCall = 1,
|
||||||
|
#unwarn
|
||||||
ThisCall = 1,
|
ThisCall = 1,
|
||||||
|
#unwarn
|
||||||
FastCall = 1,
|
FastCall = 1,
|
||||||
|
#unwarn
|
||||||
MS_CDecl = 1,
|
MS_CDecl = 1,
|
||||||
|
#unwarn
|
||||||
Default = 1
|
Default = 1
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace System.Globalization
|
||||||
TAIWANLUNISOLAR = 21,
|
TAIWANLUNISOLAR = 21,
|
||||||
PERSIAN = 22,
|
PERSIAN = 22,
|
||||||
UMALQURA = 23,
|
UMALQURA = 23,
|
||||||
|
#unwarn
|
||||||
LAST_CALENDAR = 23 // Last calendar ID
|
LAST_CALENDAR = 23 // Last calendar ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -893,7 +893,9 @@ namespace System.Reflection
|
||||||
|
|
||||||
// vtable layout mask - Use this mask to retrieve vtable attributes.
|
// vtable layout mask - Use this mask to retrieve vtable attributes.
|
||||||
VtableLayoutMask = 0x0100,
|
VtableLayoutMask = 0x0100,
|
||||||
|
#unwarn
|
||||||
ReuseSlot = 0x0000, // The default.
|
ReuseSlot = 0x0000, // The default.
|
||||||
|
#unwarn
|
||||||
NewSlot = 0x0100, // Method always gets a new slot in the vtable.
|
NewSlot = 0x0100, // Method always gets a new slot in the vtable.
|
||||||
// end vtable layout mask
|
// end vtable layout mask
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace System
|
||||||
ENABLE_AAA = 0x10000,
|
ENABLE_AAA = 0x10000,
|
||||||
FROM_DEFAULT_CONTEXT = 0x20000,
|
FROM_DEFAULT_CONTEXT = 0x20000,
|
||||||
ACTIVATE_X86_SERVER = 0x40000,
|
ACTIVATE_X86_SERVER = 0x40000,
|
||||||
|
#unwarn
|
||||||
ACTIVATE_32_BIT_SERVER = ACTIVATE_X86_SERVER,
|
ACTIVATE_32_BIT_SERVER = ACTIVATE_X86_SERVER,
|
||||||
ACTIVATE_64_BIT_SERVER = 0x80000,
|
ACTIVATE_64_BIT_SERVER = 0x80000,
|
||||||
ENABLE_CLOAKING = 0x100000,
|
ENABLE_CLOAKING = 0x100000,
|
||||||
|
@ -198,6 +199,8 @@ namespace System
|
||||||
|
|
||||||
public const int32 KEY_ALL_ACCESS = 0x000f003f;
|
public const int32 KEY_ALL_ACCESS = 0x000f003f;
|
||||||
|
|
||||||
|
public const int32 MB_OK = 0;
|
||||||
|
public const int32 MB_OKCANCEL = 1;
|
||||||
public const int32 MB_YESNO = 4;
|
public const int32 MB_YESNO = 4;
|
||||||
public const int32 MB_ICONHAND = 0x10;
|
public const int32 MB_ICONHAND = 0x10;
|
||||||
public const int32 MB_ICONQUESTION = 0x20;
|
public const int32 MB_ICONQUESTION = 0x20;
|
||||||
|
@ -1361,16 +1364,16 @@ namespace System
|
||||||
[CLink, StdCall]
|
[CLink, StdCall]
|
||||||
public static extern IntBool SetFileAttributesW(char16* name, int32 attribs);
|
public static extern IntBool SetFileAttributesW(char16* name, int32 attribs);
|
||||||
|
|
||||||
[CLink, StdCall]
|
[Import("user32.lib"), CLink, StdCall]
|
||||||
public static extern int32 MessageBoxA(HWnd hWnd, char8* text, char8* caption, int32 type);
|
public static extern int32 MessageBoxA(HWnd hWnd, char8* text, char8* caption, int32 type);
|
||||||
|
|
||||||
[CLink, StdCall]
|
[Import("user32.lib"), CLink, StdCall]
|
||||||
public static extern int32 MessageBoxW(HWnd hWnd, char16* text, char16* caption, int32 type);
|
public static extern int32 MessageBoxW(HWnd hWnd, char16* text, char16* caption, int32 type);
|
||||||
|
|
||||||
[CLink, StdCall]
|
[CLink, StdCall]
|
||||||
public static extern int32 SetErrorMode(int32 errorMode);
|
public static extern int32 SetErrorMode(int32 errorMode);
|
||||||
|
|
||||||
[CLink, StdCall]
|
[Import("user32.lib"), CLink, StdCall]
|
||||||
public static extern HWnd GetActiveWindow();
|
public static extern HWnd GetActiveWindow();
|
||||||
|
|
||||||
[Import("user32.lib"), CLink, StdCall]
|
[Import("user32.lib"), CLink, StdCall]
|
||||||
|
|
|
@ -143,10 +143,34 @@ void TestMem()
|
||||||
memcpy(cPtr, str, 3);
|
memcpy(cPtr, str, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Test6()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Test5(int a, void* b, void* c)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Test4(int a, int b, int c)
|
||||||
|
{
|
||||||
|
Test5(10, Test6, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Test3(int a)
|
||||||
|
{
|
||||||
|
Test4(100, 200, 300);
|
||||||
|
}
|
||||||
|
|
||||||
// THIS IS VERSION 6.
|
// THIS IS VERSION 6.
|
||||||
extern "C"
|
extern "C"
|
||||||
__declspec(dllexport) void Test2(int aa, int bb, int cc, int dd)
|
__declspec(dllexport) void Test2(int aa, int bb, int cc, int dd)
|
||||||
{
|
{
|
||||||
|
Test3(10);
|
||||||
|
|
||||||
|
char* strP = "Hey yo";
|
||||||
|
|
||||||
TestMem();
|
TestMem();
|
||||||
|
|
||||||
Zorq();
|
Zorq();
|
||||||
|
|
|
@ -88,6 +88,7 @@
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -123,6 +124,7 @@
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -140,6 +142,7 @@
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
|
|
@ -25,7 +25,7 @@ OtherLinkFlags = ""
|
||||||
TargetDirectory = "$(WorkspaceDir)/dist"
|
TargetDirectory = "$(WorkspaceDir)/dist"
|
||||||
TargetName = "BeefIDE_d"
|
TargetName = "BeefIDE_d"
|
||||||
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
|
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
|
||||||
DebugCommandArguments = "-workspace=C:\\Proj\\CycloBuddy"
|
DebugCommandArguments = "-proddir=C:\\proj\\CycloBuddy"
|
||||||
DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
|
DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
|
||||||
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ OtherLinkFlags = ""
|
||||||
TargetDirectory = "$(WorkspaceDir)/dist"
|
TargetDirectory = "$(WorkspaceDir)/dist"
|
||||||
TargetName = "BeefIDE_d2"
|
TargetName = "BeefIDE_d2"
|
||||||
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib wsock32.lib"
|
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib wsock32.lib"
|
||||||
DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests"
|
DebugCommandArguments = "-proddir=C:\\Beef\\ide\\mintest"
|
||||||
DebugWorkingDirectory = "$(ProjectDir)\\dist"
|
DebugWorkingDirectory = "$(ProjectDir)\\dist"
|
||||||
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
|
||||||
|
|
||||||
|
|
|
@ -216,36 +216,23 @@ namespace Hey.Dude.Bro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Florgs()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static int Main(String[] args)
|
public static int Main(String[] args)
|
||||||
{
|
{
|
||||||
Int i = (.)123;
|
function void() func = => Florgs;
|
||||||
i = i + i;
|
int32 val = (int32)(int)(void*)func;
|
||||||
|
|
||||||
Zangles zang = scope .();
|
//void* ptr = "Hey";
|
||||||
|
//val = (int32)ptr;
|
||||||
|
|
||||||
Zangles.GetMe(zang, "hey");
|
|
||||||
|
|
||||||
TypeCode tc = .Boolean;
|
//Test2(1, 2, val, 4);
|
||||||
|
|
||||||
PrintF("Hey\n");
|
|
||||||
|
|
||||||
//Test2(1, 2, 3, 4);
|
|
||||||
|
|
||||||
/*IHashable ih = (int32)TypeCode.Boolean;
|
|
||||||
let hashCode = ih.GetHashCode();*/
|
|
||||||
|
|
||||||
Object obj = new Object();
|
|
||||||
|
|
||||||
int* iPtr = scope .();
|
|
||||||
int hash = GetHash(iPtr);
|
|
||||||
|
|
||||||
|
|
||||||
//Test2(1, 2, 3, 4);
|
|
||||||
|
|
||||||
|
|
||||||
Blurg.Hey();
|
Blurg.Hey();
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,3 +321,10 @@ static
|
||||||
static int gApsings = 123;
|
static int gApsings = 123;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*namespace zSquarf
|
||||||
|
{
|
||||||
|
class Zorf
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}*/
|
|
@ -1,3 +1,5 @@
|
||||||
|
//using Squarf;
|
||||||
|
|
||||||
//GORB
|
//GORB
|
||||||
#pragma warning disable 168
|
#pragma warning disable 168
|
||||||
|
|
||||||
|
@ -6,10 +8,19 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
|
enum EnumA
|
||||||
|
{
|
||||||
|
Abo = 1,
|
||||||
|
Boop = _*2,
|
||||||
|
Croop = _*2,
|
||||||
|
}
|
||||||
|
|
||||||
struct Blurg
|
struct Blurg
|
||||||
{
|
{
|
||||||
public static int32 Hey()
|
public static int32 Hey()
|
||||||
{
|
{
|
||||||
|
int a = 123;
|
||||||
|
int* aPtr = &a;
|
||||||
|
|
||||||
return (int32)123;
|
return (int32)123;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4282,7 +4282,7 @@ namespace IDE
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RecordHistoryLocation(bool includeLastActive = false, bool b = true)
|
public void RecordHistoryLocation(bool includeLastActive = false)
|
||||||
{
|
{
|
||||||
var sourceViewPanel = GetActiveSourceViewPanel(includeLastActive);
|
var sourceViewPanel = GetActiveSourceViewPanel(includeLastActive);
|
||||||
if (sourceViewPanel != null)
|
if (sourceViewPanel != null)
|
||||||
|
|
|
@ -495,6 +495,7 @@ namespace IDE.ui
|
||||||
public uint32 mDisplayColor;
|
public uint32 mDisplayColor;
|
||||||
public bool mIsReg;
|
public bool mIsReg;
|
||||||
public bool mIsVisible;
|
public bool mIsVisible;
|
||||||
|
public Rect? mDrawRect;
|
||||||
|
|
||||||
public this(BinaryDataWidget binaryDataWidget, StringView expr, int memStart, int size, StringView displayName, uint32 displayColor, bool isReg)
|
public this(BinaryDataWidget binaryDataWidget, StringView expr, int memStart, int size, StringView displayName, uint32 displayColor, bool isReg)
|
||||||
{
|
{
|
||||||
|
@ -861,6 +862,9 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
base.Draw(g);
|
base.Draw(g);
|
||||||
|
|
||||||
|
for (var te in mTrackedExprs)
|
||||||
|
te.mDrawRect = null;
|
||||||
|
|
||||||
int barThickness = (int)GS!(1.5f);
|
int barThickness = (int)GS!(1.5f);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1429,6 +1433,8 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (var kvp in trackedRegYDict)
|
for (var kvp in trackedRegYDict)
|
||||||
{
|
{
|
||||||
var te = kvp.key;
|
var te = kvp.key;
|
||||||
|
@ -1441,6 +1447,9 @@ namespace IDE.ui
|
||||||
var useFont = IDEApp.sApp.mTinyCodeFont;
|
var useFont = IDEApp.sApp.mTinyCodeFont;
|
||||||
float strWidth = useFont.GetWidth(te.mExpr);
|
float strWidth = useFont.GetWidth(te.mExpr);
|
||||||
bool shortLine = trackedRegYShortLines[lineIdx];
|
bool shortLine = trackedRegYShortLines[lineIdx];
|
||||||
|
var useLineSpacing = useFont.GetLineSpacing();
|
||||||
|
|
||||||
|
te.mDrawRect = Rect(barX, barY, strWidth + GS!(2), useLineSpacing + GS!(2));
|
||||||
|
|
||||||
if (te.mDisplayName.StartsWith("$"))
|
if (te.mDisplayName.StartsWith("$"))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1448,7 +1457,6 @@ namespace IDE.ui
|
||||||
using (g.PushColor(te.mDisplayColor))
|
using (g.PushColor(te.mDisplayColor))
|
||||||
{
|
{
|
||||||
var regsOnThisLine = trackedRegsByLine[lineIdx].Count;
|
var regsOnThisLine = trackedRegsByLine[lineIdx].Count;
|
||||||
var useLineSpacing = useFont.GetLineSpacing();
|
|
||||||
float barYAdj = barY + useLineSpacing*0.5f + GS!(1);
|
float barYAdj = barY + useLineSpacing*0.5f + GS!(1);
|
||||||
float barGoalYAdj = barGoalY + useLineSpacing*0.5f + GS!(1);
|
float barGoalYAdj = barGoalY + useLineSpacing*0.5f + GS!(1);
|
||||||
if (regsOnThisLine == 2)
|
if (regsOnThisLine == 2)
|
||||||
|
@ -1699,6 +1707,18 @@ namespace IDE.ui
|
||||||
|
|
||||||
var selection = GetSelectionForDisplayPosition(x, y, 1, 1);
|
var selection = GetSelectionForDisplayPosition(x, y, 1, 1);
|
||||||
|
|
||||||
|
if (selection == null)
|
||||||
|
{
|
||||||
|
for (var te in mTrackedExprs)
|
||||||
|
{
|
||||||
|
if ((var rect = te.mDrawRect) && (rect.Contains(x, y)))
|
||||||
|
{
|
||||||
|
SelectRange(te.mCurValue, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (selection != null)
|
if (selection != null)
|
||||||
{
|
{
|
||||||
delete mCurKeyCursor;
|
delete mCurKeyCursor;
|
||||||
|
|
|
@ -687,7 +687,9 @@ namespace IDE.ui
|
||||||
if (folder.mIncludeKind != .Auto)
|
if (folder.mIncludeKind != .Auto)
|
||||||
folder.mProject.SetChanged();
|
folder.mProject.SetChanged();
|
||||||
|
|
||||||
|
gApp.RecordHistoryLocation(true);
|
||||||
gApp.ShowProjectItem(projectSource);
|
gApp.ShowProjectItem(projectSource);
|
||||||
|
gApp.RecordHistoryLocation(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CompareListViewItem(ListViewItem left, ListViewItem right)
|
int CompareListViewItem(ListViewItem left, ListViewItem right)
|
||||||
|
|
|
@ -7938,7 +7938,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
{
|
{
|
||||||
if ((!ignoreErrors) && (!typedVal.mType->GetUnderlyingType()->IsVoid()) && ((castFlags & BfCastFlags_FromCompiler) == 0))
|
if ((!ignoreErrors) && (!typedVal.mType->GetUnderlyingType()->IsVoid()) && ((castFlags & BfCastFlags_FromCompiler) == 0))
|
||||||
{
|
{
|
||||||
Fail(StrFormat("Unable to cast direct from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode);
|
Fail(StrFormat("Unable to cast directly from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto toPrimitive = (BfPrimitiveType*)toType;
|
auto toPrimitive = (BfPrimitiveType*)toType;
|
||||||
|
@ -7950,7 +7950,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
{
|
{
|
||||||
if ((!ignoreErrors) && (!toType->GetUnderlyingType()->IsVoid()) && ((castFlags & BfCastFlags_FromCompiler) == 0))
|
if ((!ignoreErrors) && (!toType->GetUnderlyingType()->IsVoid()) && ((castFlags & BfCastFlags_FromCompiler) == 0))
|
||||||
{
|
{
|
||||||
Fail(StrFormat("Unable to cast direct from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode);
|
Fail(StrFormat("Unable to cast directly from '%s' to '%s', consider casting to void* first", TypeToString(typedVal.mType).c_str(), TypeToString(toType).c_str()), srcNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mBfIRBuilder->CreateIntToPtr(typedVal.mValue, mBfIRBuilder->MapType(toType));
|
return mBfIRBuilder->CreateIntToPtr(typedVal.mValue, mBfIRBuilder->MapType(toType));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue