Provide default Print() for StackFrame.
For stack frame types that don't provide their own Print function, we used to print nothing at all. Now we print at least the type and the pc. Bug: Change-Id: I8453d705589bc83c284ce4eb4e981f2ad32ee901 Reviewed-on: https://chromium-review.googlesource.com/897425 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51053}
This commit is contained in:
parent
6bf8885290
commit
fc1b29c985
@ -702,8 +702,28 @@ void PrintIndex(StringStream* accumulator, StackFrame::PrintMode mode,
|
||||
int index) {
|
||||
accumulator->Add((mode == StackFrame::OVERVIEW) ? "%5d: " : "[%d]: ", index);
|
||||
}
|
||||
|
||||
const char* StringForStackFrameType(StackFrame::Type type) {
|
||||
switch (type) {
|
||||
#define CASE(value, name) \
|
||||
case StackFrame::value: \
|
||||
return #name;
|
||||
STACK_FRAME_TYPE_LIST(CASE)
|
||||
#undef CASE
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void StackFrame::Print(StringStream* accumulator, PrintMode mode,
|
||||
int index) const {
|
||||
DisallowHeapAllocation no_gc;
|
||||
PrintIndex(accumulator, mode, index);
|
||||
accumulator->Add(StringForStackFrameType(type()));
|
||||
accumulator->Add(" [pc: %p]\n", pc());
|
||||
}
|
||||
|
||||
void BuiltinExitFrame::Print(StringStream* accumulator, PrintMode mode,
|
||||
int index) const {
|
||||
DisallowHeapAllocation no_gc;
|
||||
|
@ -289,9 +289,8 @@ class StackFrame BASE_EMBEDDED {
|
||||
|
||||
// Printing support.
|
||||
enum PrintMode { OVERVIEW, DETAILS };
|
||||
virtual void Print(StringStream* accumulator,
|
||||
PrintMode mode,
|
||||
int index) const { }
|
||||
virtual void Print(StringStream* accumulator, PrintMode mode,
|
||||
int index) const;
|
||||
|
||||
Isolate* isolate() const { return isolate_; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user