Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/hotspot/share/jvmci/jvmciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,24 +322,33 @@ void JVMCIEnv::describe_pending_exception(outputStream* st) {
char* cursor = stack_trace;
int line = 0;
const int max_lines = LogEventsBufferEntries / 2;
char* last_line = nullptr;
while (*cursor != '\0') {
char* eol = strchr(cursor, '\n');
if (eol == nullptr) {
if (line < max_lines) {
if (line == max_lines - 1) {
last_line = cursor;
} else if (line < max_lines) {
JVMCI_event_1("%s", cursor);
}
cursor = cursor + strlen(cursor);
} else {
*eol = '\0';
if (line < max_lines) {
if (line == max_lines - 1) {
last_line = cursor;
} else if (line < max_lines) {
JVMCI_event_1("%s", cursor);
}
cursor = eol + 1;
}
line++;
}
if (line >= max_lines) {
JVMCI_event_1("[elided %d more stack trace lines]", line - max_lines);
if (last_line != nullptr) {
if (line > max_lines) {
JVMCI_event_1("%s [elided %d more stack trace lines]", last_line, line - max_lines);
} else {
JVMCI_event_1("%s", last_line);
}
}
}
}
Expand Down