aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-25 14:25:23 -0700
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-25 14:59:50 -0700
commit150db43e412efba0f95ebde81aabd93e7535b909 (patch)
tree6fedc0eae8d52ef417d7ca3844452c36870f11fc /llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
parent29f363611dd4b9b898230cde60bacf71f9581343 (diff)
downloadllvm-150db43e412efba0f95ebde81aabd93e7535b909.zip
llvm-150db43e412efba0f95ebde81aabd93e7535b909.tar.gz
llvm-150db43e412efba0f95ebde81aabd93e7535b909.tar.bz2
[lldb/Plugin] Sort the ScriptedProcess' thread list before creating threads
With Scripted Processes, in order to create scripted threads, the blueprint provides a dictionary that have each thread index as the key with the respective thread instance as the pair value. In Python, this is fine because a dictionary key can be of any type including integer types: ``` >>> {1: "one", 2: "two", 10: "ten"} {1: 'one', 2: 'two', 10: 'ten'} ``` However, when the python dictionary gets bridged to C++ we convert it to a `StructuredData::Dictionary` that uses a `std::map<ConstString, ObjectSP>` for storage. Because `std::map` is an ordered container and ours uses the `ConstString` type for keys, the thread indices gets converted to strings which makes the dictionary sorted alphabetically, instead of numerically. If the ScriptedProcess has 10 threads or more, it causes thread “10” (and higher) to be after thread “1”, but before thread “2”. In order to solve this, this sorts the thread info dictionary keys numerically, before iterating over them to create ScriptedThreads. rdar://90327854 Differential Revision: https://reviews.llvm.org/D122429 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions