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 14:21:15 +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=0nc14YDVQHjpzETQ7bQnmkCqR9yl3qBKqCLuOxkNnEs=; b=WH0m0Ifj0G7GqpAG6ky7WGWfZ370ycD+i7IrjTNpKlfbVBjJNhYaE/HXgA/p9OtUkHF9+yjkLcY1exgOffQApbR0fPL2ijI8Atl+F5xT824z7vH3sk0t+Y5Gf9N/QbTSRiz7kBHvB48cq65T2JTH4E4pi5tpyg0rL1qfNOpQZ0sKffgvtJ+RaupeKmR7eWqlk2AL5ZdC+qVZBUTupMHn8h4b5GUz32/UxdPVUi4UPvUW+u2GmbZ4LRSik7a4FplQjLWDUQ3LwcD0y1zm0sWT9dUhSTSzgBloqREd/T2cnn5bxsXn1hMTg9B1F2Zzqis+g03afJT1nY0mOl7cSUU8yA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hbc+YwNNDbz74JL0XCDUGKpt53si6wV1yXt26QaP6PTPNqefBWSftZnmL+EhWtjSnxN0hS9lB5K1AAJij8HLhTsnsNh0wfhQtaXS9uz+yetGPPL1jZOwv2Xz14cK+18/WpH5t6sVVGY5SptrzHIrU8QGMSOlyp5LU60/zrz0liZ5YvcqVmqseqZqkXYNkHY1jQAIfQAOvfHjOKHranguXz+REa+e0WoxHlagZ9JYRK9c/7i/luZKxTf+yAukWgSe2aV+zY9iH2A8cN5TEVle2uED2p/kH2B746KVxwHw186bef/BHWoiygXx9phxXA/AP4AG2POV3XqTrN/5deVBsQ==
  • 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: 13e7b561-91c6-4596-8bdf-9fae382ff86b
  • 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-08T14:21:12Z
  • 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-08T14:05:33Z; 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=6cdb9eb7-9d42-4248-bd5c-aa966df693e0; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ContentBits=2
  • Thread-index: AQHYakUAPWnweAdSjkyCCmKlLN2fga0uWI2AgBc7tgCAABfjAIAAANhg
  • Thread-topic: [cdt-dev] displaying instructions and instructions histories in Eclipse: support needed in handling UI events and issue a gdb command

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

 

 

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]

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] 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.


Back to the top