2 import gdbremote_testcase
3 import lldbgdbserverutils
4 from lldbsuite
.support
import seven
5 from lldbsuite
.test
.decorators
import *
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
import lldbutil
10 class TestGdbRemoteModuleInfo(gdbremote_testcase
.GdbRemoteTestCaseBase
):
11 @add_test_categories(["llgs"])
12 def test_module_info(self
):
14 self
.set_inferior_startup_launch()
15 procs
= self
.prep_debug_monitor_and_inferior()
16 self
.add_process_info_collection_packets()
17 context
= self
.expect_gdbremote_sequence()
18 info
= self
.parse_process_info_response(context
)
20 self
.test_sequence
.add_log_lines(
22 "read packet: $jModulesInfo:%s]#00"
26 "file": lldbutil
.append_to_process_working_directory(
29 "triple": seven
.unhexlify(info
["triple"]),
35 "regex": r
"^\$\[{(.*)}\]\]#[0-9A-Fa-f]{2}",
36 "capture": {1: "spec"},
42 context
= self
.expect_gdbremote_sequence()
43 spec
= context
.get("spec")
44 self
.assertRegexpMatches(spec
, '"file_path":".*"')
45 self
.assertRegexpMatches(spec
, '"file_offset":\d+')
46 self
.assertRegexpMatches(spec
, '"file_size":\d+')
47 self
.assertRegexpMatches(spec
, '"triple":"\w*-\w*-.*"')
48 self
.assertRegexpMatches(spec
, '"uuid":"[A-Fa-f0-9]+"')