This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [llgs server] Support creating core dumps on NetBSD
ClosedPublic

Authored by mgorny on Apr 26 2021, 4:52 AM.

Details

Summary

Add a new SaveCore() process method that can be used to request a core
dump. This is currently implemented on NetBSD via the PT_DUMPCORE
ptrace(2) request, and enabled via 'savecore' extension.

Protocol-wise, a new qSaveCore packet is introduced. It accepts zero
or more semicolon-separated key:value options, invokes the core dump
and returns a key:value response. Currently the only option supported
is "path-hint", and the return value contains the "path" actually used.
The support for the feature is exposed via qSaveCore qSupported feature.

Diff Detail

Event Timeline

mgorny requested review of this revision.Apr 26 2021, 4:52 AM
mgorny created this revision.
mgorny updated this revision to Diff 340558.Apr 26 2021, 9:26 AM
mgorny retitled this revision from [lldb] [llgs server] Support creating core dumps on NetBSD [WIP] to [lldb] [llgs server] Support creating core dumps on NetBSD.

Create a temporary file if path-hint is not provided.

mgorny updated this revision to Diff 340560.Apr 26 2021, 9:28 AM

Remove unnecessary const_cast, reformat.

Harbormaster completed remote builds in B100962: Diff 340560.
mgorny updated this revision to Diff 340638.Apr 26 2021, 1:58 PM

Fix missing + in qSupported. Fix known stub features.

mgorny updated this revision to Diff 341138.Apr 28 2021, 4:05 AM

Use a temporary file if path-hint is not writable.

mgorny updated this revision to Diff 370823.Sep 5 2021, 12:51 PM

Rebased.

krytarowski accepted this revision.Sep 6 2021, 2:11 AM

Looks good

This revision is now accepted and ready to land.Sep 6 2021, 2:11 AM
This revision was landed with ongoing or failed builds.Sep 6 2021, 3:16 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 6 2021, 3:16 AM