I am happy with the results of my custom formatter (still need to implement few generic type formatters):
(lldb) p *context->request.headers.hash
(Hash(HTTP::Headers::Key, Array(String) | String)) $7 = {
first = 0
entries = 0x0000000101108d20
indices = 0x0000000000000000
size = 3
deleted_count = 0
indices_bytesize = ‘\x01’
indices_size_pow2 = ‘\x03’
compare_by_identity = false
}
Fix-it applied, fixed expression was:
*context->request->headers.hash
(lldb) p *context->request.headers.hash.entries
(Hash::Entry(HTTP::Headers::Key, Array(String) | String)) $8 = {
hash = 177174889
key = (name = “Host”)
}
Fix-it applied, fixed expression was:
*context->request->headers.hash->entries
(lldb) p *context->request.headers.hash.entries[0]
error: member reference type ‘HTTP::Request *’ is a pointer; did you mean to use ‘->’?
error: member reference type ‘Hash(HTTP::Headers::Key, Array(String) | String) *’ is a pointer; did you mean to use ‘->’?
error: indirection requires pointer operand (‘Hash::Entry(HTTP::Headers::Key, Array(String) | String)’ invalid)
(lldb) p context->request.headers.hash.entries[0]
(Hash::Entry(HTTP::Headers::Key, Array(String) | String)) $9 = {
hash = 177174889
key = (name = “Host”)
}
Fix-it applied, fixed expression was:
context->request->headers.hash->entries[0]
(lldb) p context->request.headers.hash.entries[1]
(Hash::Entry(HTTP::Headers::Key, Array(String) | String)) $10 = {
hash = 2057728823
key = (name = “User-Agent”)
}
Fix-it applied, fixed expression was:
context->request->headers.hash->entries[1]
(lldb) p context->request.headers.hash.entries[2]
(Hash::Entry(HTTP::Headers::Key, Array(String) | String)) $11 = {
hash = 890394483
key = (name = “”)
}
At the same time NativeDebug plugin is not doing any good in displaying structures:
So I am thinking to build my own VS Code DebugAdapter that will be implemented directly inside of LLDB on Python. It will give me maximum flexibility on what to show and what information to extract from debugger.