)]}'
{
  "commit": "abbbd4a3e0ca51132e7fb31a43f896d29894dae0",
  "tree": "95373a55ae00731fc4a37d1f361bbd81314a7f5d",
  "parents": [
    "890026e31759ae00c6bbb7eb41b5fe89580a256f"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "andrew.burgess@embecosm.com",
    "time": "Wed Aug 11 13:24:33 2021 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "andrew.burgess@embecosm.com",
    "time": "Tue Sep 28 12:21:22 2021 +0100"
  },
  "message": "gdb: use libbacktrace to create a better backtrace for fatal signals\n\nGDB recently gained the ability to print a backtrace when a fatal\nsignal is encountered.  This backtrace is produced using the backtrace\nand backtrace_symbols_fd API available in glibc.\n\nHowever, in order for this API to actually map addresses to symbol\nnames it is required that the application (GDB) be compiled with\n-rdynamic, which GDB is not by default.\n\nAs a result, the backtrace produced often looks like this:\n\n  Fatal signal: Bus error\n  ----- Backtrace -----\n  ./gdb/gdb[0x80ec00]\n  ./gdb/gdb[0x80ed56]\n  /lib64/libc.so.6(+0x3c6b0)[0x7fc2ce1936b0]\n  /lib64/libc.so.6(__poll+0x4f)[0x7fc2ce24da5f]\n  ./gdb/gdb[0x15495ba]\n  ./gdb/gdb[0x15489b8]\n  ./gdb/gdb[0x9b794d]\n  ./gdb/gdb[0x9b7a6d]\n  ./gdb/gdb[0x9b943b]\n  ./gdb/gdb[0x9b94a1]\n  ./gdb/gdb[0x4175dd]\n  /lib64/libc.so.6(__libc_start_main+0xf3)[0x7fc2ce17e1a3]\n  ./gdb/gdb[0x4174de]\n  ---------------------\n\nThis is OK if you have access to the exact same build of GDB, you can\nmanually map the addresses back to symbols, however, it is next to\nuseless if all you have is a backtrace copied into a bug report.\n\nGCC uses libbacktrace for printing a backtrace when it encounters an\nerror.  In recent commits I added this library into the binutils-gdb\nrepository, and in this commit I allow this library to be used by\nGDB.  Now (when GDB is compiled with debug information) the backtrace\nlooks like this:\n\n  ----- Backtrace -----\n  0x80ee08 gdb_internal_backtrace\n  \t../../src/gdb/event-top.c:989\n  0x80ef0b handle_fatal_signal\n  \t../../src/gdb/event-top.c:1036\n  0x7f24539dd6af ???\n  0x7f2453a97a5f ???\n  0x154976f gdb_wait_for_event\n  \t../../src/gdbsupport/event-loop.cc:613\n  0x1548b6d _Z16gdb_do_one_eventv\n  \t../../src/gdbsupport/event-loop.cc:237\n  0x9b7b02 start_event_loop\n  \t../../src/gdb/main.c:421\n  0x9b7c22 captured_command_loop\n  \t../../src/gdb/main.c:481\n  0x9b95f0 captured_main\n  \t../../src/gdb/main.c:1353\n  0x9b9656 _Z8gdb_mainP18captured_main_args\n  \t../../src/gdb/main.c:1368\n  0x4175ec main\n  \t../../src/gdb/gdb.c:32\n  ---------------------\n\nWhich seems much more useful.\n\nUse of libbacktrace is optional.  If GDB is configured with\n--disable-libbacktrace then the libbacktrace directory will not be\nbuilt, and GDB will not try to use this library.  In this case GDB\nwould try to use the old backtrace and backtrace_symbols_fd API.\n\nAll of the functions related to writing the backtrace of GDB itself\nhave been moved into the new files gdb/by-utils.{c,h}.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "320d3326a8170ea09c94ba51f4b842c4726f360c",
      "old_mode": 33188,
      "old_path": "gdb/Makefile.in",
      "new_id": "5a3bb9522792ef44cbb1042d9b9483d3cf503faf",
      "new_mode": 33188,
      "new_path": "gdb/Makefile.in"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b5e0a0ed004bd3177ab691414201d80428d012b1",
      "new_mode": 33188,
      "new_path": "gdb/bt-utils.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "433aa23614b3c8e218382ec920430e7ebbdbdf34",
      "new_mode": 33188,
      "new_path": "gdb/bt-utils.h"
    },
    {
      "type": "modify",
      "old_id": "af3680c6d9524f99c52e48f1b4c30c57856efe04",
      "old_mode": 33188,
      "old_path": "gdb/config.in",
      "new_id": "c61f7a9135267da5f1356219d1621a38133bf764",
      "new_mode": 33188,
      "new_path": "gdb/config.in"
    },
    {
      "type": "modify",
      "old_id": "f0b1af4a6ea5e303525db8dcea98c45a4ef5b28d",
      "old_mode": 33261,
      "old_path": "gdb/configure",
      "new_id": "7c8335f2576e5ca3a126dab42b0df03d5b1817bf",
      "new_mode": 33261,
      "new_path": "gdb/configure"
    },
    {
      "type": "modify",
      "old_id": "93f11316a142476dbf62f2ee7999f3eb742f07d7",
      "old_mode": 33188,
      "old_path": "gdb/configure.ac",
      "new_id": "0d91be59cd6159fba8c1e961bac231c48055c583",
      "new_mode": 33188,
      "new_path": "gdb/configure.ac"
    },
    {
      "type": "modify",
      "old_id": "9233a3650ac401e2b34637a556f96e8429f8c8ea",
      "old_mode": 33188,
      "old_path": "gdb/event-top.c",
      "new_id": "64c624ce4d746f3e60086e581ae72f7e79a66e6a",
      "new_mode": 33188,
      "new_path": "gdb/event-top.c"
    }
  ]
}
