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

Function getIvars

lldb_commands/ds.py:290–311  ·  view source on GitHub ↗
(section, outputCount)

Source from the content-addressed store, hash-verified

288 return (indeces, symbolList, descriptions)
289
290def getIvars(section, outputCount):
291 target = getTarget()
292 indeces = []
293 stringList = []
294
295 ptrsize = getType("void*").GetByteSize()
296 sz = section.GetByteSize() / ptrsize
297 addr = section.GetLoadAddress(target)
298 script = "int dssize = {};\nuintptr_t *ivarOffsets[{}];\nuintptr_t **ivarPointer = (uintptr_t**){};".format(sz, sz, addr)
299 script += r'''
300memset(&ivarOffsets, 0, sizeof(ivarOffsets));
301for (int i = 0; i < dssize; i++) {
302 ivarOffsets[i] = ivarPointer[i];
303}
304ivarOffsets''&#x27;
305 val = target.EvaluateExpression(script, genExpressionOptions(False, True, True))
306 for i in range(val.GetNumChildren()):
307 x = val.GetChildAtIndex(i)
308 indeces.append(i * ptrsize)
309 stringList.append(hex(x.unsigned))
310
311 return (indeces, stringList)
312
313def getProtocols(section, outputCount):
314 target = getTarget()

Callers 1

formatFromDataFunction · 0.85

Calls 3

getTargetFunction · 0.85
getTypeFunction · 0.85
genExpressionOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…