<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - TestHelloWorld can't get a valid callstack after attaching"
   href="https://llvm.org/bugs/show_bug.cgi?id=24600">24600</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>TestHelloWorld can't get a valid callstack after attaching
          </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>normal
          </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>zturner@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>21766
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The log file shows this:

looking at: Stack traces for SBProcess: pid = 832, state = stopped, threads =
2, executable = test_with_dwarf_and_attach_to_process_with_id_api
Stack trace for thread id=0x47c name=None queue=None stop reason=none
  frame #0: 0xffffffffffffffff ntdll.dll`DbgBreakPoint + 1

Stack trace for thread id=0xc68 name=None queue=None stop reason=none
  frame #0: 0x00000077908c2c None`None + -18446744071703589843



Expecting sub string: main.c:30
Not matched

FAIL

It is expecting to see the second thread stopped in main, but it is stopped
somewhere else.  The address looks reasonable, so it is most likely that the
main thread hasn't yet gotten through process initialization yet and it is
still in loader initialization or CRT initialization.

Another possibility is that we just have a bug relating to multiple threads and
the address is totally bogus.


We should fix the test suite to not rely on racy behavior like this by
implementing a cross-platform is_debugger_present() function that all test
inferiors can use so we can synchronize debugger behavior with test suite
behavior, but to fix this completely we will always need to provide a way to
skip the initial breakpoint so that we only hit the user-created breakpoint and
not the loader breakpoint, guaranteeing that the code is in main.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>