[Lldb-commits] [PATCH] D76626: [lldb/Reproducers] Collect files imported by command script import

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 24 01:35:42 PDT 2020


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

This seems fine with a (fairly big) caveat that this approach will not work transitively loaded modules (== if the "command script import"ed module imports another module on its own). Supporting this would be possible, but it would require hooking fairly deep into the module loading mechanism of respective language. In lua, I believe that could be achieved by overriding the builtin `loadfile` function (to save the file when recording, and substitute it during replay). In python, that might be achieved by overriding the `__import__` function to record the module file name and by adjusting the module import mechanism (perhaps via import hooks <https://www.python.org/dev/peps/pep-0302/>) on replay.

However, all of that is going to be fairly tricky code, so I don't think that's needed if you just want to make simple imports work.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76626/new/

https://reviews.llvm.org/D76626





More information about the lldb-commits mailing list