<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 - lld's liberal usages of `using namespace ...` seem to confuse LLDB"
   href="https://bugs.llvm.org/show_bug.cgi?id=52553">52553</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld's liberal usages of `using namespace ...` seem to confuse LLDB
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>MachO
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vyng@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>gkm@fb.com, jezreel@gmail.com, llvm-bugs@lists.llvm.org, smeenai@fb.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>(not really a bug - more of a question)

Should we change this? Currently this confuses the debugger and makes it a bit
annoying.

Repro:

lldb -- ld64.lld.darwninnew <... rest of args>

Set a breakpoint anywhere - but for best effect, here:
<a href="https://github.com/llvm/llvm-project/blob/2782cb8da0b3c180fa7c8627cb255a026f3d25a2/lld/MachO/Driver.cpp#L1141">https://github.com/llvm/llvm-project/blob/2782cb8da0b3c180fa7c8627cb255a026f3d25a2/lld/MachO/Driver.cpp#L1141</a>

(ie., right after `symtab` is set)

Try and print `symtab` or `in.got`:

```
(lldb) b Driver.cpp:1139
Breakpoint 1: 3 locations.
(lldb) run
Process 13244 launched:
'/Users/vyng/repo/llvm-project/build_lld/bin/ld64.lld.darwinnew' (x86_64)
Process 13244 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
    frame #0: 0x0000000100a0856f
ld64.lld.darwinnew`lld::macho::link(argsArr=ArrayRef<const char *> @
0x00007ff7bfefeeb0, canExitEarly=true, stdoutOS=0x00000001093b83a8,
stderrOS=0x00000001093b8410) at Driver.cpp:1139:12
   1136 
   1137   config = make<Configuration>();
   1138   symtab = make<SymbolTable>();
-> 1139   target = createTargetInfo(args);
   1140   depTracker =
   1141      
make<DependencyTracker>(args.getLastArgValue(OPT_dependency_info));
   1142   if (errorCount())
Target 0: (ld64.lld.darwinnew) stopped.
(lldb) print symtab
(lld::elf::SymbolTable *) $0 = nullptr
(lldb) print in.got
(lld::elf::GotSection *) $1 = nullptr
(lldb) print lld::macho::in.got
```


Note that LLDB prints the ELF's objects rather than macho's ones!!!</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>