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
  • From: Torbjorn SVENSSON <torbjorn.svensson@xxxxxx>
  • Date: Wed, 8 Jun 2022 16:12:37 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=st.com; dmarc=pass action=none header.from=st.com; dkim=pass header.d=st.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7VH3quZzLBjdVct6jrT1ruxsGRBQCFPYP6frD4moNew=; b=Ujv+W8uiHUpBqTSvbNOJZpNZg+AJBYazkNGVXKDTkIisDATl8OXwwYnegV/0yoAVD6q9+rfUQMND72vEWk15eCgjD/xNHEs8GMWZ8n5t66nz/kZYtqV2UNlLaM5wp0e+9Dua6Jn/wVl1masFWIM/3QsG9BewfSxDtBiex5n+ud4SRJQbhCHJYP6fhALlPFcV8xux6pOAohmDuSNmCdbjhKUz0ATa7/ABzfpzfgrfnuinRMYAsuZMLuiKD2/y4Z9PtEtIves28ZjtzNabm1zcFgO/WvTVH6KXSg/kIltV793/bIObIV9TgX1kVbIXVEFSu+v6UwCsfD3EBju+djfOFw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dmrmgXyDyiUALqXH7Bdu3LpqDJlHqrb+X1DOmK2xyKKW5TH59GrkNffg+MLfkq2Pst5LhcouanlBtFzzqTJtjEndoHpZaGUYkKaaKbLLJ5lP6aZzQMPLRYR6jzrSJc/vRg3eIAW99DG7MWdnd+LSMea2pAaN7nCDls1E3NkZ3hkyCRgr4OTlthYKdPBZd0t0C6CoAAdbBrUWxogc56cPEIDXU925gHA8TRDLL5cZ2yF8RkuJPMCNqleGJU5bdqX3dPSqxwRnw9A1mnBwcLMIFoaHvWhnUEWAeC/qKbzzJxBkOE155famY8DjPYnZPKy8P2yTmlNk1niqN+Oznc44sw==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cdt-dev/>
  • List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_actionid: 6071a329-e1e8-458b-b1ab-337861b3913f
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_contentbits: 0
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_enabled: true
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_method: Standard
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_name: 23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_setdate: 2022-06-08T16:12:34Z
  • Msip_label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_siteid: 75e027c9-20d5-47d5-b82f-77d7cd041e8f
  • Msip_labels: MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Enabled=true; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_SetDate=2022-06-08T16:12:34Z; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Method=Standard; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Name=23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_SiteId=75e027c9-20d5-47d5-b82f-77d7cd041e8f; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ActionId=a05b7c57-c7e8-4eb6-a157-9b1de8358499; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ContentBits=2
  • Thread-index: AQHYakUAPWnweAdSjkyCCmKlLN2fga0uWI2AgBc7tgCAABfjAIAAANhggAAMRQCAABcoYA==
  • Thread-topic: [cdt-dev] displaying instructions and instructions histories in Eclipse: support needed in handling UI events and issue a gdb command

Hello again,

Let me know if you need me to dive into this when I find a slot.

Kind regards,
Torbjörn


ST Restricted

> -----Original Message-----
> From: Zied Guermazi <zied.guermazi@xxxxxxxxx>
> Sent: den 8 juni 2022 16:49
> To: Torbjorn SVENSSON <torbjorn.svensson@xxxxxx>
> Cc: Jonah Graham <jonah@xxxxxxxxxxxxxxxx>; 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
> 
> 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.createFrame
> Line(...).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