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 breakpoints/22736] [aarch64] gdb crashes on a conditional breakpoint with cast return type


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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alan Hayward <alahay01@sourceware.org>:

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

commit 38a72da0f1d968432ae6a2a9697ba55932dc075e
Author: Alan Hayward <alan.hayward@arm.com>
Date:   Thu Oct 11 14:47:30 2018 +0100

    Aarch64: Fix segfault when casting dummy calls

    The following will segfault on aarch64 if foo is in another object,
    was compiled as c++ and has no debug symbols:
    (gdb) p (int)foo()

    This is because aarch64_push_dummy_call determines the return type
    of the function and then does not check for null pointer.

    A null pointer for the return type means the call has no debug
    information.  For the code to get here, then the call must have
    been cast, otherwise we'd error out sooner.  In the case of a
    no-debug-info call cast, the return type is the type the user
    had cast the call to, but we do not have that information
    available here.

    However, aarch64_push_dummy_call only requires the return type in
    order to calculate lang_struct_return. This information is available
    in the return_method enum. The fix is to simply use this instead.

    Adds testcase to check calls across objects, with all combinations
    of c, c++, debug and no debug.

    gdb/ChangeLog:

        PR gdb/22736:
        * aarch64-tdep.c (aarch64_push_dummy_call): Remove
        lang_struct_return code.

    gdb/testsuite/ChangeLog:

        PR gdb/22736:
        * gdb.cp/infcall-nodebug-lib.c: New test.
        * gdb.cp/infcall-nodebug-main.c: New test.
        * gdb.cp/infcall-nodebug.exp: New file.

-- 
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]