)]}'
{
  "commit": "4b2f71e6c67060e2aa0d35652de80fdc1f810ce8",
  "tree": "d30dd4850b674c145a86aa93bcef1b93565a3aa9",
  "parents": [
    "9f9073e5b8f7828a97d6cb1e7a43c6ad1fb40a9b"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed Oct 11 10:30:35 2023 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Oct 16 10:01:22 2023 +0100"
  },
  "message": "gdb: replace architecture_changed with new_architecture observer\n\nThis commit replaces the architecture_changed observer with a\nnew_architecture observer.\n\nCurrently the only user of the architecture_changed observer is the\nPython code, which uses this observer to register the Python unwinder\nwith the architecture.\n\nThe problem is that the architecture_changed observer is triggered\nfrom inferior::set_arch(), which only sees the inferior-wide gdbarch\nvalue.  For targets that use thread-specific architectures, these\nnever trigger the architecture_changed observer, and so never have the\nPython unwinder registered with them.\n\nWhen it comes to unwinding GDB makes use of the frame\u0027s gdbarch, which\nis based on the thread\u0027s regcache gdbarch, which is set in\nget_thread_regcache to the value returned from\ntarget_thread_architecture, which is not always the inferiors gdbarch\nvalue, it might be a thread-specific gdbarch which has not passed\nthrough inferior::set_arch().\n\nThe new_architecture observer will be triggered from\ngdbarch_find_by_info, whenever a new gdbarch is created and\ninitialised.  As GDB caches and reuses gdbarch values, we should\nexpect to see each new architecture trigger the new_architecture\nobserver just once.\n\nAfter this commit, targets that make use of thread-specific\narchitectures should be able to make use of Python unwinders.\n\nAs I don\u0027t have access to a machine that makes use of thread-specific\narchitectures right now, I asked Luis to confirm that an AArch64\ntarget that uses SVE/SME can\u0027t use the Python unwinders in threads\nthat are using a thread-specific architectures, and he confirmed that\nthis is indeed the case, see this discussion:\n\n  https://inbox.sourceware.org/gdb/87wmvsat8i.fsf@redhat.com\n\nTested-By: Lancelot Six \u003clancelot.six@amd.com\u003e\nTested-By: Luis Machado \u003cluis.machado@arm.com\u003e\nReviewed-By: Luis Machado \u003cluis.machado@arm.com\u003e\nApproved-By: Simon Marchi \u003csimon.marchi@efficios.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "60a50ea5b2c7335fadea3b63d4e184a450a5585d",
      "old_mode": 33188,
      "old_path": "gdb/arch-utils.c",
      "new_id": "c64584c5760c298842ca52adc20495a7621d34bd",
      "new_mode": 33188,
      "new_path": "gdb/arch-utils.c"
    },
    {
      "type": "modify",
      "old_id": "efe57cceae3ec1c706c58018b2499461ddb50641",
      "old_mode": 33188,
      "old_path": "gdb/inferior.c",
      "new_id": "1778723863e1eeacc1291923efdeba69c7752823",
      "new_mode": 33188,
      "new_path": "gdb/inferior.c"
    },
    {
      "type": "modify",
      "old_id": "09613b2ddda301e273ac515176a9a2685bd47855",
      "old_mode": 33188,
      "old_path": "gdb/observable.c",
      "new_id": "f2e65b11604d153a98eec0432d1d1f50fc5527f4",
      "new_mode": 33188,
      "new_path": "gdb/observable.c"
    },
    {
      "type": "modify",
      "old_id": "acb05e9b535cd25a0a1e0a85ec37f58859e58885",
      "old_mode": 33188,
      "old_path": "gdb/observable.h",
      "new_id": "a535eedcd38f8bf4f5e0a232e3ab342494c035a7",
      "new_mode": 33188,
      "new_path": "gdb/observable.h"
    },
    {
      "type": "modify",
      "old_id": "f8b142dd52c16e53d7cdd520a3fccc8a607c77b3",
      "old_mode": 33188,
      "old_path": "gdb/python/py-unwind.c",
      "new_id": "ee50c51b531d60e290d42012779ad9343dc90c60",
      "new_mode": 33188,
      "new_path": "gdb/python/py-unwind.c"
    }
  ]
}
