[Lldb-commits] [PATCH] D128250: [LLDB][RISCV]Add initial support for lldb-server.
Emmmer S via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sun Jul 10 00:58:30 PDT 2022
Emmmer updated this revision to Diff 443482.
Emmmer added a comment.
This patch change:
- Add the recognition of architecture riscv64 in `HostInfoBase.cpp`
- Add the recognition of architecture riscv64 and riscv32 in `ObjectFilePECOFF.cpp`
- Add riscv's `ebreak` command to `Platform.cpp`
Now lldb can debug with simple executables on `qemu-system-riscv64` and be able to attach to a `gdbserver`.
---
TODO: some unittest failed
bash
[ RUN ] TestBase.LaunchModePreservesEnvironment
/home/emmmer/git/llvm-project/lldb/unittests/tools/lldb-server/tests/LLGSTest.cpp:29: Failure
Value of: llvm::detail::TakeExpected(ClientOr)
Expected: succeeded
Actual: failed (Unable to parse qRegisterInfo: generic)
[ FAILED ] TestBase.LaunchModePreservesEnvironment (662 ms)
[ RUN ] TestBase.vAttachRichError
Connection established.
Launched '/home/emmmer/git/llvm-project/build-cross/tools/lldb/unittests/tools/lldb-server/./environment_check' as process 1553...
lldb-server-local_build
Connection established.
Launched '/home/emmmer/git/llvm-project/build-cross/tools/lldb/unittests/tools/lldb-server/./environment_check' as process 1556...
lldb-server-local_build
/home/emmmer/git/llvm-project/lldb/unittests/tools/lldb-server/tests/LLGSTest.cpp:60: Failure
Value of: llvm::detail::TakeExpected(ClientOr)
Expected: succeeded
Actual: failed (Unable to parse qRegisterInfo: generic)
[ FAILED ] TestBase.vAttachRichError (364 ms)
In riscv, the user-mode process cannot directly take the `pc` register but must obtain the pc state through `auipc`, while the `pc` register is required to exist in the test, so it failed.
---
bash
[ RUN ] DumpDataExtractorTest.Formats
/home/emmmer/git/llvm-project/lldb/unittests/Core/DumpDataExtractorTest.cpp:90: Failure
Expected equality of these values:
expected
Which is: "{-nan -nan nan nan}"
result.GetString()
Which is: "{nan nan nan nan}"
[ FAILED ] DumpDataExtractorTest.Formats (25 ms)
The reason is currently unknown, and further verification is required
---
About buildbot: Unfortunately, as an individual developer, I may not have the ability to maintain a 7*24-hour compile server or even a cluster, but I will do my best to provide some test reports.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128250/new/
https://reviews.llvm.org/D128250
Files:
lldb/source/Host/common/HostInfoBase.cpp
lldb/source/Plugins/ABI/RISCV64/CMakeLists.txt
lldb/source/Plugins/Architecture/CMakeLists.txt
lldb/source/Plugins/Architecture/RISCV32/ArchitectureRISCV32.cpp
lldb/source/Plugins/Architecture/RISCV32/ArchitectureRISCV32.h
lldb/source/Plugins/Architecture/RISCV32/CMakeLists.txt
lldb/source/Plugins/Architecture/RISCV64/ArchitectureRISCV64.cpp
lldb/source/Plugins/Architecture/RISCV64/ArchitectureRISCV64.h
lldb/source/Plugins/Architecture/RISCV64/CMakeLists.txt
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/source/Plugins/Process/Linux/CMakeLists.txt
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
lldb/source/Plugins/Process/Utility/CMakeLists.txt
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h
lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp
lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h
lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
lldb/source/Target/Platform.cpp
lldb/source/Utility/ArchSpec.cpp
lldb/source/Utility/RISCV64_DWARF_Registers.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128250.443482.patch
Type: text/x-patch
Size: 51407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220710/5fe913ee/attachment-0001.bin>
More information about the lldb-commits
mailing list