Skip to content

Commit

Permalink
bluescreen: stack trace is reduced before analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 5, 2024
1 parent af0c6bf commit 824bfc9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Tracy/BlueScreen/assets/section-stack-exception.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ namespace Tracy;
*/

$stack = $ex->getTrace();
if (in_array($stack[0]['class'] ?? null, [DevelopmentStrategy::class, ProductionStrategy::class], true)) {
array_shift($stack);
}
if (($stack[0]['class'] ?? null) === Debugger::class && in_array($stack[0]['function'], ['shutdownHandler', 'errorHandler'], true)) {
array_shift($stack);
}

$expanded = null;
if (
(!$ex instanceof \ErrorException
|| in_array($ex->getSeverity(), [E_USER_NOTICE, E_USER_WARNING, E_USER_DEPRECATED], true))
(!$ex instanceof \ErrorException || in_array($ex->getSeverity(), [E_USER_NOTICE, E_USER_WARNING, E_USER_DEPRECATED], true))
&& $this->isCollapsed($ex->getFile())
) {
foreach ($stack as $key => $row) {
Expand All @@ -25,12 +31,6 @@ if (
}
}

if (in_array($stack[0]['class'] ?? null, [DevelopmentStrategy::class, ProductionStrategy::class], true)) {
array_shift($stack);
}
if (($stack[0]['class'] ?? null) === Debugger::class && in_array($stack[0]['function'], ['shutdownHandler', 'errorHandler'], true)) {
array_shift($stack);
}
$file = $ex->getFile();
$line = $ex->getLine();

Expand Down

0 comments on commit 824bfc9

Please sign in to comment.