This commit is contained in:
kudzu_cp 2010-08-28 20:09:21 +00:00
parent a71d09ee27
commit a7a2bb9aca
11 changed files with 412 additions and 162 deletions

View file

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Cosmos.Debug.GDB {
public class AsmFile {
protected List<string> mLines = new List<string>();
public AsmFile(string aPathname) {
using (var xReader = new StreamReader(aPathname)) {
while (!xReader.EndOfStream) {
mLines.Add(xReader.ReadLine());
}
}
}
}
}

View file

@ -72,6 +72,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AsmFile.cs" />
<Compile Include="BreakpointUC.cs">
<SubType>UserControl</SubType>
</Compile>

View file

@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
@ -147,16 +148,13 @@ namespace Cosmos.Debug.GDB {
mitmConnect.Enabled = false;
Windows.CreateForms();
Global.AsmSource = new AsmFile(Path.Combine(Settings.OutputPath, Settings.AsmFile));
Global.GDB = new GDB(aRetry, OnGDBResponse);
if (Global.GDB.Connected) {
lablConnected.Visible = true;
lablRunning.Visible = true;
lablRunning.Text = "Stopped";
// Must be after Connect for now as it depends on Widnows being created
// Also sets saved breakpoints, so GDB needs to be connected
if (Settings.Filename != "") {
Settings.Load();
}
Settings.InitWindows();
Windows.UpdateAllWindows();
}
}

View file

