mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-27 10:01:20 +00:00
Tokens: Server side generated tokens.
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.10.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.11.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.9.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / ameba_lint (push) Has been cancelled
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.10.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.11.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.9.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / ameba_lint (push) Has been cancelled
#18
This commit is contained in:
62
crystal_formatters.py
Normal file
62
crystal_formatters.py
Normal file
@@ -0,0 +1,62 @@
|
||||
import lldb
|
||||
|
||||
class CrystalArraySyntheticProvider:
|
||||
def __init__(self, valobj, internal_dict):
|
||||
self.valobj = valobj
|
||||
self.buffer = None
|
||||
self.size = 0
|
||||
|
||||
def update(self):
|
||||
if self.valobj.type.is_pointer:
|
||||
self.valobj = self.valobj.Dereference()
|
||||
self.size = int(self.valobj.child[0].value)
|
||||
self.type = self.valobj.type
|
||||
self.buffer = self.valobj.child[3]
|
||||
|
||||
def num_children(self):
|
||||
size = 0 if self.size is None else self.size
|
||||
return size
|
||||
|
||||
def get_child_index(self, name):
|
||||
try:
|
||||
return int(name.lstrip('[').rstrip(']'))
|
||||
except:
|
||||
return -1
|
||||
|
||||
def get_child_at_index(self,index):
|
||||
if index >= self.size:
|
||||
return None
|
||||
try:
|
||||
elementType = self.buffer.type.GetPointeeType()
|
||||
offset = elementType.size * index
|
||||
return self.buffer.CreateChildAtOffset('[' + str(index) + ']', offset, elementType)
|
||||
except Exception as e:
|
||||
print('Got exception %s' % (str(e)))
|
||||
return None
|
||||
|
||||
def findType(name, module):
|
||||
cachedTypes = module.GetTypes()
|
||||
for idx in range(cachedTypes.GetSize()):
|
||||
type = cachedTypes.GetTypeAtIndex(idx)
|
||||
if type.name == name:
|
||||
return type
|
||||
return None
|
||||
|
||||
|
||||
def CrystalString_SummaryProvider(value, dict):
|
||||
error = lldb.SBError()
|
||||
if value.TypeIsPointerType():
|
||||
value = value.Dereference()
|
||||
process = value.GetTarget().GetProcess()
|
||||
byteSize = int(value.child[0].value)
|
||||
len = int(value.child[1].value)
|
||||
len = byteSize or len
|
||||
strAddr = value.child[2].load_addr
|
||||
val = process.ReadCStringFromMemory(strAddr, len + 1, error)
|
||||
return '"%s"' % val
|
||||
|
||||
|
||||
def __lldb_init_module(debugger, dict):
|
||||
debugger.HandleCommand(r'type synthetic add -l crystal_formatters.CrystalArraySyntheticProvider -x "^Array\(.+\)(\s*\**)?" -w Crystal')
|
||||
debugger.HandleCommand(r'type summary add -F crystal_formatters.CrystalString_SummaryProvider -x "^(String|\(String \| Nil\))(\s*\**)?$" -w Crystal')
|
||||
debugger.HandleCommand(r'type category enable Crystal')
|
||||
Reference in New Issue
Block a user