mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Bug 1172076 - Improve js::DumpBacktrace to include raw frame pointers and types. r=jandem
This commit is contained in:
parent
b10843500c
commit
d2a7443155
@ -3511,8 +3511,15 @@ js::DumpBacktrace(JSContext* cx)
|
||||
const char* filename = JS_GetScriptFilename(i.script());
|
||||
unsigned line = PCToLineNumber(i.script(), i.pc());
|
||||
JSScript* script = i.script();
|
||||
sprinter.printf("#%d %14p %s:%d (%p @ %d)\n",
|
||||
depth, (i.isJit() ? 0 : i.interpFrame()), filename, line,
|
||||
char frameType =
|
||||
i.isInterp() ? 'i' :
|
||||
i.isBaseline() ? 'b' :
|
||||
i.isIon() ? 'I' :
|
||||
i.isAsmJS() ? 'A' :
|
||||
'?';
|
||||
|
||||
sprinter.printf("#%d %14p %c %s:%d (%p @ %d)\n",
|
||||
depth, i.rawFramePtr(), frameType, filename, line,
|
||||
script, script->pcToOffset(i.pc()));
|
||||
}
|
||||
fprintf(stdout, "%s", sprinter.string());
|
||||
|
@ -853,6 +853,21 @@ FrameIter::copyDataAsAbstractFramePtr() const
|
||||
return frame;
|
||||
}
|
||||
|
||||
void*
|
||||
FrameIter::rawFramePtr() const
|
||||
{
|
||||
switch (data_.state_) {
|
||||
case DONE:
|
||||
case ASMJS:
|
||||
return nullptr;
|
||||
case JIT:
|
||||
return data_.jitFrames_.fp();
|
||||
case INTERP:
|
||||
return interpFrame();
|
||||
}
|
||||
MOZ_CRASH("Unexpected state");
|
||||
}
|
||||
|
||||
JSCompartment*
|
||||
FrameIter::compartment() const
|
||||
{
|
||||
|
@ -2040,6 +2040,9 @@ class FrameIter
|
||||
// This can only be called when isPhysicalIonFrame():
|
||||
inline jit::CommonFrameLayout* physicalIonFrame() const;
|
||||
|
||||
// This is used to provide a raw interface for debugging.
|
||||
void* rawFramePtr() const;
|
||||
|
||||
private:
|
||||
Data data_;
|
||||
jit::InlineFrameIterator ionInlineFrames_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user