Browse Source

Fixed breakpoints for whitespace lines

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3236 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
99bb0a198e
  1. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs
  2. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/SourcecodeSegment.cs
  3. 3
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Primitive.cs
  4. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.cs
  5. 76
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.cs

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs

@ -76,7 +76,7 @@ namespace Debugger.AddIn.TreeModel @@ -76,7 +76,7 @@ namespace Debugger.AddIn.TreeModel
if (DebuggingOptions.Instance.ShowValuesInHexadecimal && val.Type.IsInteger) {
this.Text = String.Format("0x{0:X}", val.PrimitiveValue);
} else if (val.Type.IsPointer) {
this.Text = String.Format("0x{0:X}", val.PrimitiveValue);
this.Text = String.Format("0x{0:X}", val.PointerAddress);
} else {
this.Text = val.AsString;
}

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/SourcecodeSegment.cs

@ -147,8 +147,8 @@ namespace Debugger @@ -147,8 +147,8 @@ namespace Debugger
ISymUnmanagedMethod symMethod;
try {
//uint validLine = symDoc.FindClosestLine((uint)StartLine);
symMethod = symReader.GetMethodFromDocumentPosition(symDoc, (uint)line, (uint)column);
uint validLine = symDoc.FindClosestLine((uint)line);
symMethod = symReader.GetMethodFromDocumentPosition(symDoc, (uint)validLine, (uint)column);
} catch {
return null; //Not found
}

3
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Primitive.cs

@ -35,9 +35,6 @@ namespace Debugger @@ -35,9 +35,6 @@ namespace Debugger
/// </summary>
public object PrimitiveValue {
get {
if (this.Type.IsPointer) {
return this.CorValue.CastTo<ICorDebugReferenceValue>().Address;
}
if (!this.Type.IsPrimitive) throw new DebuggerException("Value is not a primitive type");
if (this.Type.IsString) {
if (this.IsNull) return null;

8
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.cs

@ -143,6 +143,14 @@ namespace Debugger @@ -143,6 +143,14 @@ namespace Debugger
}
}
[Tests.Ignore]
public ulong PointerAddress {
get {
if (!this.Type.IsPointer) throw new DebuggerException("Not a pointer");
return this.CorValue.CastTo<ICorDebugReferenceValue>().Value;
}
}
/// <summary> Dereferences a pointer type </summary>
/// <returns> Returns null for a null pointer </returns>
public Value Dereference()

76
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.cs

@ -16,6 +16,8 @@ namespace Debugger.Tests.TestPrograms @@ -16,6 +16,8 @@ namespace Debugger.Tests.TestPrograms
System.Diagnostics.Debugger.Break();
System.Diagnostics.Debug.WriteLine("Main 1");
System.Diagnostics.Debug.WriteLine("Main 2"); // Breakpoint
// Breakpoint
System.Diagnostics.Debug.WriteLine("Main 3");
System.Diagnostics.Debugger.Break();
}
}
@ -30,17 +32,23 @@ namespace Debugger.Tests { @@ -30,17 +32,23 @@ namespace Debugger.Tests {
[NUnit.Framework.Test]
public void Breakpoint()
{
Breakpoint breakpoint = debugger.AddBreakpoint(@"Breakpoint.cs", 18);
Breakpoint breakpoint1 = debugger.AddBreakpoint(@"Breakpoint.cs", 18);
Breakpoint breakpoint2 = debugger.AddBreakpoint(@"Breakpoint.cs", 19);
StartTest("Breakpoint.cs");
Assert.IsTrue(breakpoint.IsSet);
ObjectDump(breakpoint);
Assert.IsTrue(breakpoint1.IsSet);
Assert.IsTrue(breakpoint2.IsSet);
ObjectDump("Breakpoint1", breakpoint1);
ObjectDump("Breakpoint2", breakpoint2);
process.Continue();
process.Continue();
process.Continue();
process.AsyncContinue();
process.WaitForExit();
ObjectDump(breakpoint);
ObjectDump("Breakpoint1", breakpoint1);
ObjectDump("Breakpoint2", breakpoint2);
EndTest();
}
@ -58,29 +66,55 @@ namespace Debugger.Tests { @@ -58,29 +66,55 @@ namespace Debugger.Tests {
<ModuleLoaded>Breakpoint.exe (Has symbols)</ModuleLoaded>
<ModuleLoaded>System.dll (No symbols)</ModuleLoaded>
<DebuggingPaused>Break Breakpoint.cs:16,4-16,40</DebuggingPaused>
<Breakpoint
CheckSum="null"
Column="0"
Enabled="True"
FileName="Breakpoint.cs"
IsSet="True"
Line="18"
OriginalLocation="Breakpoint.cs:18,4-18,49" />
<Breakpoint1>
<Breakpoint
CheckSum="null"
Column="0"
Enabled="True"
FileName="Breakpoint.cs"
IsSet="True"
Line="18"
OriginalLocation="Breakpoint.cs:18,4-18,49" />
</Breakpoint1>
<Breakpoint2>
<Breakpoint
CheckSum="null"
Column="0"
Enabled="True"
FileName="Breakpoint.cs"
IsSet="True"
Line="19"
OriginalLocation="Breakpoint.cs:20,4-20,49" />
</Breakpoint2>
<ModuleLoaded>System.Configuration.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>System.Xml.dll (No symbols)</ModuleLoaded>
<LogMessage>Main 1\r\n</LogMessage>
<DebuggingPaused>Breakpoint Breakpoint.cs:18,4-18,49</DebuggingPaused>
<LogMessage>Main 2\r\n</LogMessage>
<DebuggingPaused>Break Breakpoint.cs:19,4-19,40</DebuggingPaused>
<DebuggingPaused>Breakpoint Breakpoint.cs:20,4-20,49</DebuggingPaused>
<LogMessage>Main 3\r\n</LogMessage>
<DebuggingPaused>Break Breakpoint.cs:21,4-21,40</DebuggingPaused>
<ProcessExited />
<Breakpoint
CheckSum="null"
Column="0"
Enabled="True"
FileName="Breakpoint.cs"
IsSet="False"
Line="18"
OriginalLocation="Breakpoint.cs:18,4-18,49" />
<Breakpoint1>
<Breakpoint
CheckSum="null"
Column="0"
Enabled="True"
FileName="Breakpoint.cs"
IsSet="False"
Line="18"
OriginalLocation="Breakpoint.cs:18,4-18,49" />
</Breakpoint1>
<Breakpoint2>
<Breakpoint
CheckSum="null"
Column="0"
Enabled="True"
FileName="Breakpoint.cs"
IsSet="False"
Line="19"
OriginalLocation="Breakpoint.cs:20,4-20,49" />
</Breakpoint2>
</Test>
</DebuggerTests>
#endif // EXPECTED_OUTPUT

Loading…
Cancel
Save