-
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:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
Tomasz Grabiec authoredGDB 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:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>