Matthias Berndt wrote:

On Sat, Dec 31, 2005 at 04:03:54PM +0100, Mario Scalas wrote:
What happens:
1) I put a breakpoint after I create an object of some class
2) In the debugger "variables" view I can see the variable with the '+' (well, an arrow under GTK, meaning I can expand it) 3) I click upon the '+' but nothing happens: object's fields do not appear and the '+' is gone :|

I know the problem and after digging the source the attached little
patch does the trick for me.

I can't test it on windows, but it also should work.
Hi Matthias,
thanks for your patch. I've applied it and found that it broke quite a few test cases. Mario's suggestion to use hex values seems to be easier to implement. Please verify the patch below. If it works for you, too, I'd like to release it with 0.7.0.
Does the segfault appear in your environment (ruby 1.8.4?), too?

thanks
Markus

Index: eclipseDebug.rb
===================================================================
RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb,v
retrieving revision 1.17
diff -u -r1.17 eclipseDebug.rb
--- eclipseDebug.rb    13 Oct 2005 19:43:30 -0000    1.17
+++ eclipseDebug.rb    3 Jan 2006 21:54:28 -0000
@@ -72,7 +72,7 @@
        valueString.slice!(1..(valueString.length)-2)
end end - out("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%s\"/>", CGI.escapeHTML(name), kind, CGI.escapeHTML(valueString), value.class(), hasChildren, value.respond_to?(:object_id) ? value.object_id : value.id) + out("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"0x%x\"/>", CGI.escapeHTML(name), kind, CGI.escapeHTML(valueString), value.class(), hasChildren, value.respond_to?(:object_id) ? value.object_id : value.id)
  end

  def printBreakpoint(n, debugFuncName, file, pos)
@@ -395,7 +395,7 @@
          var_list([], binding, 'local')
end - when /^\s*i(?:nstance)?\s*(\d+)?\s+(\d+)?/ + when /^\s*i(?:nstance)?\s*(\d+)?\s+(?:0x([\dabcdef]+))?/ new_binding = getBinding($1)
        if new_binding then
          binding = new_binding
@@ -403,7 +403,7 @@
        begin
          @printer.printXml("<variables>")
          if $2 then
-            obj = ObjectSpace._id2ref($2.to_i)
+            obj = ObjectSpace._id2ref($2.hex)
            if (!obj) then
              @printer.debug("unknown object id : %s", $2)
            end



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Rubyeclipse-development mailing list
Rubyeclipse-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rubyeclipse-development

Reply via email to