[Lldb-commits] [PATCH] D12877: [LLDB] Switch to assembly view if source is moved

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 16 17:54:55 PDT 2015


jasonmolenda added a comment.

I chatted with Jim and Greg about this today.  We have a "`stop-disassembly-display`" setting right now.  It can be one of three values:

never: never show assembly
no-source: show assembly when we have no debug information
always: always show assembly

"no-source" is a poor name.  What this really means is "`no-debuginfo`".  I think we should have four values for `stop-disassembly-display`:

never: never show assembly
no-debuginfo: show assembly when we have no debug info
no-source: show assembly when we have no source file
always: always show assembly

and I think the default for `stop-disassembly-display` should be `no-debuginfo`.  This preserves the existing behavior but if users would prefer to see assembly when a source file is missing, they can set it to be "`no-source`" and they will get that behavior.

Mohit, what do you think about this approach?

Jim raised the point that it would be nice if lldb would print the full path of the missing source file when it can't print the source file.  That way, if the user knows the source is available at a different file path, they can add a `target.source-map` remapping and lldb can show the source code.  There is a mechanism for printing a warning one time in Process already, see `Process::PrintWarningOptimization`.  This warning is printed once per Module - you can see that it passes the Module pointer to `PrintWarning`.  We'd want to add a `Process::PrintWarningSourceFileMissing` method and issue it once per source file in a similar way.  Don't feel obligated to do this - it's just something that we should do, unrelated to the changes you're looking at here.  With this change, the first time a user steps into a context where we have debug info but cannot find the source, the user will get a message like

warning: Could not find source file at '/builder/project/subir_a/MySources.cpp'

and the user can be like "Oh yes, of course, it's actually on /archivedbuilds/project/subdir_a on this computer" and do the file remap.


Repository:
  rL LLVM

http://reviews.llvm.org/D12877





More information about the lldb-commits mailing list