This is an archive of the discontinued LLVM Phabricator instance.

-thread-info in lldbmi does not conform to protocol. Should end with current thread id
ClosedPublic

Authored by jacdavis on Apr 7 2016, 4:37 PM.

Details

Summary

-thread-info in lldbmi does not conform to protocol. Should end with current thread id as described here: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands

When printing all threads, the current thread id should be printed afterwards.

Example:
-thread-info

^done,threads=[
{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",
   frame={level="0",addr="0xffffe410",func="__kernel_vsyscall",
           args=[]},state="running"},
{id="1",target-id="Thread 0xb7e156b0 (LWP 21254)",
   frame={level="0",addr="0x0804891f",func="foo",
           args=[{name="i",value="10"}],
           file="/tmp/a.c",fullname="/tmp/a.c",line="158"},
           state="running"}],
current-thread-id="1"
(gdb)

Diff Detail

Event Timeline

jacdavis updated this revision to Diff 52977.Apr 7 2016, 4:37 PM
jacdavis retitled this revision from to -thread-info in lldbmi does not conform to protocol. Should end with current thread id.
jacdavis updated this object.
jacdavis added reviewers: lldb-commits, abidh.
zturner added a subscriber: zturner.Apr 7 2016, 4:45 PM

Hi Jackson,

Two suggestions:

  1. Please clang-format the patch. Let me know if you need help getting this working.
  2. use C++11 threads instead of pthreads. This makes the tests portable to Windows. Even if the test still fails on Windows for other reasons, at least it's closer.
jacdavis updated this revision to Diff 52991.Apr 7 2016, 6:15 PM

Updated to use C++ 11 threads. Clang-format tried to format the diff in the llvm style. Since this is all lldb code, is that actually what is expected? None of the braces matched etc....

We have an lldb style file in llvm/tools/lldb, it should be picked up
automatically if you run it from the lldb directory. I'm not sure though if
it's based on the folder you're in when you run clang-format or by
searching up the tree from the target file until it finds a rule file

jacdavis updated this revision to Diff 53028.Apr 8 2016, 8:39 AM

Ran formatting tool with lldb format. pthread linker option is still required for C++11 threads so left it in. New test still disabled for windows.

jacdavis updated this revision to Diff 53031.Apr 8 2016, 8:54 AM

last diff missed lldb-mi changes

zturner accepted this revision.Apr 8 2016, 10:03 AM
zturner added a reviewer: zturner.

Looks fine to me. TBH I haven't seen any of the lldb-mi owners around in months, so I'm not sure if they're still active

This revision is now accepted and ready to land.Apr 8 2016, 10:03 AM
ChuckR closed this revision.Apr 8 2016, 3:25 PM
ChuckR added a subscriber: ChuckR.
abidh edited edge metadata.Apr 13 2016, 4:41 AM

Looks fine to me. TBH I haven't seen any of the lldb-mi owners around in months, so I'm not sure if they're still active

Sorry for late reply. I have been busy lately but keep an eye on lldb-mi patches.