This is an archive of the discontinued LLVM Phabricator instance.

[lldb] ASan history threads SB API
AbandonedPublic

Authored by kubamracek on Sep 3 2014, 11:41 AM.

Details

Reviewers
None
Summary

This patch depends on http://reviews.llvm.org/D4596.

As a continuation of the previous patch that adds a MemoryHistory plugin and implementation for ASan-provided malloc/free stack traces, this patch exposes this into the SB API. In short, these two new methods are added into SBValue:

  • uint32_t SBValue::GetNumMemoryHistoryThreads ();
  • SBThread SBValue::GetMemoryHistoryThreadAtIndex (uint32_t idx);

This corresponds to how we provide objects for which we don't have containers (SBFrame and GetNumFrames + GetFrameAtIndex). Note that exposing ThreadList into a generic SBThreadList container would not be straightforward, because currently ThreadList is not a generic container of threads, but instead holds functionality tied to a process and can currently only be used to hold all threads in a process.

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 13219.Sep 3 2014, 11:41 AM
kubamracek retitled this revision from to [lldb] ASan history threads SB API.
kubamracek updated this object.
kubamracek edited the test plan for this revision. (Show Details)
kubamracek added a subscriber: Unknown Object (MLST).

This looks fine to me - but Jim/Enrico/Greg may want to comment.

One thing I'd change is that you document the SBValue::GetNumMemoryHistoryThreads and SBValue::GetMemoryHistoryThreadAtIndex in include/lldb/API/SBValue.h but not in scripts/Python/interface/SBValue.i. The generated documentation for the SB APIs are all based on the .i file comments -- e.g. when you do "script help (lldb.SBValue)" in lldb, that stuff all comes out of the SBValue.i header.

kubamracek abandoned this revision.Sep 5 2014, 6:34 PM