@ -100,7 +100,7 @@ namespace Cosmos.Debug.GDB {
var xStartInfo = new ProcessStartInfo();
xStartInfo.FileName = mCosmosPath+ @"Build\Tools\gdb.exe";
xStartInfo.Arguments = @"--interpreter=mi2";
xStartInfo.WorkingDirectory = mCosmosPath + @"source2\Users\Kudzu\Breakpoints\bin\debug";
xStartInfo.WorkingDirectory = Settings.OutputPath;
xStartInfo.CreateNoWindow = true;
xStartInfo.UseShellExecute = false;
xStartInfo.RedirectStandardError = true;
@ -112,7 +112,7 @@ namespace Cosmos.Debug.GDB {
mGDBProcess.OutputDataReceived += new DataReceivedEventHandler(mGDBProcess_OutputDataReceived);
mGDBProcess.BeginOutputReadLine();
SendCmd("symbol-file Breakpoints.obj");
SendCmd("symbol-file " + Settings.ObjFile);
SendCmd("target remote :8832");
//while (!mConnected) {

View file

@ -7,6 +7,7 @@ using System.Text;
namespace Cosmos.Debug.GDB {
public class Global {
static public GDB GDB;
static public AsmFile AsmSource;
static public UInt32 FromHex(string aValue) {
return UInt32.Parse(aValue.Substring(2), NumberStyles.HexNumber);

View file

@ -9,7 +9,7 @@ namespace Cosmos.Debug.GDB {
static void Main() {
var xArgs = System.Environment.GetCommandLineArgs();
if (xArgs.Length > 1) {
Settings.Filename = xArgs[1];
Settings.Load(xArgs[1]);
}
if (xArgs.Length > 2) {
Settings.AutoConnect = string.Compare(xArgs[2], "/Connect", true) == 0;

View file

@ -10,7 +10,6 @@ namespace Cosmos.Debug.GDB {
static protected string mFilename = "";
static public string Filename {
get { return mFilename; }
set { mFilename = value; }
}
static protected bool mAutoConnect = false;
@ -19,6 +18,21 @@ namespace Cosmos.Debug.GDB {
set { mAutoConnect = value; }
}
static protected string mOutputPath;
static public string OutputPath {
get { return mOutputPath; }
}
static protected string mObjFile;
static public string ObjFile {
get { return mObjFile; }
}
static protected string mAsmFile;
static public string AsmFile {
get { return mAsmFile; }
}
static public SettingsDS DS = new SettingsDS();
static public void Save() {
@ -31,14 +45,22 @@ namespace Cosmos.Debug.GDB {
}
}
static public void Load() {
static public void Load(string aFilename) {
mFilename = aFilename;
if (File.Exists(Filename)) {
//TODO: Change this and other general settings to read from the General datatable
mOutputPath = Path.Combine(Path.GetDirectoryName(Filename), @"bin\debug\");
mObjFile = Path.GetFileNameWithoutExtension(Filename) + ".obj";
mAsmFile = Path.GetFileNameWithoutExtension(Filename) + ".asm";
DS.ReadXml(Filename, System.Data.XmlReadMode.IgnoreSchema);
Windows.RestorePositions();
Windows.mBreakpointsForm.LoadSession();
}
}
static public void InitWindows() {
Windows.RestorePositions();
Windows.mBreakpointsForm.LoadSession();
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@
<xs:element name="Breakpoint" msprop:Generator_UserTableName="Breakpoint" msprop:Generator_RowDeletedName="BreakpointRowDeleted" msprop:Generator_RowChangedName="BreakpointRowChanged" msprop:Generator_RowClassName="BreakpointRow" msprop:Generator_RowChangingName="BreakpointRowChanging" msprop:Generator_RowEvArgName="BreakpointRowChangeEvent" msprop:Generator_RowEvHandlerName="BreakpointRowChangeEventHandler" msprop:Generator_TableClassName="BreakpointDataTable" msprop:Generator_TableVarName="tableBreakpoint" msprop:Generator_RowDeletingName="BreakpointRowDeleting" msprop:Generator_TablePropName="Breakpoint">
<xs:complexType>
<xs:sequence>
<xs:element name="Label" msprop:Generator_UserColumnName="Label" msprop:Generator_ColumnPropNameInRow="Label" msprop:Generator_ColumnVarNameInTable="columnLabel" msprop:Generator_ColumnPropNameInTable="LabelColumn" type="xs:string" />
<xs:element name="Label" msprop:Generator_UserColumnName="Label" msprop:Generator_ColumnVarNameInTable="columnLabel" msprop:Generator_ColumnPropNameInRow="Label" msprop:Generator_ColumnPropNameInTable="LabelColumn" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
@ -26,12 +26,19 @@
<xs:element name="Window" msprop:Generator_UserTableName="Window" msprop:Generator_RowDeletedName="WindowRowDeleted" msprop:Generator_RowChangedName="WindowRowChanged" msprop:Generator_RowClassName="WindowRow" msprop:Generator_RowChangingName="WindowRowChanging" msprop:Generator_RowEvArgName="WindowRowChangeEvent" msprop:Generator_RowEvHandlerName="WindowRowChangeEventHandler" msprop:Generator_TableClassName="WindowDataTable" msprop:Generator_TableVarName="tableWindow" msprop:Generator_RowDeletingName="WindowRowDeleting" msprop:Generator_TablePropName="Window">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" type="xs:string" />
<xs:element name="Left" msprop:Generator_UserColumnName="Left" msprop:Generator_ColumnVarNameInTable="columnLeft" msprop:Generator_ColumnPropNameInRow="Left" msprop:Generator_ColumnPropNameInTable="LeftColumn" type="xs:int" minOccurs="0" />
<xs:element name="Top" msprop:Generator_UserColumnName="Top" msprop:Generator_ColumnVarNameInTable="columnTop" msprop:Generator_ColumnPropNameInRow="Top" msprop:Generator_ColumnPropNameInTable="TopColumn" type="xs:int" minOccurs="0" />
<xs:element name="Width" msprop:Generator_UserColumnName="Width" msprop:Generator_ColumnVarNameInTable="columnWidth" msprop:Generator_ColumnPropNameInRow="Width" msprop:Generator_ColumnPropNameInTable="WidthColumn" type="xs:int" minOccurs="0" />
<xs:element name="Height" msprop:Generator_UserColumnName="Height" msprop:Generator_ColumnVarNameInTable="columnHeight" msprop:Generator_ColumnPropNameInRow="Height" msprop:Generator_ColumnPropNameInTable="HeightColumn" type="xs:int" minOccurs="0" />
<xs:element name="Visible" msprop:Generator_UserColumnName="Visible" msprop:Generator_ColumnPropNameInRow="Visible" msprop:Generator_ColumnVarNameInTable="columnVisible" msprop:Generator_ColumnPropNameInTable="VisibleColumn" type="xs:boolean" minOccurs="0" />
<xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" type="xs:string" />
<xs:element name="Left" msprop:Generator_UserColumnName="Left" msprop:Generator_ColumnPropNameInRow="Left" msprop:Generator_ColumnVarNameInTable="columnLeft" msprop:Generator_ColumnPropNameInTable="LeftColumn" type="xs:int" minOccurs="0" />
<xs:element name="Top" msprop:Generator_UserColumnName="Top" msprop:Generator_ColumnPropNameInRow="Top" msprop:Generator_ColumnVarNameInTable="columnTop" msprop:Generator_ColumnPropNameInTable="TopColumn" type="xs:int" minOccurs="0" />
<xs:element name="Width" msprop:Generator_UserColumnName="Width" msprop:Generator_ColumnPropNameInRow="Width" msprop:Generator_ColumnVarNameInTable="columnWidth" msprop:Generator_ColumnPropNameInTable="WidthColumn" type="xs:int" minOccurs="0" />
<xs:element name="Height" msprop:Generator_UserColumnName="Height" msprop:Generator_ColumnPropNameInRow="Height" msprop:Generator_ColumnVarNameInTable="columnHeight" msprop:Generator_ColumnPropNameInTable="HeightColumn" type="xs:int" minOccurs="0" />
<xs:element name="Visible" msprop:Generator_UserColumnName="Visible" msprop:Generator_ColumnVarNameInTable="columnVisible" msprop:Generator_ColumnPropNameInRow="Visible" msprop:Generator_ColumnPropNameInTable="VisibleColumn" type="xs:boolean" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="General" msprop:Generator_UserTableName="General" msprop:Generator_RowDeletedName="GeneralRowDeleted" msprop:Generator_TableClassName="GeneralDataTable" msprop:Generator_RowChangedName="GeneralRowChanged" msprop:Generator_RowClassName="GeneralRow" msprop:Generator_RowChangingName="GeneralRowChanging" msprop:Generator_RowEvArgName="GeneralRowChangeEvent" msprop:Generator_RowEvHandlerName="GeneralRowChangeEventHandler" msprop:Generator_TablePropName="General" msprop:Generator_TableVarName="tableGeneral" msprop:Generator_RowDeletingName="GeneralRowDeleting">
<xs:complexType>
<xs:sequence>
<xs:element name="BinPath" msprop:Generator_UserColumnName="BinPath" msprop:Generator_ColumnPropNameInRow="BinPath" msprop:Generator_ColumnVarNameInTable="columnBinPath" msprop:Generator_ColumnPropNameInTable="BinPathColumn" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>

View file

@ -6,9 +6,10 @@
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="0" ViewPortY="0" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:Breakpoint" ZOrder="3" X="267" Y="90" Height="48" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="44" />
<Shape ID="DesignTable:Watch" ZOrder="2" X="471" Y="90" Height="48" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="44" />
<Shape ID="DesignTable:Window" ZOrder="1" X="689" Y="97" Height="143" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="139" />
<Shape ID="DesignTable:Breakpoint" ZOrder="4" X="267" Y="90" Height="48" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="44" />
<Shape ID="DesignTable:Watch" ZOrder="3" X="471" Y="90" Height="48" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="44" />
<Shape ID="DesignTable:Window" ZOrder="2" X="689" Y="97" Height="143" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="139" />
<Shape ID="DesignTable:General" ZOrder="1" X="52" Y="94" Height="48" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="44" />
</Shapes>
<Connectors />
</DiagramLayout>

View file

@ -53,7 +53,9 @@ System_Void__BreakpointsKernel_BreakpointsOS_BeforeRun____DOT__00000008:
<li>When Digits is a char array, we get a plug needed error.</li>
</ul>
</li>
<li>Plugs <ul>
<li>cxdb contains full asm path and filenames over and over... cant we write them
out once and use a byte/word index to identify them? This will make it smaller
and make reading faster.<li>Plugs <ul>
<li>Source Plugs - Leave as they are</li>
<li>Assembly Plugs - Change to have attribute on the TARGET instead of the
implementation and only allow assembly.. this cuts out the &quot;proxy&quot; class and