1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Render internal stack frames more reasonably

Summary: Some stack frames do not have file/line information, e.g. __autoload
triggers. Render these as "Internal".

Test Plan: Reloaded a trace with an internal __autoload() frame, got
"(Internal)" instead of ": 0" with warnings.

Reviewers: jungejason, tuomaspelkonen, aran

Reviewed By: jungejason

CC: aran, jungejason

Differential Revision: 843
This commit is contained in:
epriestley 2011-08-21 13:07:09 -07:00
parent fd0f4d9c52
commit 04b4f04cb9

View file

@ -505,7 +505,7 @@ class AphrontDefaultApplicationConfiguration
$depth = count($trace); $depth = count($trace);
foreach ($trace as $part) { foreach ($trace as $part) {
$lib = null; $lib = null;
$file = $part['file']; $file = idx($part, 'file');
$relative = $file; $relative = $file;
foreach ($libraries as $library) { foreach ($libraries as $library) {
$root = phutil_get_library_root($library); $root = phutil_get_library_root($library);
@ -524,24 +524,28 @@ class AphrontDefaultApplicationConfiguration
$where .= $part['function'].'()'; $where .= $part['function'].'()';
} }
if (isset($browse[$lib])) { if ($file) {
$file_name = phutil_render_tag( if (isset($browse[$lib])) {
'a', $file_name = phutil_render_tag(
array( 'a',
'href' => $browse[$lib].$relative.'$'.$part['line'], array(
'title' => $file, 'href' => $browse[$lib].$relative.'$'.$part['line'],
'target' => '_blank', 'title' => $file,
), 'target' => '_blank',
phutil_escape_html($relative)); ),
phutil_escape_html($relative));
} else {
$file_name = phutil_render_tag(
'span',
array(
'title' => $file,
),
phutil_escape_html($relative));
}
$file_name = $file_name.' : '.(int)$part['line'];
} else { } else {
$file_name = phutil_render_tag( $file_name = '<em>(Internal)</em>';
'span',
array(
'title' => $file,
),
phutil_escape_html($relative));
} }
$file_name = $file_name.' : '.(int)$part['line'];
$rows[] = array( $rows[] = array(