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 gdb/20981] Dynamic library debugging on MacOS X 10.12 (Sierra) and dyld 15 is broken


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

--- Comment #12 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=79b32f4a3a109321cb9a99014293b0ade57535ab

commit 79b32f4a3a109321cb9a99014293b0ade57535ab
Author: Xavier Roirand <roirand@adacore.com>
Date:   Wed Aug 22 12:11:14 2018 +0200

    Darwin: Handle unrelocated dyld.

    On Darwin, debugging an helloworld program with GDB does
    not work and ends with:

      (gdb) set startup-with-shell off
      (gdb) start
      Temporary breakpoint 1 at 0x100000fb4: file /tmp/helloworld.c, line 1.
      Starting program: /private/tmp/helloworld
      [New Thread 0x2703 of process 18906]
      [New Thread 0x2603 of process 18906]

      [1]+  Stopped                 ./gdb/gdb /tmp/helloworld

    When debugging with lldb, instead of having the STOP signal, we can
    see that a breakpoint is not set to a proper location:

      Warning:
      Cannot insert breakpoint -1.
      Cannot access memory at address 0xf726

      Command aborted.

    The inserted breakpoint is the one used when GDB has to stop the target
    when a shared library is loaded or unloaded. The notifier address used
    for adding the breakpoint is wrong thus the above failure.
    This notifier address is an offset relative to dyld base address, so
    the value calculation has to be updated to reflect this.

    This was tested on High Sierra by trying to run a simple "hello world"
    program.

    gdb/ChangeLog:

        PR gdb/20981:
            * solib-darwin.c (darwin_get_dyld_bfd): New function.
            (darwin_solib_get_all_image_info_addr_at_init): Update call.
            (darwin_handle_solib_event): New function.
            (darwin_solib_create_inferior_hook): Handle unrelocated dyld.

    Change-Id: I7dde5008c9158f17b78dc89bd7f4bd8a12d4a6e1

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