Change UInt64 to long

This is due to inability Dapper handle UInt64 with SQLite
This commit is contained in:
Andrey Kurdyumov 2015-02-08 21:58:01 +06:00
parent 6080592f99
commit fec99ddb25
6 changed files with 33 additions and 33 deletions

View file

@ -79,10 +79,10 @@ namespace Cosmos.Build.MSBuild {
{ {
uint xAddress = UInt32.Parse(xLineParts[0], NumberStyles.HexNumber); uint xAddress = UInt32.Parse(xLineParts[0], NumberStyles.HexNumber);
ulong xId; long xId;
if (xLineParts[2].StartsWith("GUID_")) if (xLineParts[2].StartsWith("GUID_"))
{ {
xId = ulong.Parse(xLineParts[2].Substring(5)); xId = long.Parse(xLineParts[2].Substring(5));
} }
else else
{ {

View file

@ -21,27 +21,27 @@ namespace Cosmos.Debug.Common
/// <summary> /// <summary>
/// Current id of the generation. /// Current id of the generation.
/// </summary> /// </summary>
private static UInt64 mLastGuid = 0; private static long mLastGuid = 0;
/// <summary> /// <summary>
/// Range for the id generation process. /// Range for the id generation process.
/// </summary> /// </summary>
private static UInt64 mPrefix = 0; private static long mPrefix = 0;
/// <summary> /// <summary>
/// Specifies range which is used by the assembler during compilation phase. /// Specifies range which is used by the assembler during compilation phase.
/// </summary> /// </summary>
public const ulong AssemblerDebugSymbolsRange = 0xUL; public const long AssemblerDebugSymbolsRange = 0xL;
/// <summary> /// <summary>
/// Specifies range which is used by the Elf map extraction process. /// Specifies range which is used by the Elf map extraction process.
/// </summary> /// </summary>
public const ulong ElfFileMapExtractionRange = 0x1000000000000000UL; public const long ElfFileMapExtractionRange = 0x1000000000000000L;
/// <summary> /// <summary>
/// Specifies range which is used by the Nasm map extraction process. /// Specifies range which is used by the Nasm map extraction process.
/// </summary> /// </summary>
public const ulong NAsmMapExtractionRange = 0x4000000000000000UL; public const long NAsmMapExtractionRange = 0x4000000000000000L;
// Please beware this field, it may cause issues if used incorrectly. // Please beware this field, it may cause issues if used incorrectly.
public static DebugInfo CurrentInstance { get; private set; } public static DebugInfo CurrentInstance { get; private set; }
@ -316,7 +316,7 @@ namespace Cosmos.Debug.Common
// Quick look up of assemblies so we dont have to go to the database and compare by fullname. // Quick look up of assemblies so we dont have to go to the database and compare by fullname.
// This and other GUID lists contain only a few members, and save us from issuing a lot of selects to SQL. // This and other GUID lists contain only a few members, and save us from issuing a lot of selects to SQL.
public Dictionary<Assembly, UInt64> AssemblyGUIDs = new Dictionary<Assembly, UInt64>(); public Dictionary<Assembly, long> AssemblyGUIDs = new Dictionary<Assembly, long>();
List<Cosmos.Debug.Common.AssemblyFile> xAssemblies = new List<Cosmos.Debug.Common.AssemblyFile>(); List<Cosmos.Debug.Common.AssemblyFile> xAssemblies = new List<Cosmos.Debug.Common.AssemblyFile>();
public void AddAssemblies(List<Assembly> aAssemblies, bool aFlush = false) public void AddAssemblies(List<Assembly> aAssemblies, bool aFlush = false)
{ {
@ -338,7 +338,7 @@ namespace Cosmos.Debug.Common
BulkInsert("AssemblyFiles", xAssemblies, 2500, aFlush); BulkInsert("AssemblyFiles", xAssemblies, 2500, aFlush);
} }
public Dictionary<string, UInt64> DocumentGUIDs = new Dictionary<string, UInt64>(); public Dictionary<string, long> DocumentGUIDs = new Dictionary<string, long>();
List<Document> xDocuments = new List<Document>(1); List<Document> xDocuments = new List<Document>(1);
public void AddDocument(string aPathname, bool aFlush = false) public void AddDocument(string aPathname, bool aFlush = false)
{ {
@ -500,7 +500,7 @@ namespace Cosmos.Debug.Common
public Label GetMethodHeaderLabel(UInt32 aAddress) public Label GetMethodHeaderLabel(UInt32 aAddress)
{ {
var xAddress = (ulong)aAddress; var xAddress = (long)aAddress;
var xLabels = mConnection.Query<Label>(new SQLinq<Label>().Where(i => i.Address <= xAddress).OrderByDescending(i => i.Address)).ToArray(); var xLabels = mConnection.Query<Label>(new SQLinq<Label>().Where(i => i.Address <= xAddress).OrderByDescending(i => i.Address)).ToArray();
Label methodHeaderLabel = null; Label methodHeaderLabel = null;
@ -682,7 +682,7 @@ namespace Cosmos.Debug.Common
/// Sets the range in which id would be generated. /// Sets the range in which id would be generated.
/// </summary> /// </summary>
/// <param name="idRange">Number which specified id range.</param> /// <param name="idRange">Number which specified id range.</param>
public static void SetRange(ulong idRange) public static void SetRange(long idRange)
{ {
mPrefix = idRange; mPrefix = idRange;
mLastGuid = idRange; mLastGuid = idRange;
@ -692,7 +692,7 @@ namespace Cosmos.Debug.Common
/// Gets count of ids generated during last session. /// Gets count of ids generated during last session.
/// </summary> /// </summary>
/// <returns>Count of generated ids.</returns> /// <returns>Count of generated ids.</returns>
public static ulong GeneratedIdsCount() public static long GeneratedIdsCount()
{ {
return mLastGuid - mPrefix; return mLastGuid - mPrefix;
} }
@ -701,7 +701,7 @@ namespace Cosmos.Debug.Common
/// Generates new id for the symbol. /// Generates new id for the symbol.
/// </summary> /// </summary>
/// <returns>New value for the id.</returns> /// <returns>New value for the id.</returns>
public static ulong CreateId() public static long CreateId()
{ {
mLastGuid++; mLastGuid++;
return mLastGuid; return mLastGuid;

View file

@ -20,7 +20,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get;set; get;set;
} }
@ -47,7 +47,7 @@ namespace Cosmos.Debug.Common
[Key] [Key]
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -110,7 +110,7 @@ namespace Cosmos.Debug.Common
[DataMemberAttribute()] [DataMemberAttribute()]
[Key] [Key]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -154,7 +154,7 @@ namespace Cosmos.Debug.Common
[Key] [Key]
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -174,7 +174,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -196,7 +196,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ADDRESS")] [SQLinqColumn("ADDRESS")]
public global::System.UInt64 Address public global::System.Int64 Address
{ {
get; get;
set; set;
@ -283,7 +283,7 @@ namespace Cosmos.Debug.Common
[Key] [Key]
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -304,7 +304,7 @@ namespace Cosmos.Debug.Common
[DataMemberAttribute()] [DataMemberAttribute()]
[Key] [Key]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -337,7 +337,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ASSEMBLYFILEID")] [SQLinqColumn("ASSEMBLYFILEID")]
public global::System.UInt64 AssemblyFileID public global::System.Int64 AssemblyFileID
{ {
get; get;
set; set;
@ -370,7 +370,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("DOCUMENTID")] [SQLinqColumn("DOCUMENTID")]
public global::System.UInt64 DocumentID public global::System.Int64 DocumentID
{ {
get; get;
set; set;
@ -381,7 +381,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("LABELSTARTID")] [SQLinqColumn("LABELSTARTID")]
public Nullable<global::System.UInt64> LabelStartID public Nullable<global::System.Int64> LabelStartID
{ {
get; get;
set; set;
@ -392,7 +392,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("LABELENDID")] [SQLinqColumn("LABELENDID")]
public Nullable<global::System.UInt64> LabelEndID public Nullable<global::System.Int64> LabelEndID
{ {
get; get;
set; set;
@ -424,7 +424,7 @@ namespace Cosmos.Debug.Common
[Key] [Key]
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("ID")] [SQLinqColumn("ID")]
public global::System.UInt64 ID public global::System.Int64 ID
{ {
get; get;
set; set;
@ -468,7 +468,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("METHODID")] [SQLinqColumn("METHODID")]
public Nullable<global::System.UInt64> MethodID public Nullable<global::System.Int64> MethodID
{ {
get; get;
set; set;
@ -499,7 +499,7 @@ namespace Cosmos.Debug.Common
/// </summary> /// </summary>
[DataMemberAttribute()] [DataMemberAttribute()]
[SQLinqColumn("METHODID")] [SQLinqColumn("METHODID")]
public global::System.UInt64 MethodID public global::System.Int64 MethodID
{ {
get; get;
set; set;

View file

@ -83,11 +83,11 @@ namespace Cosmos.Debug.Common {
continue; continue;
} }
UInt64 xGuid; long xGuid;
// See if label has an embedded GUID. If so, use it. // See if label has an embedded GUID. If so, use it.
if (xLabel.StartsWith("GUID_")) if (xLabel.StartsWith("GUID_"))
{ {
xGuid = ulong.Parse(xLabel.Substring(5)); xGuid = long.Parse(xLabel.Substring(5));
} }
else else
{ {

View file

@ -106,7 +106,7 @@ namespace Cosmos.Debug.VSDebugEngine {
// VS will send us BPs from other Cosmos projects (and possibly non Cosmos ones, didnt look that deep) // VS will send us BPs from other Cosmos projects (and possibly non Cosmos ones, didnt look that deep)
// but we wont have them in our doc list because it contains only ones from the currently project // but we wont have them in our doc list because it contains only ones from the currently project
// to run. // to run.
UInt64 xDocID; long xDocID;
if (xDebugInfo.DocumentGUIDs.TryGetValue(xDocName, out xDocID)) { if (xDebugInfo.DocumentGUIDs.TryGetValue(xDocName, out xDocID)) {
// Find which Method the Doc, Line, Col are in. // Find which Method the Doc, Line, Col are in.
// Must add +1 for both Line and Col. They are 0 based, while SP ones are 1 based. // Must add +1 for both Line and Col. They are 0 based, while SP ones are 1 based.

View file

@ -45,8 +45,8 @@ namespace Cosmos.IL2CPU
public readonly Cosmos.Assembler.Assembler Assembler; public readonly Cosmos.Assembler.Assembler Assembler;
// //
protected string mCurrentMethodLabel; protected string mCurrentMethodLabel;
protected UInt64 mCurrentMethodLabelEndGuid; protected long mCurrentMethodLabelEndGuid;
protected UInt64 mCurrentMethodGuid; protected long mCurrentMethodGuid;
public AppAssembler(int aComPort, string assemblerLogFile) public AppAssembler(int aComPort, string assemblerLogFile)
{ {