This is an archive of the discontinued LLVM Phabricator instance.

[lldb/API] Add SetDataWithOwnership method to SBData
ClosedPublic

Authored by mib on Dec 13 2021, 10:40 AM.

Details

Summary

This patch introduces a new method to SBData: SetDataWithOwnership.

Instead of referencing the pointer to the data, this method copies the
data buffer into lldb's heap memory.

This can prevent having the underlying DataExtractor object point to
freed/garbage-collected memory.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail