)]}'
{
  "commit": "6dff2a6ffed01ec1db55d06cfdd747bb2d83aeea",
  "tree": "5e0224e821097717ede8e1fd3ea86caa76e5e4d5",
  "parents": [
    "d65edaa0bc3f24537ecde3735b1fa041f36f4ab8"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu May 19 16:04:26 2022 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu Jul 21 15:19:41 2022 +0100"
  },
  "message": "gdb/arm: move fetch of arm_gdbarch_tdep to a more inner scope\n\nThis is a small refactor to resolve an issue before it becomes a\nproblem in a later commit.\n\nMove the fetching of an arm_gdbarch_tdep into a more inner scope\nwithin two functions in arm-tdep.c.\n\nThe problem with the current code is that the functions in question\nare used as the callbacks for two set/show parameters.  These set/show\nparameters are available no matter the current architecture, but are\nreally about controlling an ARM architecture specific setting.  And\nso, if I build GDB for all targets on an x86-64/GNU-Linux system, I\ncan still do this:\n\n  (gdb) show arm fpu\n  (gdb) show arm abi\n\nAfter these calls we end up in show_fp_model and arm_show_abi\nrespectively, where we unconditionally do this:\n\n  arm_gdbarch_tdep *tdep\n    \u003d (arm_gdbarch_tdep *) gdbarch_tdep (target_gdbarch ());\n\nHowever, the gdbarch_tdep() result will only be a arm_gdbarch_tdep if\nthe current architecture is ARM, otherwise the result will actually be\nof some other type.\n\nThis isn\u0027t actually a problem, as in both cases the use of tdep is\nguarded by a later check that the gdbarch architecture is\nbfd_arch_arm.\n\nThis commit just moves the call to gdbarch_tdep() after the\narchitecture check.\n\nIn a later commit gdbarch_tdep() will be able to spot when we are\ncasting the result to the wrong type, and this function will trigger\nassertion failures if things are not fixed.\n\nThere should be not user visible changes after this commit.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "89c2779bbb5cc8b30a034020c2893c7b877333bb",
      "old_mode": 33188,
      "old_path": "gdb/arm-tdep.c",
      "new_id": "ac49054c0744cb96acd6b8f0116dc1560149f5e5",
      "new_mode": 33188,
      "new_path": "gdb/arm-tdep.c"
    }
  ]
}
