Ignore:
Timestamp:
10/08/13 10:28:34 (11 years ago)
Author:
adrpo
Message:
  • mdt 0.7.31 + add preference for gdb max stack depth in Modelica preferences (default to -1 which means all the stack)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.debug.core/src/org/modelica/mdt/debug/gdb/core/model/thread/GDBThread.java

    r1512 r1831  
    4545import org.eclipse.debug.core.model.IStackFrame;
    4646import org.eclipse.debug.core.model.IThread;
     47import org.modelica.mdt.core.preferences.PreferenceManager;
    4748import org.modelica.mdt.debug.core.MDTDebugCorePlugin;
    4849import org.modelica.mdt.debug.core.launcher.IMDTConstants;
     
    106107    public List<GDBStackFrame> fGDBStackFrames = null;
    107108    private GDBStackFrame fCurrentGDBStackFrame = null;
    108     private final static int MAX_STACK_DEPTH = 100;
     109    /* get it from preferences and if is -1 assign it inside getStackInfoDepth! */
     110    private static int MAX_STACK_DEPTH =
     111            Integer.parseInt(PreferenceManager.getOMCGDBMaxStackDepth());
    109112    private Boolean fRefreshStackFrames = true;
    110113    public enum ExecuteCommand {
     
    202205                        // get the stack depth
    203206                        int depth = getStackInfoDepth();
    204                         if (depth >= getMaxStackDepth())
     207                        if (depth > getMaxStackDepth())
    205208                            depth = getMaxStackDepth() - 1;
    206209                        // get the stack frames from GDB
     
    384387     * @return
    385388     */
    386     public int getStackInfoDepth() {
     389    public int getStackInfoDepth() { 
    387390        // TODO Auto-generated method stub
    388391        int stackDepth = 0;
     
    419422                // TODO Auto-generated catch block
    420423                MDTDebugCorePlugin.log(null, e);
     424                stackDepth = 1;
    421425            }
    422426        } catch (MIException e) {
    423427            // 1 is safe to return
    424             return 1;
    425         }
     428            stackDepth = 1;
     429        }
     430        if (MAX_STACK_DEPTH < 0)
     431            MAX_STACK_DEPTH = stackDepth;
    426432        return stackDepth;
    427433    }
Note: See TracChangeset for help on using the changeset viewer.