<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:nisargjhaveri@gmail.com" title="Nisarg Jhaveri <nisargjhaveri@gmail.com>"> <span class="fn">Nisarg Jhaveri</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [Python API] Process state "unloaded" even after successfully connecting to debugserver."
   href="https://bugs.llvm.org/show_bug.cgi?id=50269">bug 50269</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [Python API] Process state "unloaded" even after successfully connecting to debugserver."
   href="https://bugs.llvm.org/show_bug.cgi?id=50269#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [Python API] Process state "unloaded" even after successfully connecting to debugserver."
   href="https://bugs.llvm.org/show_bug.cgi?id=50269">bug 50269</a>
              from <span class="vcard"><a class="email" href="mailto:nisargjhaveri@gmail.com" title="Nisarg Jhaveri <nisargjhaveri@gmail.com>"> <span class="fn">Nisarg Jhaveri</span></a>
</span></b>
        <pre>#1 worked. If I handle the events just after running `process connect ...` and
before `process launch`, it successfully updates the process state to connected
and launches correctly.

#2 still didn't work. Even with `debugger.SetAsync(False)`, it was showing the
same behaviour.

I remember looking at SBDebugger.HandleCommand source code and looks like it is
the one that handles events when async mode is off. So, I tried the following
and it worked.

<span class="quote">>    debugger.SetAsync(False);
>    for command in commands: debugger.HandleCommand(command)
>    debugger.SetAsync(True);</span >

Looks like there is some difference in behaviour between
`SBDebugger.HandleCommand` and `SBCommandInterpreter.HandleCommand`.

Though, thanks a lot for pointing out that we need to consume the events for it
to work. This solves my issue for now.</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>