Question: Why calling object method in debugger fail?

Is there a workaround to being able to call object method inside the debugger? I use Objects everywhere and hard to debug things when not able to try calls inside the debugger.

Here is an example.

This worksheet below has the code to reproduce this. Ofcourse the code works when I run it in the debugger using "continue" button, or using the "next" or "step". But I need sometimes to check something before doing this.

interface(version);

`Standard Worksheet Interface, Maple 2026.1, Windows 10, April 28 2026 Build ID 2011354`

restart;

kernelopts('assertlevel'=2):

module person_type()
    option object;
    local _name::string:="";    
    export ModuleCopy::static := proc( _self::person_type, proto::person_type, name::string)
      _name:=name;
      NULL;
    end proc;

    export get_name::static:=proc(_self)
       _self:-_name;
    end proc;
end module;

module person_type () local _name::string; option object; end module

foo:=proc(o::person_type)::string;
  local name;
  DEBUG();
  name:=o:-get_name();
  name;
end proc;

proc (o::person_type)::string; local name; DEBUG(); name := o:-get_name(); name end proc

o:=Object(person_type,"me");

module person_type () local _name::string; option object; end module

o:-get_name();

"me"

#run this. Debugger will now open
foo(o);

 

 

Download why_calling_object_fail_in_debugger.mw

Please Wait...