This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/16497] "bt" with a count doesn't work properly with frame filters


https://sourceware.org/bugzilla/show_bug.cgi?id=16497

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6893c19a8b81a399953edbf26aaef6e714a7ab0e

commit 6893c19a8b81a399953edbf26aaef6e714a7ab0e
Author: Tom Tromey <tom@tromey.com>
Date:   Mon Jun 20 10:36:29 2016 -0600

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

    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.

    ChangeLog
    2018-02-26  Tom Tromey  <tom@tromey.com>

        PR python/16497:
        * stack.c (backtrace_command_1): Set PRINT_MORE_FRAMES flag.  Fix
        off-by-one in py_end computation.
        * python/py-framefilter.c (gdbpy_apply_frame_filter): Handle
        PRINT_MORE_FRAMES.
        * extension.h (enum frame_filter_flags) <PRINT_MORE_FRAMES>: New
        constant.

    2018-02-26  Tom Tromey  <tom@tromey.com>

        PR python/16497:
        * gdb.python/py-framefilter.exp: Update test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]