On Thu, 17 Apr 2008, Przemyslaw Czerpak wrote:

Hi Phil,

> The debugger is executing .prg functions which change execution context
> and classes code forbids to access hidden and protected messages.
> To really resolve the problem (without disabling scoping) we will need
> some mechanism to change current execution context to the code actually
> debugged before sending messages. I can write function which will do that
> but I need to know which functionality you need. It will be also usable
> in any OOP debugging because scopes will still work just like in normal
> code.

As I can see debugger code uses __objGetValueList() and __objGetMethodList()
to extract information about object and then __objSendMsg() to get/set
information about object variables. I can create functions which such
functionality but to show real values of instance data in current execution
context then I will need stack offset to function symbol of currently
debugged code so I can dynamically calculate the real scope. Can you
easy access such information?
If yes then I can create functions like:
   __dbgObjValueList( <obj>, <nStackOffset> [, <lRealVars>] ) -> <aVars>
   __dbgObjMethodList( <obj>, <nStackOffset> [, <lRealMethod>] ) -> <aMethods>
   __dbgObjValue( <obj>, <nStackOffset> [, <xNewValue>] ) -> <xValue>

<lRealVars> can be used optionally to extract only real variables
without methods which can work like variables.
<lRealMethod> can be used optionally to extract real methods even
if they work like variables.
If you think that they are not necessary then we can drop these parameters.
__dbgObjValue() can be used to get or set value. It will work for real
variables but also for methods which can work like variables.
All these functions will work with the privileges like for the
code which is executed by HVM with function symbol at <nStackOffset>.
If some data cannot be accessed due to scope violation then I can ignore
it or I can return RTE string instead of generating RTE depending on
your preferences. I can even add functions like:
   __dbgObjTestAccess( <obj>, <nStackOffset> ) -> xResult
   __dbgObjTestAssign( <obj>, <nStackOffset> ) -> xResult
where xResult will be .T. or error object.
It will be very simple to create such functions also for xHarbour
as simple wrappers to current __obj*() functions ignoring additional
functionality to keep the same debugger code. Maybe in the future
someone will update xHarbour classy code adding missing functionality
and in such case he will have ready to use interface.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to