function::sprint_stack - Linux
Overview
The function::sprint_stack
command is used for debugging purposes in Firefox. It prints the stack trace of the current thread to the console. This can be helpful for identifying the source of an error or crash.
Syntax
function::sprint_stack [options]
Options/Flags
-h
,--help
: Display help information.-a
,--all
: Print the stack trace of all threads.-t
,--thread
: Print the stack trace of the specified thread.-f
,--frames
: Print the specified number of frames.-s
,--source
: Print the source code for each frame.-l
,--level
: Print the specified level of detail.
Examples
To print the stack trace of the current thread:
function::sprint_stack
To print the stack trace of all threads:
function::sprint_stack -a
To print the stack trace of the specified thread:
function::sprint_stack -t 1
To print the specified number of frames:
function::sprint_stack -f 10
To print the source code for each frame:
function::sprint_stack -s
To print the specified level of detail:
function::sprint_stack -l 2
Common Issues
If the function::sprint_stack
command does not print any output, it is likely that the debugger.options.stack-frames
preference is set to 0. To fix this, set the preference to a non-zero value.
Integration
The function::sprint_stack
command can be used with other Firefox debugging tools, such as the debugger
command. For example, to print the stack trace of the current thread and then break into the debugger, you can use the following command:
function::sprint_stack | debugger
Related Commands
debugger
: Thedebugger
command is used to start the Firefox debugger.stack
: Thestack
command is used to print the stack trace of the current thread in the GDB debugger.