0

I'm not sure if I've been dreaming these past years, but all the time I've used lldb, I've been able to autocomplete source file names when setting breakpoints

(lldb) breakpoint set --file m<TAB>

would autocomplete to

(lldb) breakpoint set --file main.cpp

for instance. Now this does not work anymore. Neither in lldb 3.8.0 on Ubuntu 16.04, nor in lldb 10.0.1 or 12.x on macOS. This renders command-line usage basically impossible if I have to manually copy-paste or type in file names.

What could this be caused by and how do I restore this function?

oarfish
  • 4,116
  • 4
  • 37
  • 66

1 Answers1

0

In one case where it did not work, I had passed -flto compiler flag for Link-Time-Optimization. This removed the ability to autocomplete sources, presumably because info about source files is lost completely.

In another case where I don't have this enabled, there is still no autocompletion. Too bad lldb cannot simply show the known source files like gdb can with info sources.

oarfish
  • 4,116
  • 4
  • 37
  • 66
  • Please file a bug about this (http://bugs.llvm.org) with an example that doesn't work, particularly how you built it. lldb has tests for this functionality which are still passing. And I tried it on a fairly complex project (lldb) with current TOT and the 12.0 Xcode's lldb, and that also worked. Looks like you've found some corner case which it would be good to get fixed. – Jim Ingham Aug 07 '20 at 22:26
  • And if you find `info sources` often useful in gdb, please do file an ER for that feature, or hack it in yourself, it would be pretty straightforward to add. – Jim Ingham Aug 07 '20 at 22:26
  • Update: Now even without `-flto`, I get no filenames. Seems this problem is more random than I thought. – oarfish Aug 14 '20 at 08:40
  • But if you type in the file name correctly, then the breakpoint does get set? – Jim Ingham Aug 14 '20 at 17:07
  • In that case yes. I have not been able to find any consistency. – oarfish Aug 15 '20 at 04:34
  • If you can get something that reproduces, please file it. I don't have any other reports of similar misbehavior. – Jim Ingham Aug 17 '20 at 17:16