File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,15 @@ public function extractDebugInfo(string $binary_path): string
101101 FileSystem::createDir ($ target_dir );
102102 $ basename = basename ($ binary_path );
103103 $ debug_file = "{$ target_dir }/ {$ basename }" . (PHP_OS_FAMILY === 'Darwin ' ? '.dwarf ' : '.debug ' );
104- shell ()->exec (match (PHP_OS_FAMILY ) {
105- 'Darwin ' => "dsymutil -f {$ binary_path } -o {$ debug_file }" ,
106- 'Linux ' => "objcopy ---only-keep-debug {$ binary_path } {$ debug_file }" ,
107- default => throw new SPCInternalException ('extractDebugInfo is only supported on Linux and macOS ' ),
108- });
104+ if (PHP_OS_FAMILY === 'Darwin ' ) {
105+ shell ()->exec ("dsymutil -f {$ binary_path } -o {$ debug_file }" );
106+ } elseif (PHP_OS_FAMILY === 'Linux ' ) {
107+ shell ()
108+ ->exec ("objcopy --only-keep-debug {$ binary_path } {$ debug_file }" )
109+ ->exec ("objcopy --add-gnu-debuglink= {$ debug_file } {$ binary_path }" );
110+ } else {
111+ throw new SPCInternalException ('extractDebugInfo is only supported on Linux and macOS ' );
112+ }
109113 return $ debug_file ;
110114 }
111115
You can’t perform that action at this time.
0 commit comments