MCPcopy
hub / github.com/DerekSelander/LLDB / getSection

Function getSection

lldb_commands/ds.py:80–114  ·  view source on GitHub ↗
(module=None, name=None)

Source from the content-addressed store, hash-verified

78 return name
79
80def getSection(module=None, name=None):
81 if module is None:
82 path = getTarget().executable.fullpath
83 module = getTarget().module[path]
84
85 if isinstance(module, str):
86 module = getTarget().module[module]
87 if module is None:
88 return None
89
90 if isinstance(module, int):
91 module = getTarget().modules[module]
92 if module is None:
93 return None
94
95 if name is None:
96 return module.sections
97
98 sections = name.split('.')
99 index = 0
100 if len(sections) == 0:
101 return None
102 section = module.FindSection(sections[0])
103 if name == section.name:
104 return section
105 while index < len(sections):
106 name = sections[index]
107 for subsec in section:
108 if sections[index] in subsec.name:
109 section = subsec
110 if sections[-1] in subsec.name:
111 return subsec
112 continue
113 index += 1
114 return None
115
116def create_or_touch_filepath(filepath, contents):
117 file = open(filepath, "w")

Callers

nothing calls this directly

Calls 1

getTargetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…