[Lldb-commits] [PATCH] D83446: [WIP][lldb/Reproducers] Synchronize the command interpreter with asynchronous events
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 8 18:25:16 PDT 2020
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, friss.
Herald added a subscriber: abidh.
Add synchronization for asynchronous events. This fixes an un expected packet during replay when an asynchronous event triggers a GDB packet. Consider the following example:
$ ./bin/lldb --capture
(lldb) gdb-remote 13000
Process 770 stopped
* thread #1, stop reason = signal SIGSTOP
frame #0: 0x0000000105071000 dyld`_dyld_start
(lldb) cont
Process 770 resuming
Process 770 exited with status = 0 (0x00000000)
(lldb) reproducer generate
$ ./bin/lldb --replay /path/to/reproducer
(lldb) gdb-remote 13000
(lldb) cont
Reproducer expected packet: '$jThreadExtendedInfo:{"thread":14341}#01'
Reproducer received packet: 'c'
LLVM ERROR: Encountered unexpected packet during replay
The way the thread state is displayed at the prompt is asynchronous. It reacts to an event, in this case a process state change on connection.
I haven't bothered too much with naming. The same logic should be applicable to other situations that require synchronization.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D83446
Files:
lldb/include/lldb/Core/Debugger.h
lldb/include/lldb/Utility/Reproducer.h
lldb/source/Core/Debugger.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Utility/Reproducer.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83446.276613.patch
Type: text/x-patch
Size: 9785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200709/292fed02/attachment.bin>
More information about the lldb-commits
mailing list