mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibJS: Include source locations in VM::dump_backtrace() output
This commit is contained in:
parent
ca940d7240
commit
cd7dbe3e97
1 changed files with 9 additions and 2 deletions
|
@ -757,8 +757,15 @@ void VM::promise_rejection_tracker(const Promise& promise, Promise::RejectionOpe
|
||||||
|
|
||||||
void VM::dump_backtrace() const
|
void VM::dump_backtrace() const
|
||||||
{
|
{
|
||||||
for (ssize_t i = m_execution_context_stack.size() - 1; i >= 0; --i)
|
for (ssize_t i = m_execution_context_stack.size() - 1; i >= 0; --i) {
|
||||||
dbgln("-> {}", m_execution_context_stack[i]->function_name);
|
auto& frame = m_execution_context_stack[i];
|
||||||
|
if (frame->current_node) {
|
||||||
|
auto& source_range = frame->current_node->source_range();
|
||||||
|
dbgln("-> {} @ {}:{},{}", frame->function_name, source_range.filename, source_range.start.line, source_range.start.column);
|
||||||
|
} else {
|
||||||
|
dbgln("-> {}", frame->function_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VM::dump_environment_chain() const
|
void VM::dump_environment_chain() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue