mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-12 19:21:40 +00:00
This commit is contained in:
parent
28321c8e50
commit
564ad17686
4 changed files with 74 additions and 5 deletions
|
|
@ -88,6 +88,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Docs", "..\Docs", "{67E7DEF
|
|||
Release.AspNetCompiler.ForceOverwrite = "true"
|
||||
Release.AspNetCompiler.FixedNames = "false"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
VWDPort = "4127"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Compiler.Debug", "..\source2\IL2CPU\Cosmos.IL2CPU.Debug\Cosmos.Compiler.Debug.csproj", "{9998B4EA-385E-4DA2-8905-2BBEB5B2C6E2}"
|
||||
|
|
@ -1014,6 +1015,7 @@ Global
|
|||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Bootstrap|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Bootstrap|Any CPU.Build.0 = Release|Any CPU
|
||||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Bootstrap|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Bootstrap|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Bootstrap|x86.ActiveCfg = Release|Any CPU
|
||||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
|
|
@ -1028,6 +1030,7 @@ Global
|
|||
{6882C74B-3ED2-4D76-9E7B-67B6A28808BC}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{23476FAD-3712-4A4B-90C0-CCCC9AC8D953}.Bootstrap|Any CPU.ActiveCfg = Release|x86
|
||||
{23476FAD-3712-4A4B-90C0-CCCC9AC8D953}.Bootstrap|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{23476FAD-3712-4A4B-90C0-CCCC9AC8D953}.Bootstrap|Mixed Platforms.Build.0 = Release|x86
|
||||
{23476FAD-3712-4A4B-90C0-CCCC9AC8D953}.Bootstrap|x86.ActiveCfg = Release|x86
|
||||
{23476FAD-3712-4A4B-90C0-CCCC9AC8D953}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{23476FAD-3712-4A4B-90C0-CCCC9AC8D953}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
|
|
@ -1057,7 +1060,9 @@ Global
|
|||
{04602B68-B877-4CA0-B17B-09C309732943}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Bootstrap|Any CPU.ActiveCfg = Release|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Bootstrap|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Bootstrap|Mixed Platforms.Build.0 = Release|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Bootstrap|x86.ActiveCfg = Release|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Bootstrap|x86.Build.0 = Release|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
|
|
@ -1070,7 +1075,9 @@ Global
|
|||
{C9E995CF-CB65-4410-A7D2-63EBBE02AABB}.Release|x86.Build.0 = Release|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Bootstrap|Any CPU.ActiveCfg = Release|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Bootstrap|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Bootstrap|Mixed Platforms.Build.0 = Release|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Bootstrap|x86.ActiveCfg = Release|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Bootstrap|x86.Build.0 = Release|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{2E14EED0-F7E9-4E7C-AA21-6E519C28457D}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
|
|
@ -1140,7 +1147,6 @@ Global
|
|||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Bootstrap|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Bootstrap|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Bootstrap|x86.ActiveCfg = Release|Any CPU
|
||||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Bootstrap|x86.Build.0 = Release|Any CPU
|
||||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{47E8F3DC-FF3F-4CC7-8643-1807260B0B18}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Cosmos.Debug.VSDebugEngine
|
||||
{
|
||||
|
|
@ -640,6 +641,7 @@ namespace Cosmos.Debug.VSDebugEngine
|
|||
// The sample engine does not support dissassembly so it returns E_NOTIMPL
|
||||
public int GetDisassemblyStream(enum_DISASSEMBLY_STREAM_SCOPE dwScope, IDebugCodeContext2 codeContext, out IDebugDisassemblyStream2 disassemblyStream)
|
||||
{
|
||||
MessageBox.Show("Disassembly");
|
||||
Trace.WriteLine(new StackTrace(false).GetFrame(0).GetMethod().GetFullName());
|
||||
disassemblyStream = null;
|
||||
return VSConstants.E_NOTIMPL;
|
||||
|
|
|
|||
|
|
@ -106,6 +106,10 @@ namespace Cosmos.Debug.VSDebugEngine {
|
|||
var xBBP = new AD7BoundBreakpoint(mEngine, xAddress, this, xBPR);
|
||||
mBoundBPs.Add(xBBP);
|
||||
}
|
||||
//MessageBox.Show("Name: " + documentName);
|
||||
//MessageBox.Show("Start Pos: " + startPosition[0].dwLine + " " + startPosition[0].dwColumn);
|
||||
//MessageBox.Show("End Pos: " + endPosition[0].dwLine + " " + endPosition[0].dwColumn);
|
||||
//MessageBox.Show(xAddress.ToString());
|
||||
|
||||
// Ask the symbol engine to find all addresses in all modules with symbols that match this source and line number.
|
||||
//uint[] addresses = mEngine.DebuggedProcess.GetAddressesForSourceLocation(null,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
|
|||
using Cosmos.Compiler.Debug;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace Cosmos.Debug.VSDebugEngine
|
||||
{
|
||||
|
|
@ -153,13 +154,69 @@ namespace Cosmos.Debug.VSDebugEngine
|
|||
TEXT_POSITION[] endPosition = new TEXT_POSITION[1];
|
||||
EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition));
|
||||
|
||||
// Get C# lines
|
||||
TextReader xTR = new StreamReader(documentName);
|
||||
string xFile = xTR.ReadToEnd();
|
||||
xTR.Close();
|
||||
xFile = xFile.Replace('\r', ' ');
|
||||
xFile = xFile.Trim();
|
||||
string[] xFileLines = xFile.Split('\n');
|
||||
string xMethod = xFileLines[startPosition[0].dwLine - 1];
|
||||
int xstart = 0, xstop = 0;
|
||||
string[] xMethodParts = xMethod.Split(' ');
|
||||
for (int j = 0; j < xMethodParts.Length; j++)
|
||||
{
|
||||
if (xMethodParts[j].Contains("()"))
|
||||
{
|
||||
xMethod = xMethodParts[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
xMethod = "_" + xMethod;
|
||||
xMethod = xMethod.Replace("()", "__:");
|
||||
|
||||
// Get ASM lines
|
||||
xstart = 0; xstop = 0;
|
||||
xstart = documentName.LastIndexOf('\\');
|
||||
xstop = documentName.LastIndexOf('.');
|
||||
string xFileName = documentName.Substring(0, xstart);
|
||||
xFileName = Path.GetDirectoryName(documentName);
|
||||
xFileName = Path.Combine(xFileName, "bin", "Debug");
|
||||
// TODO: Error checking for no return files.
|
||||
string[] xFiles = Directory.GetFiles(xFileName, "*.asm");
|
||||
xFileName = Path.Combine(xFileName, xFiles[0]);
|
||||
xTR = new StreamReader(xFileName);
|
||||
xFile = xTR.ReadToEnd();
|
||||
xTR.Close();
|
||||
xFile = xFile.Replace('\r', ' ');
|
||||
xFile = xFile.Trim();
|
||||
xFileLines = xFile.Split('\n');
|
||||
int k = 0, l = 0;
|
||||
for (int j = 0; j < xFileLines.Length; j++)
|
||||
{
|
||||
if (xFileLines[j].Contains(xMethod))
|
||||
{
|
||||
k = j;
|
||||
j++;
|
||||
}
|
||||
if ((k != 0) && (xFileLines[j].Contains(":")))
|
||||
{
|
||||
l = j - 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//MessageBox.Show(xFileLines[k]);
|
||||
//MessageBox.Show(xFileLines[l]);
|
||||
//MessageBox.Show(k.ToString());
|
||||
//MessageBox.Show(l.ToString());
|
||||
//MessageBox.Show("Name: " + documentName);
|
||||
//MessageBox.Show("Start Pos: " + startPosition[0].dwLine + " " + startPosition[0].dwColumn);
|
||||
//MessageBox.Show("End Pos: " + endPosition[0].dwLine + " " + endPosition[0].dwColumn);
|
||||
byte[] xMsg = new byte[255];
|
||||
xMsg = System.Text.Encoding.ASCII.GetBytes(documentName);
|
||||
DebugWindows.SendCommand(DwMsgType.Assembly, xMsg);
|
||||
////
|
||||
for (int j = k; j < l; j++)
|
||||
{
|
||||
DebugWindows.SendCommand(DwMsgType.Assembly, Encoding.ASCII.GetBytes(xFileLines[j]));
|
||||
}
|
||||
////
|
||||
|
||||
// An engine that supports more advanced breakpoint features such as hit counts, conditions and filters
|
||||
// should notify each bound breakpoint that it has been hit and evaluate conditions here.
|
||||
|
|
|
|||
Loading…
Reference in a new issue