<p>Could anyone show me a sample about how to use these two commands in Windbg please? I read the document in debugger.chm, but confused. I did search in Google and MSDN, but not find an easy to learn sample.</p>

Think in terms of function levels as per the following pseudo-code:
```
```
1  x = 0
 2  y = 0
 3  call 8
 4  x = 5
 5  y = 7
 6  call 8
 7  halt

 8  print x
 9  print y
10  call 12
11  return

12  print x + y
13  print x * y
14  return
```
```
The commands are basically "run until an event occurs".  The event causes the debugger to break (stop execution and await your command).
The "
```
gu
```
" command runs until it goes up to the next highest stack level.  If you're on lines 8, 9, 10 or 11, you'll end up at 4 or 7 depending on which "
```
call 8
```
" has called that code.  If you're on lines 12, 13 or 14, you'll break at 11.
Think of this as running until you've moved up the stack.  Note that if you first go down, you'll have to come up twice.
The "
```
pc
```
" command runs until the next call so, if you're on line 1, it will break at line 3.  This is sort of opposite to "
```
gu
```
" since it halts when you're trying to go
down
a stack level.