| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[lldb] Mark most SBAPI methods involving private types as protected or private Many SB classes have public constructors or methods involving types that are private. Some are more obvious (e.g. containing lldb_private in the name) than others (lldb::FooSP is usually std::shared_pointer<lldb_private::Foo>). This commit explicitly does not address FileSP, so I'm leaving that one alone for now. Some of these were for other SB classes to use and should have been made protected/private with a friend class entry added. Some of these were public for some of the swig python helpers to use. I put all of those functions into a class and made them static methods. The relevant SB classes mark that class as a friend so they can access those private/protected members. I've also removed an outdated SBStructuredData test (can you guess which constructor it was using?) and updated the other relevant tests. Differential Revision: https://reviews.llvm.org/D150157 | 3 年前 | |
[lldb] NFC fixes addressing David's feedback David Spickett had several suggestions for https://github.com/llvm/llvm-project/pull/79962 after I'd already merged it. Address those. | 2 年前 | |
Add a unit test for SBBreakpoint::SetCallback (#96001) This commit adds a unit test for SBBreakpoint::SetCallback as it wasn't being tested before. | 2 年前 | |
Reland "[lldb] Parse and display register field enums" (#97258)" (#97270) This reverts commit d9e659c538516036e40330b6a98160cbda4ff100. I could not reproduce the Mac OS ASAN failure locally but I narrowed it down to the test test_many_fields_same_enum. This test shares an enum between x0, which is 64 bit, and cpsr, which is 32 bit. My theory is that when it does register read x0, an enum type is created where the undlerying enumerators are 64 bit, matching the register size. Then it does register read cpsr which used the cached enum type, but this register is 32 bit. This caused lldb to try to read an 8 byte value out of a 4 byte allocation: READ of size 8 at 0x60200014b874 thread T0 <...> =>0x60200014b800: fa fa fd fa fa fa fd fa fa fa fd fa fa fa[04]fa To fix this I've added the register's size in bytes to the constructed enum type's name. This means that x0 uses: __lldb_register_fields_enum_some_enum_8 And cpsr uses: __lldb_register_fields_enum_some_enum_4 If any other registers use this enum and are read, they will use the cached type as long as their size matches, otherwise we make a new type. | 2 年前 | |
Revert "[lldb] Silence narrowing conversion warning with MSVC" This reverts commit cb67dc19256565d15f6bed0e9808f4026ca04995. | 2 年前 | |
[lldb][NFC] Fix more license headers Extra characters and one with an incorrect file name. | 2 年前 | |
Revert "Fix the EditLine unittest build on Darwin after PR 92865" This reverts commit 0380044e16a1c016e001a56c0ca7f4db649a6cae. While I figure out some mysterious CMake error. | 2 年前 | |
【feature】统一优化下载机制,解决UT编译、挂死及失败问题 Co-authored-by: mengguangxin<mgx0018@163.com> # message auto-generated for no-merge-commit merge: !32 merge dev_0301 into master 【feature】统一优化下载机制,解决UT编译、挂死及失败问题 Created-by: mengguangxin Commit-by: mengguangxin Merged-by: ascend-robot Description: ### 1. 修改描述 - **修改原因:** 原有的单元测试代码存在多处问题导致测试无法通过: (1) AscendProcessLinuxTest 中的 AscendProcessLinux 构造函数签名已变更(从 Factory+MainLoop+socket 方式改为 Manager 方式),但测试未同步适配,导致编译失败; (2) SetBreakpoint 测试中 soc_version 使用了 "test" 这一未注册的值,无法通过工厂方法创建 DeviceContext,导致运行时报 "device context is null!" 错误; (3) GDB Remote 相关测试使用 GDBRemoteCommunication::ConnectLocally 进行 TCP 监听连接,在某些环境下不稳定或不可用; (4) TestClient 使用 --reverse-connect + TCP Listen/Accept 方式启动 lldb-server,存在端口竞争和环境兼容性问题; (5) DWARFExpressionTest 的 ReadMemory 方法签名缺少新增的 MemoryReaderParamClient 参数,导致编译失败; (6) NativeProcessTestUtils.h 中的 mock delegate 缺少新增的接口方法声明; (7) UT 运行时缺少 LD_LIBRARY_PATH 环境变量,导致动态库找不到。 (8) 新的依赖下载机制需要各仓统一同步 - **修改方案:** (1) 适配 AscendProcessLinux 新的构造函数接口,将 Factory+MainLoop+socket 替换为 Manager,去除 socket 通信相关的逻辑,改为直接调用 m_parser.ParseMessage 进行消息注入; (2) 新增 FakeDeviceContext 类继承 DeviceContext,重写关键虚方法以绕过真实设备初始化和地址校验,在 SetBreakpoint 测试中直接注入到 process->m_device_context; (3) 在 GDBRemoteTestUtils.h 中新增 ConnectLocallyViaSocketPair 工具函数,使用 socketpair 替代 TCP 监听方式建立本地连接,并将 GDB Remote 测试中的 ConnectLocally 调用统一替换; (4) 重构 TestClient 启动逻辑,使用 socketpair + --fd 参数替代 --reverse-connect + TCP Listen/Accept; (5) 补全 DWARFExpressionTest 中 ReadMemory 方法的新参数; (6) 在 NativeProcessTestUtils.h 的 mock delegate 中补充 SetSingleCoreRunFlag、SetClientDeviceId、ReadDeviceRegisterValueByName、ReadDeviceRegisterList 等新增接口的 mock 声明; (7) 在 lit.cfg.py 中追加 LD_LIBRARY_PATH 环境变量指向构建产物的 lib 目录。 (8) 同步统一依赖下载机制 - **修改内容:** (1) **lldb/unittests/Process/Linux/AscendProcessLinuxTest.cpp**:将 #include "AscendProcessLinux.h" 移至 #define private public 之后以暴露私有成员;删除 NativeProcessFactory 类型别名,新增 FakeDeviceContext 类(实现 Init、ReadGlobalMemory、WriteGlobalMemory、InvalidInstrCache 等方法的桩/mock 逻辑);HandleStubMessage 和 SetBreakpoint 两个测试用例中,将构造函数从 (pid, fd, gdb_server, arch, mainloop, tids, socket) 改为 (pid, fd, gdb_server, arch, manager, tids),去除 socket 读写方式的消息传递,改为直接调用 m_parser.ParseMessage;SetBreakpoint 测试新增 process->m_device_context = std::make_shared<FakeDeviceContext>() 注入,移除不再需要的 CMD_SQ_SEND/CMD_CQ_RECV mock 期望。 (2) **lldb/unittests/tools/lldb-server/tests/TestClient.cpp**:新增 #include <sys/socket.h>;移除 --reverse-connect 参数和 TCP Listen/Accept 逻辑,改用 socketpair 创建 socket 对,通过 --fd= 参数将 server 端 fd 传递给 lldb-server 子进程;使用 AppendDuplicateFileAction 保留 fd 继承;连接建立后关闭 server 端 fd,用 client 端 fd 构造 TCPSocket 作为通信连接;inferior 参数改为通过 SetInferior 方法设置。 (3) **lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.h**:新增 #include <sys/socket.h>、TCPSocket.h、ConnectionFileDescriptorPosix.h;新增 ConnectLocallyViaSocketPair 内联函数,使用 socketpair 创建 Unix 域 socket 对并分别设置为 client/server 的连接。 (4) **lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp、GDBRemoteCommunicationClientTest.cpp、GDBRemoteCommunicationTest.cpp**:将 SetUp 中的 GDBRemoteCommunication::ConnectLocally 替换为 ConnectLocallyViaSocketPair。 (5) **lldb/unittests/Expression/DWARFExpressionTest.cpp**:ReadMemory 方法签名新增 MemoryReaderParamClient param = {} 默认参数,适配上游接口变更。 (6) **lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h**:在 MS_DEBUGGER 宏分支内新增 SetSingleCoreRunFlag、SetClientDeviceId、ReadDeviceRegisterValueByName、ReadDeviceRegisterList 的 MOCK 方法声明,并添加 ReadDeviceRegisterValue(StringRef, uint64_t&) 的转发实现。 (7) **lldb/test/Unit/lit.cfg.py**:新增 LD_LIBRARY_PATH 环境变量配置,将 config.llvm_obj_root/lib 追加到库搜索路径中,确保 UT 运行时能找到动态链接库。 - [ ] **涉及代码双合**(贴上另一个PR链接):无 ---- ### 2. 功能验证 - [ ] **功能自验截图**(请确保不体现个人信息)  - [ ] **冒烟是否通过** 是 ---- ### 3. 代码检视 - **要求:** - 合入功能代码大于 200 行,需要sig会议申报代码检视议题,并在PR中标注会议。 - committer评估是否需要在sig会议进行代码检视。 - 参与检视的committer人员名单与检视时间。 - 大于 1000 行代码原则上不允许合入,需进行备案。 - [ ] **是否经过代码检视** 是 - [ ] **是否具备UT测试用例看护** 是 - [ ] **是否需要在sig会议中进行代码检视** 否 - **检视committer人员名单与检视时间:** ---- ### 4. 资料修改自检 - **资料修改:** 不涉及 ---- See merge request: Ascend/msdebug!32 | 5 个月前 | |
[lldb] Adds additional fields to ProcessInfo (#91544) To implement SaveCore for elf binaries we need to populate some additional fields in the prpsinfo struct. Those fields are the nice value of the process whose core is to be taken as well as a boolean flag indicating whether or not that process is a zombie. This commit adds those as well as tests to ensure that the values are consistent with expectations | 2 年前 | |
[lldb] Fix typo in LoongArch unittest | 3 年前 | |
[lldb] Add/change options in statistics dump to control what sections are dumped (#95075) # Added/changed options The following options are **added** to the statistics dump command: * --targets=bool: Boolean. Dumps the targets section. * --modules=bool: Boolean. Dumps the modules section. When both options are given, the field moduleIdentifiers will be dumped for each target in the targets section. The following options are **changed**: * --transcript=bool: Changed to a boolean. Dumps the transcript section. # Behavior of statistics dump with various options The behavior is **backward compatible**: - When no options are provided, statistics dump dumps all sections. - When --summary is provided, only dumps the summary info. **New** behavior: - --targets=bool, --modules=bool, --transcript=bool overrides the above "default". For **example**: - statistics dump --modules=false dumps summary + targets + transcript. No modules. - statistics dump --summary --targets=true --transcript=true dumps summary + targets (in summary mode) + transcript. # Added options into public API In SBStatisticsOptions, add: * Set/GetIncludeTargets * Set/GetIncludeModules * Set/GetIncludeTranscript **Alternative considered**: Thought about adding Set/GetIncludeSections(string sections_spec), which receives a comma-separated list of section names to be included ("targets", "modules", "transcript"). The **benefit** of this approach is that the API is more future-proof when it comes to possible adding/changing of section names. **However**, I feel the section names are likely to remain unchanged for a while - it's not like we plan to make big changes to the output of statistics dump any time soon. The **downsides** of this approach are: 1\ the readability of the API is worse (requires reading doc to understand what string can be accepted), 2\ string input are more prone to human error (e.g. typo "target" instead of expected "targets"). # Tests bin/llvm-lit -sv ../external/llvm-project/lldb/test/API/commands/statistics/basic/TestStats.py ./tools/lldb/unittests/Interpreter/InterpreterTests New test cases have been added to verify: * Different sections are dumped/not dumped when different StatisticsOptions are given through command line (CLI or HandleCommand; see test_sections_existence_through_command) or API (see test_sections_existence_through_api). * The order in which the options are given in command line does not matter (see test_order_of_options_do_not_matter). --------- Co-authored-by: Roy Shi <royshi@meta.com> | 2 年前 | |
[unittest] Fix HighlighterTest.cpp after D151683 :: is now parsed as tok::coloncolon even in C mode. | 2 年前 | |
[lldb] Fix -Wsign-compare in TestSectionSize.cpp (NFC) In file included from /data/workspace/llvm-project/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp:10: /data/workspace/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1620:28: error: comparison of integers of different signs: 'c onst unsigned long' and 'const int' [-Werror,-Wsign-compare] GTEST_IMPL_CMP_HELPER_(NE, !=); ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ | 2 年前 | |
[lldb][Android] Add platform.plugin.remote-android.package-name When LLDB fails to pull file from a package directory due to security constraint, user needs to set the package name to 'platform.plugin.remote-android.package-name' property to run shell commands as the package user. (e.g. to get file with 'cat' and 'dd'). https://cs.android.com/android/platform/superproject/+/master: system/core/run-as/run-as.cpp;l=39-61; drc=4a77a84a55522a3b122f9c63ef0d0b8a6a131627 Differential Revision: https://reviews.llvm.org/D152933 | 3 年前 | |
[bugfix] 传递虚拟device_id至DeviceContext用于AclrtSetDeviceWrapper Co-authored-by: wiyr0<wangyixian3@huawei.com> # message auto-generated for no-merge-commit merge: !205 merge feature/pass-virtual-device-id-to-devicecontext into master [bugfix] 传递虚拟device_id至DeviceContext用于AclrtSetDeviceWrapper Created-by: wiyr0 Commit-by: wiyr0 Merged-by: ascend-robot Description: ### 1. 修改描述 - **修改原因:** Ascend950DTDeviceContext::Init() 中调用 g_aclWrapper.AclrtSetDeviceWrapper(m_device_id)(Ascend950DeviceContext.cpp:679),其中 m_device_id 是物理 device_id,ConvertToVisibleDeviceId 转换后的可见/物理 ID)。但 AclrtSetDeviceWrapper 底层调用 aclrtSetDevice,该接口需要的是虚拟(逻辑)device_id(即用户程序调用 rtSetDevice/aclrtSetDevice 时传入的原始逻辑 ID)。当设置了 ASCEND_RT_VISIBLE_DEVICES 环境变量时,物理 ID 与逻辑 ID 不一致,导致 lldb-server 侧 aclrtSetDevice 设置了错误的设备,引发调试异常。 - **修改方案:** 虚拟 device_id 可通过 GetDeviceId(&deviceId)(调用 rtGetDevice)获取。在 LD_PRELOAD 桩侧获取该值,经 IPC 消息传递到 lldb-server 侧的 AscendProcessLinux,最终在构造DeviceContext 时传入,Init() 中改用虚拟 ID 调用 AclrtSetDeviceWrapper。 原有 m_device_id(物理 ID)保持不变,仍用于 driver ioctl(CMD_DEV_REGISTER 等)及设备匹配(IsDeviceIdMatched)。 - **修改内容:** 1. 桩侧(LD_PRELOAD)— 生成并传递虚拟 device_id - runtime_stub.h:SendDeviceInfo 声明新增 int32_t virtual_device_id 入参 - runtime_stub.cpp: - SendDeviceInfo:将 virtual_device_id 序列化为 virtual_device_id:<id>; 加入 IPC 消息 - SetDevicePost:调用 GetDeviceId(rtGetDevice)获取虚拟 ID,传入 SendDeviceInfo - aclrt_stub.cpp: - SetDevicePost:调用 aclrtGetDeviceImpl 获取虚拟 ID,传入 SendDeviceInfo 2. IPC 消息定义与解析 - MessageDefines.h:DeviceInfoMsg 新增 int32_t virtual_device_id 字段 - AscendCommunicationServer.cpp:DeviceHandler::Parse 正则更新为 device_id:(\d+);virtual_device_id:(\d+);tgid:(\d+);soc_version:([^;]+);,解析新字段 3. lldb-server 侧 — 全链路透传 - AscendProcessLinux.h/.cpp:InitDeviceContext 新增 virtual_device_id 参数;HandleStubDeviceInfo 从 DeviceInfoMsg 取值传入 - DeviceContext.h/.cpp: - Factory::GetDeviceContext 新增 virtual_device_id 参数 - 构造函数新增 virtual_device_id 参数,存入 m_virtual_device_id 成员 - 所有 DeviceContext 子类(Ascend950/950DT/910B/310P)构造函数同步更新 4. 核心修复 - Ascend950DeviceContext.cpp:679:AclrtSetDeviceWrapper(m_device_id) → AclrtSetDeviceWrapper(m_virtual_device_id),相关日志/错误信息同步更新 - [ ] **涉及代码双合**(贴上另一个PR链接): ---- ### 2. 功能验证 - [ ] **功能自验截图**(请确保不体现个人信息) - [ ] **冒烟是否通过**  ---- ### 3. 代码检视 - **要求:** - 合入功能代码大于 200 行,需要sig会议申报代码检视议题,并在PR中标注会议。 - committer评估是否需要在sig会议进行代码检视。 - 参与检视的committer人员名单与检视时间。 - 大于 1000 行代码原则上不允许合入,需进行备案。 - [ ] **是否经过代码检视** - [ ] **是否具备UT测试用例看护** - [ ] **是否需要在sig会议中进行代码检视** - **检视committer人员名单与检视时间:** ---- ### 4. 资料修改自检 - **资料修改:** ---- See merge request: Ascend/msdebug!205 | 19 天前 | |
Add the ability for Script based commands to specify their "repeat command" (#94823) Among other things, returning an empty string as the repeat command disables auto-repeat, which can be useful for state-changing commands. There's one remaining refinement to this setup, which is that for parsed script commands, it should be possible to change an option value, or add a new option value that wasn't originally specified, then ask lldb "make this back into a command string". That would make doing fancy things with repeat commands easier. That capability isn't present in the lldb_private side either, however. So that's for a next iteration. I haven't added this to the docs on adding commands yet. I wanted to make sure this was an acceptable approach before I spend the time to do that. | 2 年前 | |
[lldb][NFCI] Change return type of UnixSignals::GetSignalInfo There's no reason for GetSignalInfo to return the signal name. All users of this method only use the return value to determine if the method succeeded in filling in the output parameters, so let's explicitly make it a bool instead of a pointer. Differential Revision: https://reviews.llvm.org/D158457 | 2 年前 | |
[lldb] Merge CompilerContextKind::{Class,Struct} (#96145) Our dwarf parsing code treats structures and classes as interchangable. CompilerContextKind is used when looking DIEs for types. This makes sure we always they're treated the same way. See also [#95905#discussion_r1645686628](https://github.com/llvm/llvm-project/pull/95905#discussion_r1645686628). | 2 年前 | |
[lldb] Merge CompilerContextKind::{Class,Struct} (#96145) Our dwarf parsing code treats structures and classes as interchangable. CompilerContextKind is used when looking DIEs for types. This makes sure we always they're treated the same way. See also [#95905#discussion_r1645686628](https://github.com/llvm/llvm-project/pull/95905#discussion_r1645686628). | 2 年前 | |
[lldb] Unify Platform::ResolveExecutable (#96256) The Platform class currently has two functions to resolve an executable: ResolveExecutable and ResolveRemoteExecutable. The former strictly deals with local files while the latter can handle potentially remote files. I couldn't figure out why the distinction matters, at the latter is a super-set of the former. To make things even more confusion, we had a similar but not identical implementation in RemoteAwarePlatform where its implementation of ResolveExecutable could handle remote files. To top it all off, we had copy-pasted implementation, dead code included in PlatformAppleSimulator and PlatformRemoteDarwinDevice. I went ahead and unified all the different implementation on the original ResolveRemoteExecutable implementation. As far as I can tell, it should work for every other platform, and the test suite (on macOS) seems to agree with me, except for a small wording change. | 2 年前 | |
[feature] support simd_vf breakpoints Co-authored-by: wangyixian<wangyixian3@huawei.com> # message auto-generated for no-merge-commit merge: !104 merge support_simd_vf into master [feature] support simd_vf breakpoints Created-by: wiyr0 Commit-by: wangyixian Merged-by: ascend-robot Description: ### 1. 修改描述 - **修改原因:** 1. simd_vf上读pc时,只能读到后18位,需要支持完整的pc获取 2. 该算子运行时,kernel所在的内存为只读内存,不支持设置断点 - **修改方案:** 1. 唯一的办法就是,先拿到vf start pc,然后取高30bit和低18bit拼接。这里有个假设就是用户的simd_vf大小不会超过2^18字节,超过的话,算子本身性能会极差。vf start pc需要解析call vf的指令,比如VF, VFI之类的指令,然后计算call的目标pc即vf的start pc 2. 在获取kernel的start pc之后,用halMemAdvise接口修改这段内存为可写内存。 - **修改内容:** 1. 新增InstructionMatcher类,用于匹配vf call的指令,并且需要创建一个callback函数,当该指令的内部断点触发时,callback函数计算出vf start pc ,发送给server侧。 2. lldb-server侧每次只用最新更新的vf start pc去修改simd_vf场景下的pc值 3. runtime_stub, acl_stub,引入halMemAdvise和rtMemGetAdressRange,用于获取mem大小并设置内存可写。 - [ ] **涉及代码双合**(贴上另一个PR链接): ---- ### 2. 功能验证 - [ ] **功能自验截图**(请确保不体现个人信息)  - [ ] **冒烟是否通过**  ---- ### 3. 代码检视 - **要求:** - 合入功能代码大于 200 行,需要sig会议申报代码检视议题,并在PR中标注会议。 - committer评估是否需要在sig会议进行代码检视。 - 参与检视的committer人员名单与检视时间。 - 大于 1000 行代码原则上不允许合入,需进行备案。 - [x] **是否经过代码检视** - [x] **是否具备UT测试用例看护** - [ ] **是否需要在sig会议中进行代码检视** - **检视committer人员名单与检视时间:** ---- ### 4. 资料修改自检 - **资料修改:** ---- See merge request: Ascend/msdebug!104 | 3 个月前 | |
[lldb][NFC] Fix compilation issue on windows (#76453) | 2 年前 | |
[lldb] Add a test for lea_rsp_pattern_p to x86 unwinder (NFC) (#94852) This commit adds a test for lea_rsp_pattern_p which was previously due as FIXME. | 2 年前 | |
[lldb] Make Broadcaster mutexes non-recursive (#97400) Non-recursive mutexes encourage better locking discipline and avoid bugs like #96750, where one can unexpectedly re-enter the critical section on the same thread, and interrupt a presumed-indivisible operation. In this case, the only needed fix was to remove locking from some BroadcastManager functions, which were only called from the Listener class (and the listener already locked those mutexes to preserve lock ordering). While doing that, I noticed we don't have unit tests for these functions, so I added one. | 2 年前 | |
Reland "[lldb] Print empty enums as if they were unrecognised normal enums (#97553)" This reverts commit 927def49728371d746476e79a6570cd93a4d335c. I've refactored the tests so that we're explicit about whether the enum is signed or not. Which means we use the proper types throughout. | 2 年前 | |
[lldb] [unittests] Fix TcpListen() call in RNBSocketTest | 4 年前 | |
【feature】统一优化下载机制,解决UT编译、挂死及失败问题 Co-authored-by: mengguangxin<mgx0018@163.com> # message auto-generated for no-merge-commit merge: !32 merge dev_0301 into master 【feature】统一优化下载机制,解决UT编译、挂死及失败问题 Created-by: mengguangxin Commit-by: mengguangxin Merged-by: ascend-robot Description: ### 1. 修改描述 - **修改原因:** 原有的单元测试代码存在多处问题导致测试无法通过: (1) AscendProcessLinuxTest 中的 AscendProcessLinux 构造函数签名已变更(从 Factory+MainLoop+socket 方式改为 Manager 方式),但测试未同步适配,导致编译失败; (2) SetBreakpoint 测试中 soc_version 使用了 "test" 这一未注册的值,无法通过工厂方法创建 DeviceContext,导致运行时报 "device context is null!" 错误; (3) GDB Remote 相关测试使用 GDBRemoteCommunication::ConnectLocally 进行 TCP 监听连接,在某些环境下不稳定或不可用; (4) TestClient 使用 --reverse-connect + TCP Listen/Accept 方式启动 lldb-server,存在端口竞争和环境兼容性问题; (5) DWARFExpressionTest 的 ReadMemory 方法签名缺少新增的 MemoryReaderParamClient 参数,导致编译失败; (6) NativeProcessTestUtils.h 中的 mock delegate 缺少新增的接口方法声明; (7) UT 运行时缺少 LD_LIBRARY_PATH 环境变量,导致动态库找不到。 (8) 新的依赖下载机制需要各仓统一同步 - **修改方案:** (1) 适配 AscendProcessLinux 新的构造函数接口,将 Factory+MainLoop+socket 替换为 Manager,去除 socket 通信相关的逻辑,改为直接调用 m_parser.ParseMessage 进行消息注入; (2) 新增 FakeDeviceContext 类继承 DeviceContext,重写关键虚方法以绕过真实设备初始化和地址校验,在 SetBreakpoint 测试中直接注入到 process->m_device_context; (3) 在 GDBRemoteTestUtils.h 中新增 ConnectLocallyViaSocketPair 工具函数,使用 socketpair 替代 TCP 监听方式建立本地连接,并将 GDB Remote 测试中的 ConnectLocally 调用统一替换; (4) 重构 TestClient 启动逻辑,使用 socketpair + --fd 参数替代 --reverse-connect + TCP Listen/Accept; (5) 补全 DWARFExpressionTest 中 ReadMemory 方法的新参数; (6) 在 NativeProcessTestUtils.h 的 mock delegate 中补充 SetSingleCoreRunFlag、SetClientDeviceId、ReadDeviceRegisterValueByName、ReadDeviceRegisterList 等新增接口的 mock 声明; (7) 在 lit.cfg.py 中追加 LD_LIBRARY_PATH 环境变量指向构建产物的 lib 目录。 (8) 同步统一依赖下载机制 - **修改内容:** (1) **lldb/unittests/Process/Linux/AscendProcessLinuxTest.cpp**:将 #include "AscendProcessLinux.h" 移至 #define private public 之后以暴露私有成员;删除 NativeProcessFactory 类型别名,新增 FakeDeviceContext 类(实现 Init、ReadGlobalMemory、WriteGlobalMemory、InvalidInstrCache 等方法的桩/mock 逻辑);HandleStubMessage 和 SetBreakpoint 两个测试用例中,将构造函数从 (pid, fd, gdb_server, arch, mainloop, tids, socket) 改为 (pid, fd, gdb_server, arch, manager, tids),去除 socket 读写方式的消息传递,改为直接调用 m_parser.ParseMessage;SetBreakpoint 测试新增 process->m_device_context = std::make_shared<FakeDeviceContext>() 注入,移除不再需要的 CMD_SQ_SEND/CMD_CQ_RECV mock 期望。 (2) **lldb/unittests/tools/lldb-server/tests/TestClient.cpp**:新增 #include <sys/socket.h>;移除 --reverse-connect 参数和 TCP Listen/Accept 逻辑,改用 socketpair 创建 socket 对,通过 --fd= 参数将 server 端 fd 传递给 lldb-server 子进程;使用 AppendDuplicateFileAction 保留 fd 继承;连接建立后关闭 server 端 fd,用 client 端 fd 构造 TCPSocket 作为通信连接;inferior 参数改为通过 SetInferior 方法设置。 (3) **lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.h**:新增 #include <sys/socket.h>、TCPSocket.h、ConnectionFileDescriptorPosix.h;新增 ConnectLocallyViaSocketPair 内联函数,使用 socketpair 创建 Unix 域 socket 对并分别设置为 client/server 的连接。 (4) **lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp、GDBRemoteCommunicationClientTest.cpp、GDBRemoteCommunicationTest.cpp**:将 SetUp 中的 GDBRemoteCommunication::ConnectLocally 替换为 ConnectLocallyViaSocketPair。 (5) **lldb/unittests/Expression/DWARFExpressionTest.cpp**:ReadMemory 方法签名新增 MemoryReaderParamClient param = {} 默认参数,适配上游接口变更。 (6) **lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h**:在 MS_DEBUGGER 宏分支内新增 SetSingleCoreRunFlag、SetClientDeviceId、ReadDeviceRegisterValueByName、ReadDeviceRegisterList 的 MOCK 方法声明,并添加 ReadDeviceRegisterValue(StringRef, uint64_t&) 的转发实现。 (7) **lldb/test/Unit/lit.cfg.py**:新增 LD_LIBRARY_PATH 环境变量配置,将 config.llvm_obj_root/lib 追加到库搜索路径中,确保 UT 运行时能找到动态链接库。 - [ ] **涉及代码双合**(贴上另一个PR链接):无 ---- ### 2. 功能验证 - [ ] **功能自验截图**(请确保不体现个人信息)  - [ ] **冒烟是否通过** 是 ---- ### 3. 代码检视 - **要求:** - 合入功能代码大于 200 行,需要sig会议申报代码检视议题,并在PR中标注会议。 - committer评估是否需要在sig会议进行代码检视。 - 参与检视的committer人员名单与检视时间。 - 大于 1000 行代码原则上不允许合入,需进行备案。 - [ ] **是否经过代码检视** 是 - [ ] **是否具备UT测试用例看护** 是 - [ ] **是否需要在sig会议中进行代码检视** 否 - **检视committer人员名单与检视时间:** ---- ### 4. 资料修改自检 - **资料修改:** 不涉及 ---- See merge request: Ascend/msdebug!32 | 5 个月前 | |
Add a unit test for SBBreakpoint::SetCallback (#96001) This commit adds a unit test for SBBreakpoint::SetCallback as it wasn't being tested before. | 2 年前 | |
[lldb] Update header guards to be consistent and compliant with LLVM (NFC) LLDB has a few different styles of header guards and they're not very consistent because things get moved around or copy/pasted. This patch unifies the header guards across LLDB and converts everything to match LLVM's style. Differential revision: https://reviews.llvm.org/D74743 | 6 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 5 个月前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 19 天前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 个月前 | ||
| 2 年前 | ||
| 6 年前 |