In commit ce177a50, I fixed "osv mmap" on newer distros as gdb started requiring quotes around the typename mmu::vma. Unfortunately, these quotes are considered a syntax error on older gdb. So in this patch we try both syntaxes, trying the new one first, and if they it fails, the old one.
Signed-off-by: Nadav Har'El <[email protected]> --- scripts/loader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/loader.py b/scripts/loader.py index b16538c..3a52377 100644 --- a/scripts/loader.py +++ b/scripts/loader.py @@ -245,7 +245,10 @@ def vma_list(node=None): node = intrusive_set_root_node(fpr) if node: - offset = gdb.parse_and_eval("(int)&(('mmu::vma'*)0)->_vma_list_hook") + try: + offset = gdb.parse_and_eval("(int)&(('mmu::vma'*)0)->_vma_list_hook") + except: + offset = gdb.parse_and_eval("(int)&((mmu::vma*)0)->_vma_list_hook") vma = node.cast(gdb.lookup_type('void').pointer()) - offset vma = vma.cast(gdb.lookup_type('mmu::vma').pointer()) -- 2.9.3 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
