[lldb-dev] [Bug 23248] New: "stopped" notification for the exec-finish GDB/MI command gives the wrong reason

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 16 01:09:20 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23248

            Bug ID: 23248
           Summary: "stopped" notification for the exec-finish GDB/MI
                    command gives the wrong reason
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: vadim.macagon at gmail.com
    Classification: Unclassified

Created attachment 14209
  --> https://llvm.org/bugs/attachment.cgi?id=14209&action=edit
Source for test executable

The -exec-finish MI command is used to step out of the current function (see
<https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html#GDB_002fMI-Program-Execution>).
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 (https://github.com/llvm-mirror/lldb.git
revision 8733ed3778e9787602521c4b1f491d7da6eb5b04 
clang revision 13756eaa7c29673267fd20651a56883335dca123
llvm revision 2c5bf601c34780d431cf652e436ef39030ff9213)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150416/fe3fe7b3/attachment.html>


More information about the lldb-dev mailing list