Search in sources :

Example 6 with ILineRule

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

the class EnvironmentTagParser method addCmdLineRule.

/**
 * Add rule for the command line (2CICMDLINE tag)
 */
private void addCmdLineRule() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // command line is on a single line, can include whitespace, separators etc
            // Java 7.0 - can get [not available]
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addToken(CMD_LINE, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(T_1CICMDLINE, 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 7 with ILineRule

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

the class MonitorTagParser method addRegMon.

/**
 */
private void addRegMon() {
    ILineRule lineRule = new MonitorObjectLineRule() {

        public void processLine(String source, int startingOffset) {
            addMonitorLockNameAndAddress();
        }
    };
    addTag(T_2LKREGMON, lineRule);
}
Also used : ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 8 with ILineRule

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

the class StackTagParser method initTagAttributeRules.

/**
 * Initialize 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.colon);
            addPrefixedHexToken(STACK_THREAD);
        }
    };
    addTag(T_BTTHREADID, lineRule);
    lineRule = new LineRule() {

        // Consider all the possibilities
        // Linux
        // 1BTSTACKENT          /home/vmfarm/pxa6460sr6/ibm-java-x86_64-60/jre/lib/amd64/default/libj9dyn24.so(j9bcutil_createRomClass+0x40) [0x2a99e1be00]
        // 1BTSTACKENT          /home/vmfarm/pxa6460sr6/ibm-java-x86_64-60/jre/lib/amd64/default/libj9dyn24.so [0x2a99e1be00]
        // 1BTSTACKENT          [0x2a99e1be00]
        // AIX
        // 1BTSTACKENT          0x3076AB84
        // 1BTSTACKENT          /data/AIX/testjava/java6-32/sdk/jre/lib/ppc/libj9vm24.so:0xD538DDB4 [0xD5363000 +0x0002ADB4]
        // z/OS
        // 1BTSTACKENT          MM_ConcurrentSweepScheme::workThreadFindMinimumSizeFreeEntry(MM_EnvironmentModron*,MM_Memor...:0x2C280D0C [0x2C280840 +0x000004CC]
        // 1BTSTACKENT          :0x2C284192 [0x2C283FF0 +0x000001A2]
        // 1BTSTACKENT          thread_wrapper:0x2B697FBA [0x2B697B48 +0x00000472]
        // 1BTSTACKENT          CEEVROND:0x0F7E1AE8 [0x0F7E1198 +0x00000950]
        public void processLine(String source, int startingOffset) {
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            if (indexOfLast(LINUXADDRESS) >= 0) {
                IParserToken token = addAllCharactersAsTokenAndConsumeFirstMatch(STACK_MODULE, CommonPatternMatchers.open_paren);
                if (token != null) {
                    addAllCharactersAsTokenAndConsumeFirstMatch(STACK_ROUTINE, Pattern.compile("[+-]").matcher(""));
                    addPrefixedHexToken(STACK_OFFSET);
                } else {
                    addAllCharactersAsTokenAndConsumeFirstMatch(STACK_MODULE, CommonPatternMatchers.whitespace);
                }
                addPrefixedHexToken(STACK_PROC_ADDRESS);
            } else {
                int lastColon = indexOfLast(CommonPatternMatchers.colon);
                if (lastColon >= 0) {
                    String name = consumeCharacters(0, lastColon);
                    if (name.indexOf("/") != -1) {
                        addToken(STACK_MODULE, name);
                    } else {
                        addToken(STACK_ROUTINE, name);
                    }
                }
                addPrefixedHexToken(STACK_PROC_ADDRESS);
                addPrefixedHexToken(STACK_ROUTINE_ADDRESS);
                addPrefixedHexToken(STACK_OFFSET);
            }
        }
    };
    addTag(T_1BTSTACKENT, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) IParserToken(com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 9 with ILineRule

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

the class ThreadTagParser method initThreadInfo1Tag.

/**
 */
private void initThreadInfo1Tag() {
    // 3XMTHREADINFO1            (native thread ID:0x88C, native priority:0x5, native policy:UNKNOWN, vmstate:R, vm thread flags:0x00000020)
    // vmstate and vm thread flags added in LIR 14327
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            /*
				 * NATIVE_THREAD_ID
				 */
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            addPrefixedHexToken(IThreadTypes.NATIVE_THREAD_ID);
            /*
				 * NATIVE_THREAD_PRIORITY
				 */
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            addPrefixedHexToken(IThreadTypes.NATIVE_THREAD_PRIORITY);
            /*
				 * NATIVE_THREAD_POLICY
				 */
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            addToken(IThreadTypes.NATIVE_THREAD_POLICY, CommonPatternMatchers.lettervalue);
            /*
				 * Optional: Native Scope
				 */
            if (findFirst(ThreadPatternMatchers.scope) && consumeUntilFirstMatch(CommonPatternMatchers.colon)) {
                addPrefixedHexToken(IThreadTypes.SCOPE);
            }
            /*
				 * Optional: VM thread state
				 */
            if (findFirst(ThreadPatternMatchers.vmstate) && consumeUntilFirstMatch(CommonPatternMatchers.colon)) {
                addToken(IThreadTypes.VM_STATE, CommonPatternMatchers.lettervalue);
            }
            /*
				 * Optional: VM thread flags
				 */
            if (findFirst(ThreadPatternMatchers.vmflags) && consumeUntilFirstMatch(CommonPatternMatchers.colon)) {
                addPrefixedHexToken(IThreadTypes.VM_FLAGS);
            }
        }
    };
    addTag(IThreadTypes.T_3XMTHREADINFO1, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) PointerSizeLineRule(com.ibm.dtfj.javacore.parser.j9.section.common.PointerSizeLineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 10 with ILineRule

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

the class ThreadTagParser method initStackTraceTag.

/**
 * Both Sov and J9
 */
private void initStackTraceTag() {
    addTag(IThreadTypes.T_3XMTHREADINFO3, null);
    ILineRule lineRule = new StackTraceLineRule();
    addTag(IThreadTypes.T_4XESTACKTRACE, lineRule);
}
Also used : ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Aggregations

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