[llvm-bugs] [Bug 28621] New: lldb-mi can't get variables of a frame (-stack-list-* MI-commands) if the thread didn't cause the stop event

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 19 16:01:24 PDT 2016


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

            Bug ID: 28621
           Summary: lldb-mi can't get variables of a frame (-stack-list-*
                    MI-commands) if the thread didn't cause the stop event
           Product: lldb
           Version: 3.9
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: edmunoz at microsoft.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16771
  --> https://llvm.org/bugs/attachment.cgi?id=16771&action=edit
Simple repro

lldb-mi provides a set of commands to list variables from a stack frame,
namely: stack-list-variables -stack-list-arguments and -stack-list-locals.

In a multithreaded process, these commands return a empty list if queried for a
thread that didn't cause the stopped event.

The root cause for this bug is https://llvm.org/bugs/show_bug.cgi?id=15824

lldb-mi checks the stopped reason for the thread being queried through those
commands and returns an empty list if the stopped reason in none or invalid.

This doesn't affect the normal command line interface for lldb (through the
similar command "frame variable") since lldb doesn't have such a strict check
(it just checks that the process is paused and that the frame exists).

In order to fix this bug, lldb-mi should perform the same checks as lldb.

Repro steps:

1. Compile the attached file a.cpp: clang++ -g a.cpp -lpthread
2. Start lldb-mi and execute the following

-file-exec-and-symbols "<path to a.out>"
-break-insert -f on a.cpp:5
-exec-run

After hitting the breakpoint
-stack-list-variables 0 --thread 1 --frame 5
^done,variables=[]

However, going through the non-MI command:

-interpreter-exec console "thread select 1"
-interpreter-exec console "frame select 5"
-interpreter-exec console "frame variable"
(int) argc = 1
(char **) argv = 0x00007fff5fbffee0
(int) x = 3
(int) y = 0
(pthread_t) id = 0x00000001000b6000

The expected result is:
-stack-list-variables 0 --thread 1 --frame 5
^done,variables=[{arg="1",name="argc"},{arg="1",name="argv"},{name="x"},{name="y"},{name="id"}]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160719/2c883ce5/attachment.html>


More information about the llvm-bugs mailing list