<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - lldb incorrectly reports multiple symbols when evaluating expressions (on Linux)"
   href="https://bugs.llvm.org/show_bug.cgi?id=35043">35043</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lldb incorrectly reports multiple symbols when evaluating expressions (on Linux)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>davide@freebsd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I think this is a bug in the expression parser/symtab handling, but I can't say
for sure.

given the test in lambdas/main.cpp, after we set a breakpoint on the printf()
and we try to evaluate the lambda, we get:

(lldb) target create "made"
Current executable set to 'made' (x86_64).
(lldb) b main.cpp:14
Breakpoint 1: where = made`main + 32 at main.cpp:14, address =
0x00000000004005f0
(lldb) r
Process 32489 launched:
'/home/davide/work/llvm-lldb/tools/lldb/packages/Python/lldbsuite/test/lang/cpp/lambdas/made'
(x86_64)
Process 32489 stopped
* thread #1, name = 'made', stop reason = breakpoint 1.1
    frame #0: 0x00000000004005f0 made`main(argc=1, argv=0x00007fffffffe128) at
main.cpp:14
   11
   12   int main (int argc, char const *argv[])
   13   {
-> 14       printf("Stop here\n"); //% self.runCmd("expression auto $add =
[](int a, int b) { return a + b; }")
   15                              //% self.expect("expression $add(2,3)",
substrs = ['= 5'])
   16       return 0;
   17   }
(lldb) expression auto $add = [](int a, int b) { return a + b; }
error: Multiple internal symbols found for 'a'
id = {0x000003cf}, range = [0x00007ffff77ec290-0x00007ffff77ec298), name="a"
id = {0x0000051b}, range = [0x00007ffff77ec290-0x00007ffff77ec298), name="a"
id = {0x000000fe}, range = [0x00007ffff77ec290-0x00007ffff77ec298), name="a"

error: Multiple internal symbols found for 'b'
id = {0x0000051a}, range = [0x00007ffff77cfe70-0x00007ffff77cfe78), name="b"
id = {0x000003ce}, range = [0x00007ffff77cfe70-0x00007ffff77cfe78), name="b"
id = {0x000000fd}, range = [0x00007ffff77cfe70-0x00007ffff77cfe78), name="b"


I don't think that's quite right, as `b` is not really redefined, it's just a
temporary binding that we use for the lambda argument.
This requires a little more knowledge of the internals than I currently have,
so hints on where to look would be appreciated.
I can attach the ELF object, if it's helpful</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>