Skip to content

Conversation

@crazywhalecc
Copy link
Owner

What does this PR do?

Closes #949

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@henderkes
Copy link
Collaborator

I think we should refactor the debug copy out to its own function and put it in buildroot/debug. And of course also do it for shared libs.

@crazywhalecc
Copy link
Owner Author

I think we should refactor the debug copy out to its own function and put it in buildroot/debug. And of course also do it for shared libs.

I'm not quite sure if it's necessary to generate both of them simultaneously. But I think we could just keep the unstripped version in source. That is, strip after copy. WDYT?

@henderkes
Copy link
Collaborator

No, it should behave the same way for all binaries.
My idea is to create a function:

function extractDebugInfo($path) {
     $file = filename($path);
     $dir = basename($path);
     shell()->cd($dir)
          ->exec("objcopy ---only-debug-info $file $file.debug");
     ...
     mv($file . '.debug', BUILD_DEBUG_PATH);
}

And then call that for every binary in BIN/LIB/MODULES paths.

@crazywhalecc
Copy link
Owner Author

And then call that for every binary in BIN/LIB/MODULES paths.

It looks impossible for current situation, we have no defines for the executables that should be stripped. But we could separate functions stripBinary(), extractDebugInfo() and deployBinary() and call them when needed.

Copy link
Collaborator

@henderkes henderkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, but we still need to call extractDebugInfo() on all *.so files in BUILD_LIB_PATH and BUILD_MODULES_PATH.

@henderkes
Copy link
Collaborator

Looks good now, I'll spin it up tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to extract debug infos into <file>.debug file and link it

3 participants