[RFA] Make "bt N" print correct number of frames when using a frame filter

Pedro Alves palves@redhat.com
Tue Jun 27 18:37:00 GMT 2017


On 04/23/2017 05:04 PM, Tom Tromey wrote:
> PR python/16497 notes that using "bt" with a positive argument prints
> the wrong number of frames when a frame filter is in use.  Also, in this
> case, the non-frame-filter path will print a message about "More stack
> frames" when there are more; but this is not done in the frame-filter
> case.
> 
> The first problem is that backtrace_command_1 passes the wrong value
> to apply_ext_lang_frame_filter -- that function takes the final
> frame's number as an argument, but backtrace_command_1 passes the
> count, which is off by one.
> 
> The solution to the second problem is to have the C stack-printing
> code stop at the correct number of frames and then print the message.
> 
> Tested using the buildbot.

Can you expand on the need for the PRINT_MORE_FRAMES flag and
having it based on from_tty?  I assume that your first made
the printing unconditional, but then for some reason decided
against it?

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list