This is an archive of the discontinued LLVM Phabricator instance.

[Reproducers] Add more logging capabilities to reproducer instrumentation
ClosedPublic

Authored by JDevlieghere on Feb 22 2019, 5:34 PM.

Details

Summary

Debugging issues with instrumentation capture and replay can be particularly tricky, especially because part of the process takes places even before the debugger is initialized. This patch adds more logging capabilities to these classes, hidden behind a macro define.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

JDevlieghere created this revision.Feb 22 2019, 5:34 PM
aprantl added inline comments.Feb 25 2019, 4:10 PM
lldb/include/lldb/Utility/ReproducerInstrumentation.h
591 ↗(On Diff #188017)

Who defines this macro? I'm asking because it's unusual for LLDB to emit anything on stderr.

The overall idea seems fine to me, though I think it would be better to keep the macros simpler by moving all of the logic into the single Register call. I.e. the Register function would take extra StringRef arguments, which the macros would fill out. Then you could store the computed signature in the (possibly renamed) m_ids map, instead of having two maps with the same set of keys. That should save some space too.

lldb/include/lldb/Utility/ReproducerInstrumentation.h
591 ↗(On Diff #188017)

I'm guessing it's the kind of thing you define by editing the source/cmake config, when you're really desperate to figure out what's going wrong.

Simplify record function

JDevlieghere marked an inline comment as done.Feb 26 2019, 6:25 PM
JDevlieghere added inline comments.
lldb/include/lldb/Utility/ReproducerInstrumentation.h
591 ↗(On Diff #188017)

Correct, see the #define on line 24. I'll comment it out before landing of course.

labath accepted this revision.Feb 27 2019, 5:41 AM
This revision is now accepted and ready to land.Feb 27 2019, 5:41 AM
This revision was automatically updated to reflect the committed changes.