Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357440

Summary: [disassembly] Add opcode ruler column to the disassembly view
Product: [Tools] CDT Reporter: Scott Tepavich <scott.tepavich>
Component: cdt-debugAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Ken Ryall <ken.ryall>
Severity: enhancement    
Priority: P3 CC: aleherb+eclipse, cdtdoug, jamesblackburn+eclipse, marc.khouzam, pawel.1.piech, pchuong
Version: 8.0   
Target Milestone: 8.1.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 357270    
Attachments:
Description Flags
Small patch to enable opcode ruler display and register tool-tips from backends.
cdtdoug: iplog+
Focused opcode ruler patch cdtdoug: iplog+

Description Scott Tepavich CLA 2011-09-13 00:50:51 EDT
Build Identifier: I20110613-1736

A preference to turn on/off the display of opcode values and the ability to display the value of registers via tool-tips are missing.

Reproducible: Always
Comment 1 Anton Leherbauer CLA 2011-09-13 03:46:03 EDT
> A preference to turn on/off the display of opcode values

By coincidence this has been requested recently in bug 357270.
  
> and the ability to
> display the value of registers via tool-tips are missing.

This should already be possible by implementing IDisassemblyBackend.evaluateExpression(String() such that it can detect whether an expression denotes a register or simply by trying register evaluation as a fallback. 

/**
 * Evaluate an expression for text hover
 * 
 * @param expression
 *            the expression to be evaluated
 * @return the result, or "" if it doesn't resolve, for whatever reason
 */
String evaluateExpression(String expression);
Comment 2 Patrick Chuong CLA 2011-09-13 11:35:12 EDT
(In reply to comment #1)
> This should already be possible by implementing
> IDisassemblyBackend.evaluateExpression(String() such that it can detect whether
> an expression denotes a register or simply by trying register evaluation as a
> fallback. 
> /**
>  * Evaluate an expression for text hover
>  * 
>  * @param expression
>  *            the expression to be evaluated
>  * @return the result, or "" if it doesn't resolve, for whatever reason
>  */
> String evaluateExpression(String expression);

It would be nice if the disassembly view passed the selected text if there is any.

Since this bug is requesting for tooltip support, is it possible to have tooltip support for instruction documentation? Our customers have been requesting to show a short discription when hovering the mouse over the instruction in the disassembly view.
Comment 3 Scott Tepavich CLA 2011-09-13 14:08:05 EDT
Created attachment 203272 [details]
Small patch to enable opcode ruler display and register tool-tips from backends.
Comment 4 Anton Leherbauer CLA 2011-09-14 07:03:51 EDT
I have split this bug into
- the opcode ruler part (this bug) and
- the register tooltip enhancement - bug 357612.
Could you create patches for each feature separately? This should make it
easier to review and discuss. Thanks!
Comment 5 Scott Tepavich CLA 2011-09-15 11:18:56 EDT
Created attachment 203420 [details]
Focused opcode ruler patch
Comment 6 Anton Leherbauer CLA 2011-09-16 06:04:27 EDT
Thanks, it's committed and pushed to master with a few changes:
- fixed an NPE if a backend does not provide opcodes
- moved the preference options for the opcode ruler
- opcodes were not stored for disassembly lines with source info

Currently the radix prefix is always displayed for opcodes.  Maybe it would make sense to connect this to the existing "Force radix prefixes" preference.
Comment 7 CDT Genie CLA 2011-09-16 06:23:02 EDT
*** cdt git genie on behalf of Scott Tepavich ***

    Bug 357440 - [disassembly] Add opcode ruler column to the disassembly view

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=6f21f0999c51ae247aef0f0979c9fd2a522946dc