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

Bug 328191

Summary: edc - "Max Length…" context menu item does not appear once EDC is started
Product: [Tools] CDT Reporter: Kirk Beitz <kirk.beitz>
Component: cdt-debug-edcAssignee: Ken Ryall <ken.ryall>
Status: RESOLVED WONTFIX QA Contact: Ken Ryall <ken.ryall>
Severity: major    
Priority: P3 CC: cdtdoug
Version: 7.0.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch for edc details pane to always show the "Max Value…" context menu item none

Description Kirk Beitz CLA 2010-10-19 20:16:14 EDT
Created attachment 181239 [details]
patch for edc details pane to always show the "Max Value…" context menu item

discovered while attempting to fix the "customer reported" Bug 328190

the "Max Length…" context menu item disappears from the details pane context menu once the user starts an edc debug session, and the menu does not re-appear until the user shuts down the edc session, then closes and re-opens the details pane.

the attached patch solves the problem in AbstractEDCDetailPane#fillContextMenu() by having it also add the action for the "Max Length..." dialog invocation.

the patch also reduces redundancy by in AbstractEDCDetailPane#createControls() by having it re-use the same actions declared in DefaultDetailPane .  (and thus also eliminating the need for the nested word-wrap action.)
Comment 1 Kirk Beitz CLA 2010-10-19 20:24:11 EDT
a couple of comments on the fix:

    return DebugUIPlugin.getDefault().getPreferenceStore()
           .getInt(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH);

the solution above (part of the patch) causes access restriction due to org.eclipse.debug.internal.ui.DebugUIPlugin being .internal. … a problem obviously solved in the patch with the @SuppressWarnings("restriction") .

i tried to avoid the access restriction with the following two alternate solutions:

[a] return EDCDebugUI.getDefault().getPreferenceStore()
           .getInt(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH);

[b] IPreferencesService prefs = Platform.getPreferencesService(); 
    return prefs.getInt(EDCDebugger.PLUGIN_ID,
                        IDebugUIConstants.PREF_MAX_DETAIL_LENGTH,
                        256, null);

but the first causes a circular dependency, as it causes .edc to depend upon .edc.ui, which already has a dependency in the other direction.

and the second simply doesn't work, presumably due to the plugin-id not being identical.

also, this patch is merely "good enough" in that it provides the user an imperfect mechanism to solve this problem.  the flaws now exposed:
- the dialog states it will treat 0 as "unbounded", but AbstractStringFormatter
  does not interpret 0 in this way.  it basically just skips the read.
  implementing it as a completely unbounded read would certainly be easy enough.
  i'm just not certain that i agree that the unbounded option is a good idea.
- the max value ends up getting used for smart-formatted strings for edc string
  variables … but if the user changes the value, it does not take hold until
  the next time the variable view is opened by edc for use.
- the max value doesn't immediately cause the details pane to be changed;
  the user has to click away and come back for it to be used.

to move on to other more important matters, i'm inclined to commit this patch as is and deal with the other three issues as lower-priority/lower-severity issues at a later date.

feedback welcome.
Comment 2 Kirk Beitz CLA 2010-10-20 01:34:31 EDT
comment #1 really applies more specifically to Bug 328190
Comment 3 Kirk Beitz CLA 2010-10-25 16:35:17 EDT
david dubrow had some comments on this patch, and i am trying to re-work it a bit.

i think i've also discovered a fix for the following two problems:
- the max value ends up getting used for smart-formatted strings for edc string
  variables … but if the user changes the value, it does not take hold until
  the next time the variable view is opened by edc for use.
- the max value doesn't immediately cause the details pane to be changed;
  the user has to click away and come back for it to be used.

hope to have an updated patch anon.
Comment 4 Jonah Graham CLA 2019-12-30 18:39:38 EST
(this is part of a batch change)

The Eclipse CDT EDC (https://wiki.eclipse.org/CDT/cdt-debug-edc) is now obsolete and has not had any active development since 2011. Therefore the still open bugs are being marked as wontfix.

The git repo for the project still exists for posterity at https://git.eclipse.org/c/cdt/org.eclipse.cdt.edc.git/