[lldb-dev] "--fullname" fails to resolve, but "--name" works.

2018-02-11 Thread Michael Witten via lldb-dev
Firstly, here are the characters in our story:

  * lldb

  $ lldb --version
  lldb version 5.0.1

  * clang

  $ p=/path/to/clang
  $ file -L "$p"
  /path/to/clang: ELF 64-bit LSB shared object, x86-64, version 1 
(GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for 
GNU/Linux 3.2.0, BuildID[sha1]=3a2da750e90367b294e4219896738fa9b0a285ad, with 
debug_info, not stripped
  $ "$p" --version
  clang version 7.0.0 (trunk 324807)
  Target: x86_64-unknown-linux-gnu
  Thread model: posix
  InstalledDir: /path/to

Launch "lldb" with the above "clang":

  $ lldb "$p"
  (lldb) target create "/path/to/clang"
  Current executable set to '/path/to/clang' (x86_64).
  (lldb) 

Now, type the following, where "" means that the tab key is pressed
in order to initiate argument completion:

  (lldb) breakpoint set --fullname clang::APValue::isMemberPointerT

After pegging some CPU cores for an appreciable amount of time, and after
loading GiBs of data into RAM, lldb provides the following completion:

  (lldb) breakpoint set --fullname 
clang::APValue::isMemberPointerToDerivedMember()\ const 

Issue the above lldb command (that is, press "") in order to set
a breakpoint that apparently cannot be resolved:

  (lldb) breakpoint set --fullname 
clang::APValue::isMemberPointerToDerivedMember()\ const 
  Breakpoint 1: no locations (pending).
  WARNING:  Unable to resolve breakpoint to any actual locations.

Now, try a plain "--name", which works:

  (lldb) breakpoint set --name isMemberPointerToDerivedMember
  Breakpoint 2: where = clang`clang::APValue::isMemberPointerToDerivedMember() 
const + 12 at APValue.cpp:623, address = 0x05f6931e

Hmmm...
...
...Hmmm...
...
.. WHAT?!

Sincerely,
Michael Witten
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] "print 0" produces "error: expected unqualified-id"

2018-02-12 Thread Michael Witten via lldb-dev
Firstly, here are the characters in our story:

  * lldb

  $ lldb --version
  lldb version 5.0.1

  * clang

  $ p=/path/to/clang
  $ file -L "$p"
  /path/to/clang: ELF 64-bit LSB shared object, x86-64, version 1 
(GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for 
GNU/Linux 3.2.0, BuildID[sha1]=3a2da750e90367b294e4219896738fa9b0a285ad, with 
debug_info, not stripped
  $ "$p" --version
  clang version 7.0.0 (trunk 324807)
  Target: x86_64-unknown-linux-gnu
  Thread model: posix
  InstalledDir: /path/to

Launch "lldb" with the above "clang":

  $ lldb "$p"
  (lldb) target create "/path/to/clang"
  Current executable set to '/path/to/clang' (x86_64).
  (lldb) 

Set a breakpoint:

  (lldb) breakpoint set --name clang::driver::Compilation::ExecuteCommand
  Breakpoint 1: where = 
clang`clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, 
clang::driver::Command const*&) const + 50 at Compilation.cpp:142, address = 
0x034a9a9c

Launch the executable:

  (lldb) process launch -- /dev/null
  Process 18950 launched: '/path/to/clang' (x86_64)
  Process 18950 stopped
  * thread #1, name = 'clang', stop reason = breakpoint 1.1
  frame #0: 0x589fda9c 
clang`clang::driver::Compilation::ExecuteCommand(this=0x5fdd5ec0, 
C=0x5fdae930, FailingCommand=0x7fffcd38) const at 
Compilation.cpp:142
 139
 140  int Compilation::ExecuteCommand(const Command &C,
 141  const Command *&FailingCommand) const 
{
  -> 142if ((getDriver().CCPrintOptions ||
 143 getArgs().hasArg(options::OPT_v)) && 
!getDriver().CCGenDiagnostics) {
 144  raw_ostream *OS = &llvm::errs();
 145

Now, try to print an expression, even a simple constant expression:

  (lldb) print 0
  error: expected unqualified-id

Note that the initial attempt to run the command "print 0" causes an enormous
amount of computing to occur before the error is produced; subsequent attempts
to issue the command produce the error message much more quickly.

Sincerely,
Michael Witten
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev