Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 251256 Details for
Bug 315920
[stack][expressions] Debugger doesn't handle a stack overflow well
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Always add stack frame limits
Bug315920.patch (text/plain), 5.96 KB, created by
John Moule
on 2015-03-03 10:08:51 EST
(
hide
)
Description:
Always add stack frame limits
Filename:
MIME Type:
Creator:
John Moule
Created:
2015-03-03 10:08:51 EST
Size:
5.96 KB
patch
obsolete
>diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF >index 8a9511e..a7c8dd5 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF >@@ -14,7 +14,10 @@ Require-Bundle: org.eclipse.core.runtime, > org.eclipse.core.variables, > org.eclipse.cdt.launch;bundle-version="6.1.0", > org.eclipse.cdt.gdb;bundle-version="7.0.0", >- org.eclipse.core.resources >+ org.eclipse.core.resources, >+ org.eclipse.cdt.debug.ui, >+ org.eclipse.cdt.dsf.ui, >+ org.eclipse.ui > Bundle-ActivationPolicy: lazy > Bundle-RequiredExecutionEnvironment: JavaSE-1.7 > Export-Package: org.eclipse.cdt.dsf.gdb, >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackInfoDepth.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackInfoDepth.java >index 2286812..6a6f4a7 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackInfoDepth.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackInfoDepth.java >@@ -14,6 +14,11 @@ package org.eclipse.cdt.dsf.mi.service.command.commands; > import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; > import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput; > import org.eclipse.cdt.dsf.mi.service.command.output.MIStackInfoDepthInfo; >+import org.eclipse.core.runtime.preferences.InstanceScope; >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.ui.preferences.ScopedPreferenceStore; >+import org.eclipse.cdt.dsf.debug.ui.IDsfDebugUIConstants; >+import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin; > > /** > * >@@ -21,11 +26,34 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIStackInfoDepthInfo; > * > * > */ >+@SuppressWarnings("restriction") > public class MIStackInfoDepth extends MICommand<MIStackInfoDepthInfo> > { >+ /** >+ * Get the maximum number of stack frames to retrieve from the backend. >+ * @return maximum number of stack frames to retrieve. >+ * Note: this should return the value of org.eclipse.cdt.dsf.debug.ui. >+ * viewmodel.launch.StackFramesVMNode.getStackFrameLimit(IExecutionDMContext) >+ * but it is not obvious how to get that value here at the moment. The value >+ * returned by getStackFrameLimit() is initially PREF_STACK_FRAME_LIMIT (default is 10), >+ * but can increase (temporarily) if the user clicks <...more frames...> >+ * in the Debug view. So that this feature may (partially) work the value >+ * returned by this method is inflated to be the maximum of PREF_STACK_FRAME_LIMIT and 50. >+ */ >+ static String getLimit() { >+ String retVal = Integer.toString(Integer.MAX_VALUE); >+ final IPreferenceStore prefsStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, DsfUIPlugin.PLUGIN_ID); >+ final boolean isFrameLimitEnabled = prefsStore.getBoolean(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT_ENABLE); >+ if (isFrameLimitEnabled) { >+ int prefLimit = prefsStore.getInt(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT); >+ retVal = Integer.toString(Math.max(prefLimit, 50)); >+ } >+ System.out.println(retVal); >+ return retVal; >+ } > > public MIStackInfoDepth(IMIExecutionDMContext ctx) { >- super(ctx, "-stack-info-depth"); //$NON-NLS-1$ >+ super(ctx, "-stack-info-depth", new String[] { getLimit() }); //$NON-NLS-1$ > } > > public MIStackInfoDepth(IMIExecutionDMContext ctx, int maxDepth) { >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListArguments.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListArguments.java >index f3868f6..19d8af2 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListArguments.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListArguments.java >@@ -35,11 +35,11 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIStackListArgumentsInfo; > public class MIStackListArguments extends MICommand<MIStackListArgumentsInfo> > { > public MIStackListArguments(IMIExecutionDMContext execDmc, boolean showValues) { >- super(execDmc, "-stack-list-arguments", new String[] { showValues ? "1" : "0" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ super(execDmc, "-stack-list-arguments", new String[] { showValues ? "1" : "0", "0", MIStackInfoDepth.getLimit() }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > } > > public MIStackListArguments(IFrameDMContext frameDmc, boolean showValues) { >- super(frameDmc, "-stack-list-arguments", new String[] { showValues ? "1" : "0" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ super(frameDmc, "-stack-list-arguments", new String[] { showValues ? "1" : "0", "0", MIStackInfoDepth.getLimit() }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > } > > public MIStackListArguments(IMIExecutionDMContext execDmc, boolean showValues, int low, int high) { >diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListFrames.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListFrames.java >index 2d2ec7c..1b471d4 100644 >--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListFrames.java >+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackListFrames.java >@@ -54,7 +54,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIStackListFramesInfo; > public class MIStackListFrames extends MICommand<MIStackListFramesInfo> > { > public MIStackListFrames(IMIExecutionDMContext execDmc) { >- super(execDmc, "-stack-list-frames"); //$NON-NLS-1$ >+ super(execDmc, "-stack-list-frames", new String[] { "0", MIStackInfoDepth.getLimit() }); //$NON-NLS-1$ //$NON-NLS-2$ > } > > public MIStackListFrames(IMIExecutionDMContext execDmc, int low, int high) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 315920
: 251256 |
274236
|
274277