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);
ulong xId;
long xId;
if (xLineParts[2].StartsWith("GUID_"))
{
xId = ulong.Parse(xLineParts[2].Substring(5));
xId = long.Parse(xLineParts[2].Substring(5));
}
else
{

View file

@ -21,27 +21,27 @@ namespace Cosmos.Debug.Common
/// <summary>
/// Current id of the generation.
/// </summary>
private static UInt64 mLastGuid = 0;
private static long mLastGuid = 0;
/// <summary>
/// Range for the id generation process.
/// </summary>
private static UInt64 mPrefix = 0;
private static long mPrefix = 0;
/// <summary>
/// Specifies range which is used by the assembler during compilation phase.
/// </summary>
public const ulong AssemblerDebugSymbolsRange = 0xUL;
public const long AssemblerDebugSymbolsRange = 0xL;
/// <summary>
/// Specifies range which is used by the Elf map extraction process.
/// </summary>
public const ulong ElfFileMapExtractionRange = 0x1000000000000000UL;
public const long ElfFileMapExtractionRange = 0x1000000000000000L;
/// <summary>
/// Specifies range which is used by the Nasm map extraction process.
/// </summary>
public const ulong NAsmMapExtractionRange = 0x4000000000000000UL;
public const long NAsmMapExtractionRange = 0x4000000000000000L;
// Please beware this field, it may cause issues if used incorrectly.
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.
// 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>();
public void AddAssemblies(List<Assembly> aAssemblies, bool aFlush = false)
{
@ -338,7 +338,7 @@ namespace Cosmos.Debug.Common
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);
public void AddDocument(string aPathname, bool aFlush = false)
{
@ -500,7 +500,7 @@ namespace Cosmos.Debug.Common
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();
Label methodHeaderLabel = null;
@ -682,7 +682,7 @@ namespace Cosmos.Debug.Common
/// Sets the range in which id would be generated.
/// </summary>
/// <param name="idRange">Number which specified id range.</param>
public static void SetRange(ulong idRange)
public static void SetRange(long idRange)
{
mPrefix = idRange;
mLastGuid = idRange;
@ -692,7 +692,7 @@ namespace Cosmos.Debug.Common
/// Gets count of ids generated during last session.
/// </summary>
/// <returns>Count of generated ids.</returns>
public static ulong GeneratedIdsCount()
public static long GeneratedIdsCount()
{
return mLastGuid - mPrefix;
}
@ -701,7 +701,7 @@ namespace Cosmos.Debug.Common
/// Generates new id for the symbol.
/// </summary>
/// <returns>New value for the id.</returns>
public static ulong CreateId()
public static long CreateId()
{
mLastGuid++;
return mLastGuid;

View file

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

View file

@ -83,11 +83,11 @@ namespace Cosmos.Debug.Common {
continue;
}
UInt64 xGuid;
long xGuid;
// See if label has an embedded GUID. If so, use it.
if (xLabel.StartsWith("GUID_"))
{
xGuid = ulong.Parse(xLabel.Substring(5));
xGuid = long.Parse(xLabel.Substring(5));
}
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)
// but we wont have them in our doc list because it contains only ones from the currently project
// to run.
UInt64 xDocID;
long xDocID;
if (xDebugInfo.DocumentGUIDs.TryGetValue(xDocName, out xDocID)) {
// 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.

View file

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