[PATCH] D81319: [Dexter] Add --source-dir-root flag

Tobias Bosch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 11:48:04 PDT 2020


tbosch added a comment.

In D81319#2085647 <https://reviews.llvm.org/D81319#2085647>, @TWeaver wrote:

> Hey and thanks for this!
>
> If I understand this correctly, this patch is trying to solve the problem of source files being moved from the path/dir that they were originally in to a new dir after the binary we pass via --binary has been compiled. This problem occurs because the file in which we store our dexter commands is also the file path associated with the commands. If we move the source file, we change the expectations and these may no longer align with the pre-compiled binary.
>
> Whilst I have no misgivings about the way in which this problem is solved, using a --source-dir option, I am, however, hesitant to condone the implementation being in DebuggerBase. DebuggerBase and the subsequent debuggers' jobs are concerned with exposing debugger features, not with contending with the test environment in which dexter is run.
>
> As such, my preference would be a solution that handles this case lower in the stack, preferably in the Test tool, which is concerned with handling the test environment.
>
> You could potentially do the external_to_debug mapping before passing context to the debugger controller. run the debugger and then remap the debug_to_external locations in the test tool before passing the watch data off to the heuristic scorer.
>
> Please let me know if there's any issues or if you have any concerns yourself.
>
> Thanks again,


First off, thanks for the feedback!

I also wondered where the best place would be for this path mapping. However, I still think DebuggerBase is a good spot as the debuggers currently rely on knowing context.source_files. So whichever tool wants to use the debuggers will also have to fill context.source_files, and therefore also run in the problem of needing to remap paths to the ones used in the compilation unit. Moving this mapping into the test tool would prevent other tools from reusing it.

Also, moving this mapping into the test tool would require to make the source_files be relative paths (to the source_root_dir) before calling the debuggers.
This leads to a future me now needing to remember what kind of path is used where: An absolute file system path (test tool), a path relative to source_root_dir (DebuggerController), or a debug info path (Debugger).

WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81319





More information about the llvm-commits mailing list