Skip to content

Conversation

@satyajanga
Copy link
Contributor

Summary:
For dump debugging (both minidump and coredump), the dump most likely only contains the process memory without real modules so placeholder object files are created for the modules.

LLDB lacks a feature to hydrate/upgrade these dummy modules into real modules. This diff bridges the gap with a new target module replace command.

The new command would replace the place holder object file in target module with input new/real object file and refresh the symbol table/stack. The target module is located with file name matching, users can also specify the target module via "-s" option if the module names differ.

Another change is placeholder modules will have (*) added at the end as hint.

The workflow would be:

  • lldb -c <path_to_dump>
  • image list to see place holder modules
  • download fbpkg and unzip it
  • target module replace <downloaded_fbpkg_module>

Test Plan:
A new unit test is added.
c4crasher end-to-end debugging is tested.
c4crasher testing workflow is documented here: https://www.internalfb.com/intern/wiki/Coredumper/Developer_Guide/Development_Process/

Reviewers: wanyi, #lldb_team

Reviewed By: wanyi

Subscribers: gclayton, #lldb_team

Differential Revision: https://phabricator.intern.facebook.com/D43756670

@github-actions
Copy link

github-actions bot commented Jul 14, 2025

✅ With the latest revision this PR passed the Python code formatter.

@github-actions
Copy link

github-actions bot commented Jul 14, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@satyajanga satyajanga force-pushed the target_replace branch 2 times, most recently from 98e09ae to d6c8504 Compare July 14, 2025 22:52
Summary:
For dump debugging (both minidump and coredump), the dump most likely only contains the process memory without real modules so placeholder object files are created for the modules.

LLDB lacks a feature to hydrate/upgrade these dummy modules into real modules. This diff bridges the gap with a new `target module replace` command.

The new command would replace the place holder object file in target module with input new/real object file and refresh the symbol table/stack. The target module is located with file name matching, users can also specify the target module via "-s" option if the module names differ.

Another change is placeholder modules will have `(*)` added at the end as hint.

The workflow would be:
* lldb -c <path_to_dump>
* `image list` to see place holder modules
* download fbpkg and unzip it
* `target module replace <downloaded_fbpkg_module>`

Test Plan:
A new unit test is added.
c4crasher end-to-end debugging is tested.
c4crasher testing workflow is documented here: https://www.internalfb.com/intern/wiki/Coredumper/Developer_Guide/Development_Process/

Reviewers: wanyi, #lldb_team

Reviewed By: wanyi

Subscribers: gclayton, #lldb_team

Differential Revision: https://phabricator.intern.facebook.com/D43756670
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.

2 participants