)]}'
{
  "commit": "ef8bee09ef09230e4247ea962698bf5a0b4892cc",
  "tree": "714ebdd1367c0b00c11ee2e9abc645ec6f857938",
  "parents": [
    "a0f6a1fd48794595e4750d581b63783fed17345f"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Sun Apr 13 11:26:41 2025 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Tue May 13 15:35:26 2025 +0100"
  },
  "message": "gdb/python: new gdb.ParameterPrefix class\n\nThis commit adds a new gdb.ParameterPrefix class to GDB\u0027s Python API.\n\nWhen creating multiple gdb.Parameters, it is often desirable to group\nthese together under a sub-command, for example, \u0027set print\u0027 has lots\nof parameters nested under it, like \u0027set print address\u0027, and \u0027set\nprint symbol\u0027.  In the Python API the \u0027print\u0027 part of these commands\nare called prefix commands, and are created using gdb.Command objects.\n\nHowever, as parameters are set via the \u0027set ....\u0027 command list, and\nshown through the \u0027show ....\u0027 command list, creating a prefix for a\nparameter usually requires two prefix commands to be created, one for\nthe \u0027set\u0027 command, and one for the \u0027show\u0027 command.\n\nThis often leads to some duplication, or at the very least, each user\nwill end up creating their own helper class to simplify creation of\nthe two prefix commands.\n\nThis commit adds a new gdb.ParameterPrefix class.  Creating a single\ninstance of this class will create both the \u0027set\u0027 and \u0027show\u0027 prefix\ncommands, which can then be used while creating the gdb.Parameter.\n\nHere is an example of it in use:\n\n  gdb.ParameterPrefix(\u0027my-prefix\u0027, gdb.COMMAND_NONE)\n\nThis adds \u0027set my-prefix\u0027 and \u0027show my-prefix\u0027, both of which are\nprefix commands.  The user can then add gdb.Parameter objects under\nthese prefixes.\n\nThe gdb.ParameterPrefix initialise method also supports documentation\nstrings, so we can write:\n\n  gdb.ParameterPrefix(\u0027my-prefix\u0027, gdb.COMMAND_NONE,\n      \"Configuration setting relating to my special extension.\")\n\nwhich will set the documentation string for the prefix command.\n\nAlso, it is possible to support prefix commands that use the `invoke`\nfunctionality to handle unknown sub-commands.  This is done by\nsub-classing gdb.ParameterPrefix and overriding either \u0027invoke_set\u0027 or\n\u0027invoke_show\u0027 to handle the \u0027set\u0027 or \u0027show\u0027 prefix command\nrespectively.\n\nReviewed-By: Eli Zaretskii \u003celiz@gnu.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "691a13ab1a1d1ec6f3e320594428b6cd14e55ded",
      "old_mode": 33188,
      "old_path": "gdb/NEWS",
      "new_id": "e0313bb37dfbd55465003c627b54c74382e3402d",
      "new_mode": 33188,
      "new_path": "gdb/NEWS"
    },
    {
      "type": "modify",
      "old_id": "1a2d7724aa743d2026c469a3da9488a339727c53",
      "old_mode": 33188,
      "old_path": "gdb/doc/python.texi",
      "new_id": "7f801ab3f23810544658a83daf7a79a993c227eb",
      "new_mode": 33188,
      "new_path": "gdb/doc/python.texi"
    },
    {
      "type": "modify",
      "old_id": "4ea5d06a3ba2e9b8cc6e523aaf68c4aaddd1218d",
      "old_mode": 33188,
      "old_path": "gdb/python/lib/gdb/__init__.py",
      "new_id": "866c3129fa39f99cfffaa769857f06bd78936c4d",
      "new_mode": 33188,
      "new_path": "gdb/python/lib/gdb/__init__.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "aa2f84a099acdd3f51351795e01a79c57aa85abe",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.python/py-parameter-prefix.exp"
    }
  ]
}
