~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_Callstack.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
 
 
6
namespace Debugger.Tests
 
7
{
 
8
        public class StackFrame_Callstack
 
9
        {
 
10
                public static void Main()
 
11
                {
 
12
                        Sub1();
 
13
                }
 
14
                
 
15
                static void Sub1()
 
16
                {
 
17
                        Sub2();
 
18
                }
 
19
                
 
20
                static void Sub2()
 
21
                {
 
22
                        System.Diagnostics.Debugger.Break();
 
23
                }
 
24
        }
 
25
}
 
26
 
 
27
#if TEST_CODE
 
28
namespace Debugger.Tests {
 
29
        public partial class DebuggerTests
 
30
        {
 
31
                [NUnit.Framework.Test]
 
32
                public void StackFrame_Callstack()
 
33
                {
 
34
                        StartTest();
 
35
                        
 
36
                        ObjectDump("Callstack", process.SelectedThread.GetCallstack());
 
37
                        process.SelectedStackFrame.StepOut();
 
38
                        ObjectDump("Callstack", process.SelectedThread.GetCallstack());
 
39
                        process.SelectedStackFrame.StepOut();
 
40
                        ObjectDump("Callstack", process.SelectedThread.GetCallstack());
 
41
                        
 
42
                        EndTest();
 
43
                }
 
44
        }
 
45
}
 
46
#endif
 
47
 
 
48
#if EXPECTED_OUTPUT
 
49
<?xml version="1.0" encoding="utf-8"?>
 
50
<DebuggerTests>
 
51
  <Test
 
52
    name="StackFrame_Callstack.cs">
 
53
    <ProcessStarted />
 
54
    <ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded>
 
55
    <ModuleLoaded>StackFrame_Callstack.exe (Has symbols)</ModuleLoaded>
 
56
    <DebuggingPaused>Break StackFrame_Callstack.cs:22,4-22,40</DebuggingPaused>
 
57
    <Callstack>
 
58
      <Item>
 
59
        <StackFrame
 
60
          ChainIndex="1"
 
61
          FrameIndex="2"
 
62
          HasSymbols="True"
 
63
          MethodInfo="static void Debugger.Tests.StackFrame_Callstack.Sub2()"
 
64
          NextStatement="StackFrame_Callstack.cs:22,4-22,40"
 
65
          Thread="Thread Name =  Suspended = False" />
 
66
      </Item>
 
67
      <Item>
 
68
        <StackFrame
 
69
          ChainIndex="1"
 
70
          FrameIndex="1"
 
71
          HasSymbols="True"
 
72
          MethodInfo="static void Debugger.Tests.StackFrame_Callstack.Sub1()"
 
73
          NextStatement="StackFrame_Callstack.cs:17,4-17,11"
 
74
          Thread="Thread Name =  Suspended = False" />
 
75
      </Item>
 
76
      <Item>
 
77
        <StackFrame
 
78
          ChainIndex="1"
 
79
          HasSymbols="True"
 
80
          MethodInfo="static void Debugger.Tests.StackFrame_Callstack.Main()"
 
81
          NextStatement="StackFrame_Callstack.cs:12,4-12,11"
 
82
          Thread="Thread Name =  Suspended = False" />
 
83
      </Item>
 
84
    </Callstack>
 
85
    <DebuggingPaused>StepComplete StackFrame_Callstack.cs:17,4-17,11</DebuggingPaused>
 
86
    <Callstack>
 
87
      <Item>
 
88
        <StackFrame
 
89
          ChainIndex="1"
 
90
          FrameIndex="1"
 
91
          HasSymbols="True"
 
92
          MethodInfo="static void Debugger.Tests.StackFrame_Callstack.Sub1()"
 
93
          NextStatement="StackFrame_Callstack.cs:17,4-17,11"
 
94
          Thread="Thread Name =  Suspended = False" />
 
95
      </Item>
 
96
      <Item>
 
97
        <StackFrame
 
98
          ChainIndex="1"
 
99
          HasSymbols="True"
 
100
          MethodInfo="static void Debugger.Tests.StackFrame_Callstack.Main()"
 
101
          NextStatement="StackFrame_Callstack.cs:12,4-12,11"
 
102
          Thread="Thread Name =  Suspended = False" />
 
103
      </Item>
 
104
    </Callstack>
 
105
    <DebuggingPaused>StepComplete StackFrame_Callstack.cs:12,4-12,11</DebuggingPaused>
 
106
    <Callstack>
 
107
      <Item>
 
108
        <StackFrame
 
109
          ChainIndex="1"
 
110
          HasSymbols="True"
 
111
          MethodInfo="static void Debugger.Tests.StackFrame_Callstack.Main()"
 
112
          NextStatement="StackFrame_Callstack.cs:12,4-12,11"
 
113
          Thread="Thread Name =  Suspended = False" />
 
114
      </Item>
 
115
    </Callstack>
 
116
    <ProcessExited />
 
117
  </Test>
 
118
</DebuggerTests>
 
119
#endif // EXPECTED_OUTPUT