)]}'
{
  "commit": "4cbe4ca5da5cd7e1e6331ce11f024bf3c07b9744",
  "tree": "8c0bf2715ee9bc1c477005ba81c50cc22c59990e",
  "parents": [
    "81384924cdcc9eb2676dd9084b76845d7d0e0759"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Feb 14 14:40:52 2022 +0000"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Jul 11 12:02:54 2022 +0100"
  },
  "message": "gdb: add support for disassembler styling using libopcodes\n\nThis commit extends GDB to make use of libopcodes styling support\nwhere available, currently this is just i386 based architectures, and\nRISC-V.\n\nFor architectures that don\u0027t support styling using libopcodes GDB will\nfall back to using the Python Pygments package, when the package is\navailable.\n\nThe new libopcodes based styling has the disassembler identify parts\nof the disassembled instruction, e.g. registers, immediates,\nmnemonics, etc, and can style these components differently.\nAdditionally, as the styling is now done in GDB we can add settings to\nallow the user to configure which colours are used right from the GDB\nCLI.\n\nThere\u0027s some new maintenance commands:\n\n  maintenance set libopcodes-styling enabled on|off\n  maintenance show libopcodes-styling\n\nThese can be used to manually disable use of libopcodes styling.  This\nis a maintenance command as it\u0027s not anticipated that a user should\nneed to do this.  But, this could be useful for testing, or, in some\nrare cases, a user might want to override the Python hook used for\ndisassembler styling, and then disable libopcode styling so that GDB\nfalls back to using Python.  Right now I would consider this second\nuse case a rare situation, which is why I think a maintenance command\nis appropriate.\n\nWhen libopcodes is being used for styling then the user can make use\nof the following new styles:\n\n  set/show style disassembler comment\n  set/show style disassembler immediate\n  set/show style disassembler mnemonic\n  set/show style disassembler register\n\nThe disassembler also makes use of the \u0027address\u0027 and \u0027function\u0027\nstyles to style some parts of the disassembler output.  I have also\nadded the following aliases though:\n\n  set/show style disassembler address\n  set/show style disassembler symbol\n\nthese are aliases for:\n\n  set/show style address\n  set/show style function\n\nrespectively, and exist to make it easier for users to discover\ndisassembler related style settings.  The \u0027address\u0027 style is used to\nstyle numeric addresses in the disassembler output, while the \u0027symbol\u0027\nor \u0027function\u0027 style is used to style the names of symbols in\ndisassembler output.\n\nAs not every architecture supports libopcodes styling, the maintenance\nsetting \u0027libopcodes-styling enabled\u0027 has an \"auto-off\" type behaviour.\nConsider this GDB session:\n\n  (gdb) show architecture\n  The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n  (gdb) maintenance show libopcodes-styling enabled\n  Use of libopcodes styling support is \"on\".\n\nthe setting defaults to \"on\" for architectures that support libopcodes\nbased styling.\n\n  (gdb) set architecture sparc\n  The target architecture is set to \"sparc\".\n  (gdb) maintenance show libopcodes-styling enabled\n  Use of libopcodes styling support is \"off\" (not supported on architecture \"sparc\")\n\nthe setting will show as \"off\" if the user switches to an architecture\nthat doesn\u0027t support libopcodes styling.  The underlying setting is\nstill \"on\" at this point though, if the user switches back to\ni386:x86-64 then the setting would go back to being \"on\".\n\n  (gdb) maintenance set libopcodes-styling enabled off\n  (gdb) maintenance show libopcodes-styling enabled\n  Use of libopcodes styling support is \"off\".\n\nnow the setting is \"off\" for everyone, even if the user switches back\nto i386:x86-64 the setting will still show as \"off\".\n\n  (gdb) maintenance set libopcodes-styling enabled on\n  Use of libopcodes styling not supported on architecture \"sparc\".\n  (gdb) maintenance show libopcodes-styling enabled\n  Use of libopcodes styling support is \"off\".\n\nattempting to switch the setting \"on\" for an unsupported architecture\nwill give an error, and the setting will remain \"off\".\n\n  (gdb) set architecture auto\n  The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n  (gdb) maintenance show libopcodes-styling enabled\n  Use of libopcodes styling support is \"off\".\n  (gdb) maintenance set libopcodes-styling enabled on\n  (gdb) maintenance show libopcodes-styling enabled\n  Use of libopcodes styling support is \"on\".\n\nthe user will need to switch back to a supported architecture before\nthey can one again turn this setting \"on\".\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1178a37017e3c8f9185634ee7b12a9662f1db6c6",
      "old_mode": 33188,
      "old_path": "gdb/NEWS",
      "new_id": "742f4fe47fbcf8ddafb0b81e3ffb2e698c015d91",
      "new_mode": 33188,
      "new_path": "gdb/NEWS"
    },
    {
      "type": "modify",
      "old_id": "3fd85f4aa863088d07ae893f000f942da6fbb80a",
      "old_mode": 33188,
      "old_path": "gdb/cli/cli-style.c",
      "new_id": "abf685561fad6822acde9366dddc232ee5bd67d9",
      "new_mode": 33188,
      "new_path": "gdb/cli/cli-style.c"
    },
    {
      "type": "modify",
      "old_id": "f69df47098c0eb711318295f2f834828ea9751ec",
      "old_mode": 33188,
      "old_path": "gdb/cli/cli-style.h",
      "new_id": "4090cf0133353df251709d9b572435a54949c30f",
      "new_mode": 33188,
      "new_path": "gdb/cli/cli-style.h"
    },
    {
      "type": "modify",
      "old_id": "6c64c14feeed558b617bb0ebd6b4551436754946",
      "old_mode": 33188,
      "old_path": "gdb/disasm.c",
      "new_id": "cf27a32fbe74bd69670a0630cdf0da1f5103ad20",
      "new_mode": 33188,
      "new_path": "gdb/disasm.c"
    },
    {
      "type": "modify",
      "old_id": "54176eb095a3183e809156d695b5f6f75b28791c",
      "old_mode": 33188,
      "old_path": "gdb/disasm.h",
      "new_id": "2921d537e0ab4a7ae31dc8720396163939c25b67",
      "new_mode": 33188,
      "new_path": "gdb/disasm.h"
    },
    {
      "type": "modify",
      "old_id": "7a4e337d15b3ed5803347094213fa53403baa780",
      "old_mode": 33188,
      "old_path": "gdb/doc/gdb.texinfo",
      "new_id": "86394f631ac2f84b03e78df4e26cee0fc05cad13",
      "new_mode": 33188,
      "new_path": "gdb/doc/gdb.texinfo"
    }
  ]
}
