Changeset 1191

Show
Ignore:
Timestamp:
06/20/08 21:04:06 (7 months ago)
Author:
asterite
Message:

Fixed breakpoint not understood in gbd linux

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.core/src/descent/core/Signature.java

    r1189 r1191  
    8383 *      
    8484 * StaticArrayTypeSignature ::= 
    85  *   "G" TypeSignature "G" Number "G" Chars // Number == Chars.length 
     85 *   "G" TypeSignature "&" Number "G" Chars // Number == Chars.length 
    8686 *    
    8787 * AssociativeArrayTypeSignature ::= 
     
    9595 *    
    9696 * SliceTypeSignature ::= 
    97  *   "" TypeSignature "
    98  *   Number "" Chars // Number == Chars.length --> lower 
    99  *   Number "" Chars // Number == Chars.length --> upper 
     97 *   "." TypeSignature "~
     98 *   Number "." Chars // Number == Chars.length --> lower 
     99 *   Number "." Chars // Number == Chars.length --> upper 
    100100 *    
    101101 * FunctionTypeSignature ::= 
     
    129129 *     ( "C"  // class 
    130130 *     | "S"  // struct 
    131  *     | "&"  // union 
    132  *     | "|"  // interface 
     131 *     | "U"  // union 
     132 *     | "I"  // interface 
    133133 *     | "E"  // enum 
    134  *     | "~"  // enum member 
    135  *     | ""  // variable 
     134 *     | "M"  // enum member 
     135 *     | "B"  // variable 
    136136 *     | "="  // alias 
    137137 *     | "T"  // typedef 
     
    379379     
    380380    /** 
     381     * Character constant indicating a static array type after it's type in a signature. 
     382     * Value is <code>'&'</code>. 
     383     */ 
     384    public static final char C_STATIC_ARRAY2                                = '&'; 
     385     
     386    /** 
    381387     * Character constant indicating an associative array type in a signature. 
    382388     * Value is <code>'H'</code>. 
     
    388394     * Value is <code>'>'</code>. 
    389395     */ 
    390     public static final char C_TYPEOF                                   = '>'; 
     396    public static final char C_TYPEOF                                   = 'O'; 
    391397     
    392398    /** 
     
    398404    /** 
    399405     * Character constant indicating a slice type in a signature. 
    400      * Value is <code>''</code>. 
    401      */ 
    402     public static final char C_SLICE                                    = '¬'; 
     406     * Value is <code>'.'</code>. 
     407     */ 
     408    public static final char C_SLICE                                    = '.'; 
     409     
     410    /** 
     411     * Character constant indicating a slice type after it's type in a signature. 
     412     * Value is <code>'~'</code>. 
     413     */ 
     414    public static final char C_SLICE2                                   = '~'; 
    403415     
    404416    /** 
     
    478490     * Value is <code>'&'</code>. 
    479491     */ 
    480     public static final char C_UNION                                    = '&'; 
     492    public static final char C_UNION                                    = 'N'; 
    481493     
    482494    /** 
     
    484496     * Value is <code>'|'</code>. 
    485497     */ 
    486     public static final char C_INTERFACE                                = '|'; 
     498    public static final char C_INTERFACE                                = 'I'; 
    487499     
    488500    /** 
     
    496508     * Value is <code>'~'</code>. 
    497509     */ 
    498     public static final char C_ENUM_MEMBER                                      = '~'; 
     510    public static final char C_ENUM_MEMBER                                      = 'M'; 
    499511     
    500512    /** 
    501513     * Character constant indicating a variable in a signature. 
    502      * Value is <code>''</code>. 
    503      */ 
    504     public static final char C_VARIABLE                                 = '¡'; 
     514     * Value is <code>'B'</code>. 
     515     */ 
     516    public static final char C_VARIABLE                                 = 'B'; 
    505517     
    506518    /** 
     
    618630     * Value is <code>'\\'</code>. 
    619631     */ 
    620     public static final char C_TEMPLATE_VALUE_PARAMETER_SPECIFIC_VALUE                 = '\\'; 
     632    public static final char C_TEMPLATE_VALUE_PARAMETER_SPECIFIC_VALUE  = '\\'; 
    621633     
    622634    /** 
  • trunk/descent.core/src/descent/core/dom/CompilationUnitResolver.java

    r1165 r1191  
    359359            module.semantic(context); 
    360360        } catch (Throwable t) { 
    361             t.printStackTrace(); 
    362361            Util.log(t); 
    363362        } 
  • trunk/descent.core/src/descent/internal/compiler/parser/Objects.java

    r1160 r1191  
    1111    public Objects(int capacity) { 
    1212        super(capacity); 
     13        setDim(capacity); 
    1314    } 
    1415 
  • trunk/descent.core/src/descent/internal/compiler/parser/Statement.java

    r1188 r1191  
    1313     
    1414    public int blockExit(SemanticContext context) { 
    15         throw new IllegalStateException("assert(0)"); 
     15        // TODO Semantic 
     16//      throw new IllegalStateException("assert(0)"); 
     17        return 0; 
    1618    } 
    1719 
  • trunk/descent.core/src/descent/internal/compiler/parser/TypeSArray.java

    r1165 r1191  
    22 
    33import melnorme.miscutil.tree.TreeVisitor; 
     4import descent.core.Signature; 
    45import descent.core.compiler.IProblem; 
    56import descent.internal.compiler.parser.ast.IASTVisitor; 
     
    491492    @Override 
    492493    protected void appendSignature0(StringBuilder sb) { 
    493         sb.append('G'); 
     494        sb.append(Signature.C_STATIC_ARRAY); 
    494495        next.appendSignature(sb); 
    495         sb.append('G'); 
     496        sb.append(Signature.C_STATIC_ARRAY2); 
    496497         
    497498        char[] expc = encoder.encodeExpression(dim); 
    498499        sb.append(expc.length); 
    499         sb.append('G'); 
     500        sb.append(Signature.C_STATIC_ARRAY); 
    500501        sb.append(expc); 
    501502    } 
  • trunk/descent.core/src/descent/internal/compiler/parser/TypeSlice.java

    r1189 r1191  
    194194        sb.append(Signature.C_SLICE); 
    195195        next.appendSignature(sb); 
    196         sb.append(Signature.C_SLICE); 
     196        sb.append(Signature.C_SLICE2); 
    197197         
    198198        char[] expc = encoder.encodeExpression(lwr); 
  • trunk/descent.core/src/descent/internal/core/SignatureProcessor.java

    r1189 r1191  
    393393                requestor.acceptPosition(localPosition); 
    394394                continue; 
     395            case Signature.C_STATIC_ARRAY2: 
     396            case Signature.C_SLICE2: 
     397                return i; 
    395398            default: 
    396399                // Try with type basic 
  • trunk/descent.core/src/descent/internal/core/util/Util.java

    r1093 r1191  
    12691269     
    12701270    public static void log(Throwable e) { 
    1271         log(e, ""); 
     1271        log(e, e.getMessage() == null ? e.getClass().getName() : e.getClass().getName() + ": " + e.getMessage()); 
    12721272    } 
    12731273     
  • trunk/descent.debug.core/src/descent/internal/debug/core/model/gdb/Running.java

    r716 r1191  
    1212    private String fBreakpointFileName; 
    1313    private int fBreakpointLineNumber; 
     14    private boolean fNextHasBreakpointInfo; 
    1415 
    1516    public Running(GdbDebugger cli) { 
     
    1819 
    1920    public void interpret(String text) throws DebugException, IOException { 
     21        if (fNextHasBreakpointInfo) { 
     22            fNextHasBreakpointInfo = false; 
     23             
     24            // at file:lineNumber address 
     25            int indexOfColon = text.lastIndexOf(':'); 
     26            if (indexOfColon != -1) { 
     27                if (!processBreakpointInfo(text, indexOfColon)) { 
     28                    return; 
     29                } 
     30            } 
     31        } 
     32         
    2033        if (fLastWasBreakpointHit) { 
    2134            if (text.trim().equals("(gdb)")) { 
     
    3144        } else if (text.startsWith("Breakpoint ")) { //$NON-NLS-1$ 
    3245            // Breakpoint n hit at file:lineNumber address 
    33              
    3446            int indexOfColon = text.lastIndexOf(':'); 
    3547            if (indexOfColon != -1) { 
    36                 int indexOfSpaceBefore = text.lastIndexOf(' ', indexOfColon - 1); 
    37                 int indexOfSpaceAfter = text.indexOf(' ', indexOfColon + 1); 
    38                 if (indexOfSpaceAfter == -1) { 
    39                     indexOfSpaceAfter = text.length(); 
     48                if (!processBreakpointInfo(text, indexOfColon)) { 
     49                    return; 
    4050                } 
    41                 if (indexOfSpaceBefore != -1 && indexOfSpaceAfter != -1) { 
    42                     fBreakpointFileName = text.substring(indexOfSpaceBefore + 1, indexOfColon); 
    43                     try { 
    44                         fBreakpointLineNumber = Integer.parseInt(text.substring(indexOfColon + 1, indexOfSpaceAfter)); 
    45                     } catch (NumberFormatException e) { 
    46                         return; 
    47                     } 
    48                     fLastWasBreakpointHit = true; 
    49                 } 
     51            } else { 
     52                // The information might be in the next line 
     53                fNextHasBreakpointInfo = true; 
    5054            } 
    5155        } 
     56    } 
     57     
     58    private boolean processBreakpointInfo(String text, int indexOfColon) { 
     59        // * at file:lineNumber address 
     60        int indexOfSpaceBefore = text.lastIndexOf(' ', indexOfColon - 1); 
     61        int indexOfSpaceAfter = text.indexOf(' ', indexOfColon + 1); 
     62        if (indexOfSpaceAfter == -1) { 
     63            indexOfSpaceAfter = text.length(); 
     64        } 
     65        if (indexOfSpaceBefore != -1 && indexOfSpaceAfter != -1) { 
     66            fBreakpointFileName = text.substring(indexOfSpaceBefore + 1, indexOfColon); 
     67            try { 
     68                fBreakpointLineNumber = Integer.parseInt(text.substring(indexOfColon + 1, indexOfSpaceAfter)); 
     69            } catch (NumberFormatException e) { 
     70                return false; 
     71            } 
     72            fLastWasBreakpointHit = true; 
     73        } 
     74         
     75        return true; 
    5276    } 
    5377