Skip to content
Snippets Groups Projects
  • Tomasz Grabiec's avatar
    82cd0548
    loader.py: Skip inlined frames in 'osv info threads' · 82cd0548
    Tomasz Grabiec authored
    
    GDB python API does not handle inlined functions as nicely as regular
    'backtrace' command does. Part of the frame attributes point to
    the inlined function (variables, symtab) and part point to the caller.
    
    For example frame.function() returns the nearest non-inlined function.
    
    This breaks code which prints thread joining information.
    The code thinks it's in "sched::thread::join()" when actually it's in
    sched::schedule() context which does not have 'this' variable.
    
    This solution skips inlined functions when considering print
    candidates.  The printed information would be confusing anyway: file
    and line number would be of the inlined function but printed function
    name would belong to the caller. Finally we will reach the non-inlined
    caller and print the call site properly.
    
    Fixes #124.
    
    Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
    Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
    82cd0548
    History
    loader.py: Skip inlined frames in 'osv info threads'
    Tomasz Grabiec authored
    
    GDB python API does not handle inlined functions as nicely as regular
    'backtrace' command does. Part of the frame attributes point to
    the inlined function (variables, symtab) and part point to the caller.
    
    For example frame.function() returns the nearest non-inlined function.
    
    This breaks code which prints thread joining information.
    The code thinks it's in "sched::thread::join()" when actually it's in
    sched::schedule() context which does not have 'this' variable.
    
    This solution skips inlined functions when considering print
    candidates.  The printed information would be confusing anyway: file
    and line number would be of the inlined function but printed function
    name would belong to the caller. Finally we will reach the non-inlined
    caller and print the call site properly.
    
    Fixes #124.
    
    Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
    Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>