Skip to content

Instantly share code, notes, and snippets.

@mikolasstuchlik
Created February 8, 2023 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikolasstuchlik/ccb8e85292b02601dc43f70b60ddbcc6 to your computer and use it in GitHub Desktop.
Save mikolasstuchlik/ccb8e85292b02601dc43f70b60ddbcc6 to your computer and use it in GitHub Desktop.
Process 17892 launched: '/home/mikolas/Developer/swift/tools/swift-inspect/.build/debug/swift-inspect' (x86_64)
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30 failed to match regex: no symbols
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/libm.so.6 failed to match regex: 0000000000000000 l df *ABS* 0000000000000000
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/libm.so.6 failed to match regex: 0000000000000000 l df *ABS* 0000000000000000
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/libc.so.6 failed to match regex: 0000000000000000 l df *ABS* 0000000000000000
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/libc.so.6 failed to match regex: 0000000000000000 l df *ABS* 0000000000000000
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 failed to match regex: 0000000000000000 l df *ABS* 0000000000000000
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 failed to match regex: 0000000000000000 l df *ABS* 0000000000000000
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Warning: Symbol for file /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 failed to match regex: no symbols
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Process 17892 stopped and restarted: thread 1 received signal: SIGCHLD
Request [Query Layout]: DataLayoutQueryType(rawValue: 2)
Request [Get address]: name _swift_debug_metadataAllocationIterationEnabled; symbol {StringRegion<LoadedSymbolInfo>(range: "0x00007f81d0e4d9a0..<0x00007f81d0e4d9a1", properties: MemtoolCore.LoadedSymbolInfo(flags: MemtoolCore.SymbolFlags(scopeFlag: MemtoolCore.SymbolScopeFlag.global, weakFlag: MemtoolCore.SymbolWeakFlag.strong, constructorFlag: MemtoolCore.SymbolConstructorFlag.ordianry, warningFlag: MemtoolCore.SymbolWarningFlag.normal, referenceFlag: MemtoolCore.SymbolReferenceFlag.normal, debuggingFlag: MemtoolCore.SymbolDebuggingFlag.normal, typeFlag: MemtoolCore.SymbolTypeFlag.object), segment: MemtoolCore.SymbolSection.known(MemtoolCore.KnownSymbolSection.bss), name: "_swift_debug_metadataAllocationIterationEnabled"))}
Request [Load bytes]: 0x00007f81d0e4d9a0 size 1
Process 17892 stopped
* thread #1, name = 'swift-inspect', stop reason = breakpoint 2.1
frame #0: 0x000055555565a7e9 swift-inspect`closure #1 in static Linux64RemoteProcess.ReadBytes.getter(context=0x5555557afd40, baseAddress=140195532167584, size=1, _3=0x7fffffffd828) at LinuxRemoteProcess.swift:65:19
62 print("Request [Load bytes]: \(baseAddress.hexa) size \(size)")
63 #endif
64 let bytes = UnsafeRawPointer(Cutils.swift_inspect_bridge__ptrace_peekdata(process.process, baseAddress, size))
-> 65 print(bytes)
66 return bytes
67 }
68 }
Target 0: (swift-inspect) stopped.
(lldb) po bytes
warning: Swift error in scratch context: New Swift image added: /home/mikolas/Developer/swift/tools/swift-inspect/.build/debug/swift-inspect. ClangImporter needs to be reinitialized..
Shared Swift state for swift-inspect has developed fatal errors and is being discarded.
REPL definitions and persistent names/types will be lost.
▿ Optional<UnsafeRawPointer>
▿ some : 0x00005555557b4040
- pointerValue : 93824994721856
(lldb) memory write -s 1 0x00005555557b4040 1
(lldb) memory read -c1 -f char 0x00005555557b4040
0x5555557b4040: '\x01'
(lldb) breakpoint disable 2
1 breakpoints disabled.
(lldb) c
Process 17892 resuming
Optional(0x00005555557b4040)
Request [Get address]: name _swift_debug_allocationPoolPointer; symbol {StringRegion<LoadedSymbolInfo>(range: "0x00007f81d0d5a100..<0x00007f81d0d5a108", properties: MemtoolCore.LoadedSymbolInfo(flags: MemtoolCore.SymbolFlags(scopeFlag: MemtoolCore.SymbolScopeFlag.global, weakFlag: MemtoolCore.SymbolWeakFlag.strong, constructorFlag: MemtoolCore.SymbolConstructorFlag.ordianry, warningFlag: MemtoolCore.SymbolWarningFlag.normal, referenceFlag: MemtoolCore.SymbolReferenceFlag.normal, debuggingFlag: MemtoolCore.SymbolDebuggingFlag.normal, typeFlag: MemtoolCore.SymbolTypeFlag.object), segment: MemtoolCore.SymbolSection.known(MemtoolCore.KnownSymbolSection.dataRelRo), name: "_swift_debug_allocationPoolPointer"))}
Request [Load bytes]: 0x00007f81d0d5a100 size 8
Optional(0x0000555555adb760)
Request [Load bytes]: 0x00007f81d0d69ca0 size 16
Optional(0x0000555556212640)
Request [Load bytes]: 0x00007f81d0e5dc80 size 16
Optional(0x000055555587f3c0)
Request [Load bytes]: 0x00007f81d0e5dc80 size 0
Optional(0x00005555557b4820)
Process 17892 exited with status = 0 (0x00000000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment