Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] displaying instructions and instructions histories in Eclipse: support needed in handling UI events and issue a gdb command

thanks Tobjorn and Jonah,
I have not updated my Git for a few months. I will update it and check if this fixes the problem.
Kind Regards
Zied Guermazi
Am 2022-06-08 16:21, schrieb Torbjorn SVENSSON:
Hello,

Was just about to reply to the other mail :)

The issue sounds very familiar to this changeset
https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/190172, but from
what I can tell, the changeset should also fix it for this use-case…


I have a vague memory that if you enable 2 plugins in the CDT runtime,
one of them will override the other one, but the one that was
overridden is applicable for managed projects. I noticed this back in
March when I was playing with the above mentioned gerrit, but I've
lost my notes regarding the fix. If my memory serves me correctly, it
had something to do with 2 plugins extending one extension point and
having the same id, but with 2 different implementations.

If you can't figure out what's going on by the end of the week, I'll
try to play around a bit again and see if I can refresh my memory.

Kind regards,

Torbjörn

ST Restricted

From: Jonah Graham <jonah@xxxxxxxxxxxxxxxx>
Sent: den 8 juni 2022 16:02
To: Zied Guermazi <zied.guermazi@xxxxxxxxx>; Torbjorn SVENSSON
<torbjorn.svensson@xxxxxx>
Cc: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] displaying instructions and instructions
histories in Eclipse: support needed in handling UI events and issue a
gdb command

Torbjörn,

The issue that Zied mentions below sounds very familiar - do you
recall if this is the same issue that we were hitting when we added
this refresh code?

Thanks

Jonah

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com [1]

On Wed, 8 Jun 2022 at 08:36, Zied Guermazi <zied.guermazi@xxxxxxxxx>
wrote:

hi,
thanks Jonah for your support, now I can run the command and trigger
refreshing views using flushAllCachesAndRefresh.
the stack frame view is refreshing properly and the stack frame
corresponding to the selected record is displayed properly, but the
source code view is not following: the source code is not
highlighting the line that matches the selected record (see the
following picture).

Is there any special action needed for refreshing the source code
view in debug perspective?
Kind Regards
Zied Guermazi

Am 2022-05-24 19:48, schrieb Jonah Graham:

@cdt-devers if anyone else has some ideas in this area please share
them here. Zied's been doing lots of work on GDB in areas that are
probably of lots of value to many CDT adopters so let's see if we
can
support them in getting these improvements integrated into CDT!

Hi Zied,

Please find some answers inline below.

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com [1] [1 [1]]

On Tue, 17 May 2022 at 19:22, Zied Guermazi
<zied.guermazi@xxxxxxxxx>
wrote:

Hi,

currently I am extending the cdt-dsf to implement the gdb commands
for handling instructions and functions call histories, and parsing
and getting their outputs.

I added two buttons and two basic views (see orange indications in
following picture). and I can successfully display the instructions
and functions calls histories when the user clicks on the buttons in
the menu bar.

now I would like to add actions so that when the user clicks on a
line in the function call history list,  a command is issued to gdb,
get executed, and then the editor goes to the related line in the
source code (similar to what happens when the user selects a stack
frame in the debug view, or when the program halts in a breakpoint)

I added a class: public class FunctionsCallHistoryView extends
AbstractDebugView implements IViewerUpdateListener,
IDebugContextListener, IModelChangedListener

and registered a DoubleClickListener, public void
doubleClick(DoubleClickEvent event) where I am identifying the
clicked line extracting the record number and calling

_// execute record goto record command_
_ GdbGoToRecordCommand cmd = new
GdbGoToRecordCommand(fFunctionsCallHistoryModel.getSession());_

_cmd.setRecordNumber(__recordNumber);_

_cmd.execute(null);  //how to prepare a IDebugCommandRequest request
?_

I have two issues with this implementation:

- how to prepare a IDebugCommandRequest request object?

I don't think you want to use IDebugCommandRequest - one of the
tricky
parts of DSF is that it is very different than Eclipse standard
debug
model. The DSF Tutorial [2] tries to introduce the concepts here
(there is a warning "Flexible Hierarchy is still a provisional API
in
Eclipse Platform 3.4." technically still true but the API hasn't
changed in years). I also did a tutorial session [3 [2]] many years
ago
that may be useful for background.

- Ideally this shall be executed asynchronously to the UI, is there
a mean to achieve it?

All of DSF is very asynchronous by design and all operations run in
non-UI thread. As long as you don't wait for results in the UI
thread
on non-UI thread you get such async behaviour.

A good model for your work may be TraceControlView. Specifically you
can look at command with ID
org.eclipse.cdt.dsf.gdb.ui.command.selectNextTraceRecord and how it
is
called from TraceControlView (see

org.eclipse.cdt.dsf.gdb.internal.ui.tracepoints.TraceControlView.createFrameLine(...).new
SelectionAdapter() {...}.widgetSelected(SelectionEvent)) - the same
command is also contributed to the toolbar of the view, search for
toolbar:org.eclipse.cdt.dsf.gdb.ui.tracecontrol.view?after=additions
in org.eclipse.cdt.dsf.gdb.ui/plugin.xml

On success, I would like a also to fire an event about the change
done in the program counter so that the debug view and the source
code refresh themself with the proper new PC, line of code and stack
frame. is there any guidance/examples for achieving it?

can you please support me here?

You can force a full refresh of all views with
ICommandControlService.flushAllCachesAndRefresh(RequestMonitor) - or
you can issue more narrow refreshes if you know which services have
data changes.

I hope that is a good start for you

Jonah

Kind Regards
Zied Guermazi

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

Links:
------
[1] http://www.kichwacoders.com
[2]

https://help.eclipse.org/latest/topic/org.eclipse.cdt.doc.isv/guide/dsf/intro/dsf_programming_intro.html?cp=13_0_6
[3] https://github.com/jonahgraham/cdt-examples
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

--

Zied Guermazi
founder

Trande GmbH
Leuschnerstraße 2
69469 Weinheim/Germany

Mobile: +491722645127
mailto:zied.guermazi@xxxxxxxxx

Trande GmbH
Leuschnerstraße 2, D-69469 Weinheim; Telefon: +491722645127
Sitz der Gesellschaft: Weinheim- Registergericht: AG Mannheim HRB
736209 - Geschäftsführung: Zied Guermazi

Confidentiality Note
This message is intended only for the use of the named recipient(s)
and may contain confidential and/or privileged information. If you are
not the intended recipient, please contact the sender and delete the
message. Any unauthorized use of the information contained in this
message is prohibited.

Links:
------
[1] http://www.kichwacoders.com
[2] https://github.com/jonahgraham/cdt-examples

--
Zied Guermazi
 founder

 Trande GmbH
 Leuschnerstraße 2
 69469 Weinheim/Germany

 Mobile: +491722645127
 mailto:zied.guermazi@xxxxxxxxx

Trande GmbH
 Leuschnerstraße 2, D-69469 Weinheim; Telefon: +491722645127
Sitz der Gesellschaft: Weinheim- Registergericht: AG Mannheim HRB 736209 -
Geschäftsführung: Zied Guermazi

Confidentiality Note
 This message is intended only for the use of the named recipient(s) and
may contain confidential and/or privileged information. If you are not the intended recipient, please contact the sender and delete the message. Any
unauthorized use of the information contained in this message is
prohibited.


Back to the top