<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 --- - "stopped" notification for the exec-finish GDB/MI command gives the wrong reason"
   href="https://llvm.org/bugs/show_bug.cgi?id=23248">23248</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"stopped" notification for the exec-finish GDB/MI command gives the wrong reason
          </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>Linux
          </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@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vadim.macagon@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14209" name="attach_14209" title="Source for test executable">attachment 14209</a> <a href="attachment.cgi?id=14209&action=edit" title="Source for test executable">[details]</a></span>
Source for test executable

The -exec-finish MI command is used to step out of the current function (see
<<a href="https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution">https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution</a>>).
When this command completes and execution stops GDB sends out:

*stopped,reason="function-finished"...

However the LLDB MI driver sends out:

*stopped,reason="end-stepping-range"...

Furthermore, GDB sends the return value of the function in the notification
(unless the function returns void) while the LLDB MI driver does not. Here's a
sample notification sent out when stepping out of a function that returns an
int.

GDB-MI:
*stopped,reason="function-finished",frame={addr="0x0000000000400828",func="printNextInt",args=[],file="../test/test_target.cpp",fullname="/media/sf_dbgmits/test/test_target.cpp",line="11"},gdb-result-var="$1",return-value="0",thread-id="1",stopped-threads="all",core="0"

LLDB-MI:
*stopped,reason="end-stepping-range",frame={addr="0x0000000000400828",func="printNextInt()",args=[],file="test_target.cpp",fullname="/media/sf_dbgmits/build/../test/test_target.cpp",line="11"},thread-id="1",stopped-threads="all"

I've attached the source file of the program I've used for testing, once built
the above notifications can be obtained by launching LLDB-MI (lldb-mi
--interpreter) or GDB-MI (gdb --interpreter mi) and entering the following
commands:
-file-exec-and-symbols path/to/test_target
-break-insert getNextInt
-exec-run
-exec-finish

GDB: GNU gdb (Ubuntu 7.8-1ubuntu4) 7.8.0.20141001-cvs
LLDB: lldb version 3.7.0 (<a href="https://github.com/llvm-mirror/lldb.git">https://github.com/llvm-mirror/lldb.git</a>
revision 8733ed3778e9787602521c4b1f491d7da6eb5b04 
clang revision 13756eaa7c29673267fd20651a56883335dca123
llvm revision 2c5bf601c34780d431cf652e436ef39030ff9213)</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>