Search in sources :

Example 11 with LineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.LineRule in project openj9 by eclipse.

the class TitleTagParser method addFileName.

/**
 * Add rule for the dump filename (1TIFILENAME line)
 */
private void addFileName() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // 1TIFILENAME    Javacore filename:    C:\Documents and Settings\Administrator\My Documents\javacore.20080219.155641.3836.0003.txt
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addToken(TI_FILENAME, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(T_1TIFILENAME, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 12 with LineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.LineRule in project openj9 by eclipse.

the class PlatformTagParser method addExceptionCodeRule.

/**
 * Add rule for J9Generic_Signal/J9Generic_Signal_Number (1XHEXCPCODE line)
 */
private void addExceptionCodeRule() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // "J9Generic_Signal: "
            if (findFirst(PlatformPatternMatchers.J9Signal_1)) {
                consumeUntilFirstMatch(PlatformPatternMatchers.J9Signal_1);
                addNonPrefixedHexToken(PL_SIGNAL);
            } else if (findFirst(PlatformPatternMatchers.J9Signal_2)) {
                consumeUntilFirstMatch(PlatformPatternMatchers.J9Signal_2);
                addNonPrefixedHexToken(PL_SIGNAL);
            }
        }
    };
    addTag(T_1XHEXCPCODE, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 13 with LineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.LineRule in project openj9 by eclipse.

the class PlatformTagParser method addCPUArch.

/**
 * Add rule for the CPU architecture information (3XHCPUARCH line)
 */
private void addCPUArch() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // the CPU architecture is just a string following a colon
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addToken(PL_CPU_ARCH, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(T_3XHCPUARCH, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 14 with LineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.LineRule in project openj9 by eclipse.

the class PlatformTagParser method addRegisterRule.

private void addRegisterRule() {
    // 1XHREGISTERS   Registers:
    addTag(T_1XHREGISTERS, new LineRule() {

        public void processLine(String source, int startingOffset) {
        }
    });
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // 2XHREGISTER      EDI: 41460098
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addAllCharactersAsTokenAndConsumeFirstMatch(PL_REGISTER_NAME, CommonPatternMatchers.colon);
            addNonPrefixedHexToken(PL_REGISTER_VALUE);
        }
    };
    addTag(T_2XHREGISTER, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 15 with LineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.LineRule in project openj9 by eclipse.

the class EnvironmentTagParser method initTagAttributeRules.

/**
 * Initialise parser with rules for lines in the environment (CI) section in
 * the javacore
 */
protected void initTagAttributeRules() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // version is on a single line, can include whitespace, separators etc
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addToken(ARG_STRING, CommonPatternMatchers.allButControlChars);
        }
    };
    ILineRule lineRule2 = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // 1CIJAVAHOMEDIR Java Home Dir:   /home/rtjaxxon/sdk/ibm-wrt-i386-60/jre
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addToken(ARG_STRING, CommonPatternMatchers.allButControlChars);
        }
    };
    ILineRule lineRule3 = new LineRule() {

        public void processLine(String source, int startingOffset) {
            String bits = "32";
            CommonPatternMatchers.build_string.reset(source);
            if (CommonPatternMatchers.build_string.find()) {
                int build = CommonPatternMatchers.build_string.start();
                String version = source.substring(0, build);
                CommonPatternMatchers.bits64.reset(version);
                if (CommonPatternMatchers.bits64.find()) {
                    bits = "64";
                } else {
                    CommonPatternMatchers.s390.reset(version);
                    if (CommonPatternMatchers.s390.matches()) {
                        bits = "31";
                    }
                }
            }
            addToken(ICommonTypes.POINTER_SIZE, bits);
            // version is on a single line, can include whitespace, separators etc
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addToken(ARG_STRING, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(T_1CIJAVAVERSION, lineRule3);
    addTag(T_1CIVMVERSION, lineRule);
    addTag(T_1CIJITVERSION, lineRule);
    addTag(T_1CIGCVERSION, lineRule);
    addJITModesRule();
    addTag(T_1CIRUNNINGAS, null);
    addProcessIDRule();
    addCmdLineRule();
    addTag(T_1CIJAVAHOMEDIR, lineRule2);
    addTag(T_1CIJAVADLLDIR, lineRule2);
    addTag(T_1CISYSCP, lineRule2);
    addTag(T_1CIUSERARGS, lineRule);
    addUserArgs();
    addTag(T_1CIJVMMI, null);
    addTag(T_2CIJVMMIOFF, null);
    addTag(T_1CIENVVARS, lineRule);
    addEnvironmentVars();
    addStartTimeRule();
    addStartTimeNanoRule();
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Aggregations

ILineRule (com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)31 LineRule (com.ibm.dtfj.javacore.parser.framework.tag.LineRule)31 PointerSizeLineRule (com.ibm.dtfj.javacore.parser.j9.section.common.PointerSizeLineRule)5 IParserToken (com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken)1 Matcher (java.util.regex.Matcher)1