Extending the debugger inspector with a new presentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Extending the debugger inspector with a new presentation

Thomas Dupriez-2
Hello,

I would like to extend the debugger with some context-dependent information.
I am playing with metalinks and I would like to show, in the debugger,  
some information if my metalinks are in the selected method.
This means that:
- I need to add a new presentation in the debugger next to the  
"variable" and "evaluator" ones.
- I need to filter that presentation to show it depending on which  
method is selected.

I tried to extend ProtoObject with a method like:

gtDebuggerExpressionMachinViewIn: composite
         <gtDebuggerPresentationOrder: 21>

         composite text
                 title: 'My machin';
                 display: [ :browser :debugger | debugger asString]

However, this did not add a presentation in the debugger. It only show  
up when selecting an object in the debugger inspector (see screenshot).

How can I extend the debugger as I want?

Thanks
Thomas and Guille

PharoScreenshot.1.png (62K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Extending the debugger inspector with a new presentation

Denis Kudriashov
Hi.

One possibility is to follow BytecodeDebugger approach. Try to look how it is implemented

2017-05-12 9:53 GMT+02:00 <[hidden email]>:
Hello,

I would like to extend the debugger with some context-dependent information.
I am playing with metalinks and I would like to show, in the debugger, some information if my metalinks are in the selected method.
This means that:
- I need to add a new presentation in the debugger next to the "variable" and "evaluator" ones.
- I need to filter that presentation to show it depending on which method is selected.

I tried to extend ProtoObject with a method like:

gtDebuggerExpressionMachinViewIn: composite
        <gtDebuggerPresentationOrder: 21>

        composite text
                title: 'My machin';
                display: [ :browser :debugger | debugger asString]

However, this did not add a presentation in the debugger. It only show up when selecting an object in the debugger inspector (see screenshot).

How can I extend the debugger as I want?

Thanks
Thomas and Guille

Reply | Threaded
Open this post in threaded view
|

Re: Extending the debugger inspector with a new presentation

Thomas Dupriez-2
I've looked at it, but I can't get to reproduce it. I have trouble  
finding an entry point to start understanding.

Quoting Denis Kudriashov <[hidden email]>:

> Hi.
>
> One possibility is to follow BytecodeDebugger approach. Try to look how it
> is implemented
>
> 2017-05-12 9:53 GMT+02:00 <[hidden email]>:
>
>> Hello,
>>
>> I would like to extend the debugger with some context-dependent
>> information.
>> I am playing with metalinks and I would like to show, in the debugger,
>> some information if my metalinks are in the selected method.
>> This means that:
>> - I need to add a new presentation in the debugger next to the "variable"
>> and "evaluator" ones.
>> - I need to filter that presentation to show it depending on which method
>> is selected.
>>
>> I tried to extend ProtoObject with a method like:
>>
>> gtDebuggerExpressionMachinViewIn: composite
>>         <gtDebuggerPresentationOrder: 21>
>>
>>         composite text
>>                 title: 'My machin';
>>                 display: [ :browser :debugger | debugger asString]
>>
>> However, this did not add a presentation in the debugger. It only show up
>> when selecting an object in the debugger inspector (see screenshot).
>>
>> How can I extend the debugger as I want?
>>
>> Thanks
>> Thomas and Guille
>>
>




Reply | Threaded
Open this post in threaded view
|

Re: Extending the debugger inspector with a new presentation

Guillermo Polito
Yeah, in any case, it is not clear what we should do:

 - can't we extend the default debugger presentation?
 - or should we create a new presentation?
 - maybe we can do both, but then we have the question: is there a criteria to say "if X, extend the default presentation, if Y, create a new one"?
 - How to do it? We can just copy paste an existing class... but...
 - Also, what happens if we want to add a tab to **EVERY** debugger presentation next to the evaluate?

On Mon, May 15, 2017 at 8:22 AM, <[hidden email]> wrote:
I've looked at it, but I can't get to reproduce it. I have trouble finding an entry point to start understanding.

Quoting Denis Kudriashov <[hidden email]>:

Hi.

One possibility is to follow BytecodeDebugger approach. Try to look how it
is implemented

2017-05-12 9:53 GMT+02:00 <[hidden email]>:

Hello,

I would like to extend the debugger with some context-dependent
information.
I am playing with metalinks and I would like to show, in the debugger,
some information if my metalinks are in the selected method.
This means that:
- I need to add a new presentation in the debugger next to the "variable"
and "evaluator" ones.
- I need to filter that presentation to show it depending on which method
is selected.

I tried to extend ProtoObject with a method like:

gtDebuggerExpressionMachinViewIn: composite
        <gtDebuggerPresentationOrder: 21>

        composite text
                title: 'My machin';
                display: [ :browser :debugger | debugger asString]

However, this did not add a presentation in the debugger. It only show up
when selecting an object in the debugger inspector (see screenshot).

How can I extend the debugger as I want?

Thanks
Thomas and Guille









--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: Extending the debugger inspector with a new presentation

Denis Kudriashov
In reply to this post by Thomas Dupriez-2
Hi

2017-05-15 8:22 GMT+02:00 <[hidden email]>:
I've looked at it, but I can't get to reproduce it. I have trouble finding an entry point to start understanding.

Starting point is method GTMoldableDebugger>>compose with code:

...
self tabulator with: [:browser | 
self debuggerStructureIn: browser.
self debuggerTransmissionsIn: browser ]. 
...
Then look what methods are overridden in BytecodeDebugger.

Reply | Threaded
Open this post in threaded view
|

Re: Extending the debugger inspector with a new presentation

Andrei Chis
In reply to this post by Guillermo Polito
Hi,

Currently extending the UI of the debugger is not as easy as extending the inspector. (It cannot just be done using annotations)
We should work on improving this for Pharo 7.
The actual presentations at the bottom are created in GTDebuggerVariablesBrowser>>#compose.
To change it in a debugger you need to create a subclass of both GTGenericStackDebugger and GTDebuggerVariablesBrowser and then override the class side method #variablesBrowserClass in the debugger.

I see now that GTDebuggerVariablesBrowser >>#compose doesn't really have a hook for adding new tabs so you'll need to completely override it. We should add one.

The pragma <gtDebuggerPresentationOrder:> is used for presentations that should only be displayed when inspecting objects in the debugger.

Cheers,
Andrei



On Mon, May 15, 2017 at 9:51 AM, Guillermo Polito <[hidden email]> wrote:
Yeah, in any case, it is not clear what we should do:

 - can't we extend the default debugger presentation?
 - or should we create a new presentation?
 - maybe we can do both, but then we have the question: is there a criteria to say "if X, extend the default presentation, if Y, create a new one"?
 - How to do it? We can just copy paste an existing class... but...
 - Also, what happens if we want to add a tab to **EVERY** debugger presentation next to the evaluate?

On Mon, May 15, 2017 at 8:22 AM, <[hidden email]> wrote:
I've looked at it, but I can't get to reproduce it. I have trouble finding an entry point to start understanding.

Quoting Denis Kudriashov <[hidden email]>:

Hi.

One possibility is to follow BytecodeDebugger approach. Try to look how it
is implemented

2017-05-12 9:53 GMT+02:00 <[hidden email]>:

Hello,

I would like to extend the debugger with some context-dependent
information.
I am playing with metalinks and I would like to show, in the debugger,
some information if my metalinks are in the selected method.
This means that:
- I need to add a new presentation in the debugger next to the "variable"
and "evaluator" ones.
- I need to filter that presentation to show it depending on which method
is selected.

I tried to extend ProtoObject with a method like:

gtDebuggerExpressionMachinViewIn: composite
        <gtDebuggerPresentationOrder: 21>

        composite text
                title: 'My machin';
                display: [ :browser :debugger | debugger asString]

However, this did not add a presentation in the debugger. It only show up
when selecting an object in the debugger inspector (see screenshot).

How can I extend the debugger as I want?

Thanks
Thomas and Guille









--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13