use of com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken in project openj9 by eclipse.
the class JavaCoreAttributeValueMap method getTokenValue.
/*
* DATA EXTRACTION
*/
/**
* @param results
* @param tokenType
*/
public String getTokenValue(String tokenType) {
IParserToken token = getToken(tokenType);
String value = null;
if (token != null) {
value = token.getValue();
}
return value;
}
use of com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken in project openj9 by eclipse.
the class ClassLoaderSectionParser method classLoaderLibraries.
/**
* Loaded libraries data may not be found in Sovereign VMs, therefore make
* it optional, even though it is a standard tag in later J9 VMs.
* @throws ParserException
*/
private void classLoaderLibraries() throws ParserException {
if (matchOptional(T_1CLTEXTCLLIB)) {
consume();
/*
* Consume whatever other data is in the same line, as it's just header data.
*/
IParserToken token = lookAhead(1);
if (token != null && token.getType().equals(IGeneralTokenTypes.UNPARSED_STRING)) {
consume();
}
IAttributeValueMap results = null;
if ((results = processTagLineRequired(T_2CLTEXTCLLIB)) != null) {
processLibraryLoader(results);
while ((results = processTagLineOptional(T_2CLTEXTCLLIB)) != null) {
processLibraryLoader(results);
}
}
}
}
use of com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken in project openj9 by eclipse.
the class MonitorSectionParser method waitOnNotifyOrEnter.
/**
* This handles both wait on notify and wait on enter threads for a given java monitor.
* <br><br>
* If either a wait on notify or wait on enter header tag is parsed (3LKNOTIFYQ or 3LKWAITNOTIFY, respectively),
* its corresponding data tag (3LKWAITNOTIFY and 3LKWAITER, respectively) is parsed iteratively.
* For each of the data tags, a valid threadID must be parsed. If not, an exception is thrown and
* the thread is not added to the monitor wait notify/wait enter thread list.However, the process
* will continue regardless of whether errors are encountered or not, as long as the error handler permits it to
* do so.
* <br>
* A valid thread ID must be parsed for each 3LKWAITNOTIFY or 3LKWAITER encountered, or error handler is invoked.
* @throws ParserException
*/
private void waitOnNotifyOrEnter(JavaMonitor monitor) throws ParserException {
boolean waitOnNotify = false;
String tagName = null;
while ((waitOnNotify = matchOptional(tagName = T_3LKNOTIFYQ)) || matchOptional(T_3LKWAITERQ)) {
// Consume header tag
consume();
// Consume any unnecessary data contained in the same header tag line:
IParserToken token = lookAhead(1);
if (token != null && token.getType().equals(IGeneralTokenTypes.UNPARSED_STRING)) {
consume();
}
tagName = (waitOnNotify) ? T_3LKWAITNOTIFY : T_3LKWAITER;
IAttributeValueMap results = null;
// This must match at least once. Subsequent matches are optional.
if ((results = processTagLineRequired(tagName)) != null) {
processNotifyOrEnterThreads(monitor, results, waitOnNotify);
while ((results = processTagLineOptional(tagName)) != null) {
processNotifyOrEnterThreads(monitor, results, waitOnNotify);
}
}
}
}
use of com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken in project openj9 by eclipse.
the class NativeStackTraceLineRule method processLine.
protected void processLine(String source, int startingOffset) {
// 4XENATIVESTACK _threadstart (thread.c:196, 0x7C34940F [MSVCR71+0x6c])
// 4XENATIVESTACK GetModuleHandleA (0x77E6482F [kernel32+0xdf])
// 4XENATIVESTACK monitor_enter_three_tier (j9thread.c, 0x7FFA284B [J9THR26+0xbb])
// 4XENATIVESTACK (0x0000002A9632E2B9 [libj9prt26.so+0x112b9])
// 4XENATIVESTACK 0x0000002A9632E2B9
// new format with routine plus offset
// 4XENATIVESTACK j9sig_protect+0x41 (j9signal.c:144, 0x7FECBE31 [J9PRT24+0xbe31])
// Java 7.0
// 4XENATIVESTACK getFinalPath+0xaa (winntfilesystem_md.c:126, 0x00408C4F [java+0x8c4f])
// 4XENATIVESTACK GetModuleFileNameA+0x1b4 (0x7C80B683 [kernel32+0xb683])
consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
// The routine name is ended by at least one space and an open parenthesis
IParserToken routine = addAllCharactersAsTokenAndConsumeFirstMatch(STACK_ROUTINE, spaceparen);
if (routine != null) {
String val = routine.getValue();
sign.reset(val);
if (sign.find()) {
addToken(STACK_ROUTINE, val.substring(0, sign.start()));
CommonPatternMatchers.signed_hex_0x.reset(val);
if (CommonPatternMatchers.signed_hex_0x.find()) {
addToken(STACK_ROUTINE_OFFSET, CommonPatternMatchers.signed_hex_0x.group());
}
}
}
// The file name is ended by a comma
int sourceIndex = indexOfLast(CommonPatternMatchers.comma);
if (sourceIndex >= 0) {
// The line number is indicated by a colon before the comma
int sourceIndex2 = indexOfLast(CommonPatternMatchers.colon);
if (sourceIndex2 < sourceIndex) {
addAllCharactersAsTokenAndConsumeFirstMatch(STACK_FILE, CommonPatternMatchers.colon);
addToken(STACK_LINE, CommonPatternMatchers.dec);
} else {
addAllCharactersAsTokenAndConsumeFirstMatch(STACK_FILE, CommonPatternMatchers.comma);
}
}
addPrefixedHexToken(STACK_PROC_ADDRESS);
consumeUntilFirstMatch(mb);
addAllCharactersAsTokenUntilFirstMatch(STACK_MODULE, sign);
addToken(STACK_MODULE_OFFSET, CommonPatternMatchers.signed_hex_0x);
}
Aggregations