1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff --git a/kernel/common/thread.rb b/kernel/common/thread.rb
index 39e52fa..25a73dc 100644
--- a/kernel/common/thread.rb
+++ b/kernel/common/thread.rb
@@ -263,11 +263,13 @@ class Thread
     attr_reader :ip
     attr_reader :method
     attr_reader :variables
+    attr_reader :frames
 
-    def initialize(ip, method, variables)
+    def initialize(ip, method, variables, frames)
       @ip = ip
       @method = method
       @variables = variables
+      @frames = frames
     end
 
     def file
diff --git a/lib/debugger/standard_commands.rb b/lib/debugger/standard_commands.rb
index 7a11c36..07bc83a 100644
--- a/lib/debugger/standard_commands.rb
+++ b/lib/debugger/standard_commands.rb
@@ -478,13 +478,15 @@ class Debugger
       :description => "Show execution backtrace."
     
     def execute(dbg, interface, inp)
-      bt = Backtrace.backtrace(interface.debug_context)
+      bt = Backtrace.backtrace(interface.debug_context.frames)
       eval_ctxt = interface.eval_context
       output = Output.info("Backtrace:")
       output.set_columns(['%*s', '%|s', '%-*s'])
-      bt.frames.each_with_index do |frame,i|
-        output.set_line_marker if frame == eval_ctxt
-        recv, loc = frame.describe, frame.location
+      bt.each_with_index do |location,i|
+        # FIXME
+        #output.set_line_marker if frame == eval_ctxt
+
+        recv, loc = location.describe, location.position
         if i == 0
           output.set_color :green
         elsif loc =~ /kernel/
diff --git a/vm/builtin/thread.cpp b/vm/builtin/thread.cpp
index 85f6bb4..aa4d2c9 100644
--- a/vm/builtin/thread.cpp
+++ b/vm/builtin/thread.cpp
@@ -6,6 +6,9 @@
 #include "builtin/symbol.hpp"
 #include "builtin/float.hpp"
 #include "builtin/channel.hpp"
+#include "builtin/staticscope.hpp"
+#include "builtin/compiledmethod.hpp"
+#include "builtin/system.hpp"
 
 #include "objectmemory.hpp"
 #include "arguments.hpp"
@@ -112,7 +115,9 @@ namespace rubinius {
 
     cf->promote_scope(state);
 
-    return Tuple::from(state, 3, Fixnum::from(cf->ip), cf->cm, cf->scope);
+    Array* frames = System::vm_backtrace(state, Fixnum::from(0), cf);
+
+    return Tuple::from(state, 4, Fixnum::from(cf->ip), cf->cm, cf->scope, frames);
   }
 
 }