[Gambas-devel] enhancing the debugger

Benoit Minisini gambas at ...1...
Mon Sep 18 19:09:51 CEST 2006


On Sunday 17 September 2006 22:54, Charlie Reinl wrote:
> Salut Benoît,
>
> my idea is to show, after a DBclick on an Array in Debug.Local all
> elements of this Array in a TabelView or so, like you said.
>
> After searching/debugging since 2 days, how can I get out informations
> from the debugger about Objects, without string-analysing the code-file,
> I need some hints from you.
> I'v debugged 'Design' , but all what i'm able actually is using the '?'
> to load them into the watch-window, my new added 's' to Command, ditn't
> raise the Debug_read.
>
> What I need, are these 'special debugger commands' who prints all field
> names of an object, etc.
>
> And how can I indentify an object (without string analysing).
>
> Amicalment
> Charlie
>
>

Let's make a point on the debugger:

* You can test it by running 'gbx' with the '-g' option in a terminal.

* The commands are listed in an array at line 684 in the debug.c source file 
of the gb.debug component.

* There is a command named 'o' that displays the list of all symbols of the 
current object, static, non-static, public and privates.

* There is the need of a command that would do the same thing, but for any 
object.

* You could display array contents just by playing with the '?' debugger 
command, by sending "?MyArray.Count" to get the length of the array, and by 
sending '?MyArray[xxx]' to get the value of the element #xxx.

* But you couldn't do the same thing for collections. As there is only two 
data structures in Gambas, I could make a special command for getting the 
contents of array and collections by index, so that you can fill a TableView 
without having to get the entire array contents from the debugger.

Do you think that with the following new commands:
- Getting the name of the symbols of any object.
- Getting the number of elements of an object (if it is an array or a 
collection)
- Getting the n-th element of an object.
- Getting the n-th key of a collection.

...you can do what you want?

What would be cool is that selecting an expression displays a little window 
with the value of the expression, and if this expression is an object, an 
array or a collection, you can see the contents and double-click on it to get 
the value of an element, and so on recursively...

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list