)]}'
{
  "commit": "52abb4de08e2ccbfd4dfafd13c200ec7b4db97cc",
  "tree": "4fee890af5e6c36797ed9b07d19927978bffa17a",
  "parents": [
    "6dff2a6ffed01ec1db55d06cfdd747bb2d83aeea"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu May 19 16:13:43 2022 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu Jul 21 15:19:41 2022 +0100"
  },
  "message": "gdb/mips: rewrite show_mask_address\n\nThis commit is similar to the previous commit, but in this case GDB is\nactually relying on undefined behaviour.\n\nConsider building GDB for all targets on x86-64/GNU-Linux, then doing\nthis:\n\n  (gdb) show mips mask-address\n  Zeroing of upper 32 bits of 64-bit addresses is auto.\n  The 32 bit address mask is set automatically.  Currently disabled\n  (gdb)\n\nThe \u0027show mips mask-address\u0027 command ends up in show_mask_address in\nmips-tdep.c, and this function does this:\n\n  mips_gdbarch_tdep *tdep\n    \u003d (mips_gdbarch_tdep *) gdbarch_tdep (target_gdbarch ());\n\nLater we might pass TDEP to mips_mask_address_p.  However, in my\nexample above, on an x86-64 native target, the current target\narchitecture will be an x86-64 gdbarch, and the tdep field within the\ngdbarch will be of type i386_gdbarch_tdep, not of type\nmips_gdbarch_tdep, as a result the cast above was incorrect, and TDEP\nis not pointing at what it thinks it is.\n\nI also think the current output is a little confusing, we appear to\nhave two lines that show the same information, but using different\nwords.\n\nThe first line comes from calling deprecated_show_value_hack, while\nthe second line is printed directly from show_mask_address.  However,\nboth of these lines are printing the same mask_address_var value.  I\ndon\u0027t think the two lines actually adds any value here.\n\nFinally, none of the text in this function is passed through the\ninternationalisation mechanism.\n\nIt would be nice to remove another use of deprecated_show_value_hack\nif possible, so this commit does a complete rewrite of\nshow_mask_address.\n\nAfter this commit the output of the above example command, still on my\nx86-64 native target is:\n\n    (gdb) show mips mask-address\n    Zeroing of upper 32 bits of 64-bit addresses is \"auto\" (current architecture is not MIPS).\n\nThe \u0027current architecture is not MIPS\u0027 text is only displayed when the\ncurrent architecture is not MIPS.  If the architecture is mips then we\nget the more commonly seen \u0027currently \"on\"\u0027 or \u0027currently \"off\"\u0027, like\nthis:\n\n  (gdb) set architecture mips\n  The target architecture is set to \"mips\".\n  (gdb) show mips mask-address\n  Zeroing of upper 32 bits of 64-bit addresses is \"auto\" (currently \"off\").\n  (gdb)\n\nAll the text is passed through the internationalisation mechanism, and\nwe only call gdbarch_tdep when we know the gdbarch architecture is\nbfd_arch_mips.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "65aa86dd98df6a286e75e4f7af90da2db9a42ce6",
      "old_mode": 33188,
      "old_path": "gdb/mips-tdep.c",
      "new_id": "071319ccc7376f9b94249ac4a24407bb90c6cc8b",
      "new_mode": 33188,
      "new_path": "gdb/mips-tdep.c"
    }
  ]
}
