)]}'
{
  "commit": "7abc6ec0a6f7e82bda6f00c1f1ae7c638d1c799c",
  "tree": "c25e132a81ec94cf1bb4d21fa844ef0cb35924c4",
  "parents": [
    "9c5f314314e2d14c7602a79b969e02ebdd8890ea"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed Sep 14 13:51:28 2022 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Thu Sep 22 10:34:15 2022 +0100"
  },
  "message": "gdb/python: restrict the names accepted by gdb.register_window_type\n\nI noticed that, from Python, I could register a new TUI window that\nhad whitespace in its name, like this:\n\n  gdb.register_window_type(\u0027my window\u0027, MyWindowType)\n\nhowever, it is not possible to then use this window in a new TUI\nlayout, e.g.:\n\n  (gdb) tui new-layout foo my window 1 cmd 1\n  Unknown window \"my\"\n  (gdb) tui new-layout foo \"my window\" 1 cmd 1\n  Unknown window \"\"my\"\n  (gdb) tui new-layout foo my\\ window 1 cmd 1\n  Unknown window \"my\\\"\n\nGDB clearly uses the whitespace to split the incoming command line.\n\nI could fix this by trying to add a mechanism by which we can use\nwhitespace within a window name, but it seems like an easier solution\nif we just forbid whitespace within a window name.  Not only is this\neasier, but I think this is probably the better solution, identifier\nnames with spaces in would mean we\u0027d need to audit all the places a\nwindow name could be printed and ensure that the use of a space didn\u0027t\nmake the output ambiguous.\n\nSo, having decided to disallow whitespace, I then thought about other\nspecial characters.  We currently accept anything as a window name,\nand I wondered if this was a good idea.\n\nMy concerns were about how special characters used in a window name\nmight cause confusion, for example, we allow \u0027$\u0027 in window names,\nwhich is maybe fine now, but what if one day we wanted to allow\nvariable expansion when creating new layouts?  Or what about starting\na window name with \u0027-\u0027?  We already support a \u0027-horizontal\u0027 option,\nwhat if we want to add more in the future?  Or use of the special\ncharacter \u0027{\u0027 which has special meaning within a new layout?\n\nIn the end I figured it might make sense to place some restrictive\nrules in place, and then relax the rules later if/when users complain,\nwe can consider each relaxation as its requested.\n\nSo, I propose that window names should match this regular expression:\n\n  [a-zA-Z][-_.a-zA-Z0-9]*\n\nThere is a chance that there is user code in the wild which will break\nwith the addition of this change, but hopefully adapting to the new\nrestrictions shouldn\u0027t be too difficult.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "555ef2ddf77b042152b56630edcf5687a2923eee",
      "old_mode": 33188,
      "old_path": "gdb/NEWS",
      "new_id": "9619842bc0333d20089accbb163926c449b4d298",
      "new_mode": 33188,
      "new_path": "gdb/NEWS"
    },
    {
      "type": "modify",
      "old_id": "7aa9e853d85dc61855a0d0c07504cc20ad0d8a40",
      "old_mode": 33188,
      "old_path": "gdb/doc/python.texi",
      "new_id": "2692211f3889018ac3e930a2bc59bf1a71277539",
      "new_mode": 33188,
      "new_path": "gdb/doc/python.texi"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8aaf3b42229df38aef349b29864022647ee34be2",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.python/tui-window-names.exp"
    },
    {
      "type": "modify",
      "old_id": "09887d3d594231585bed77ab02dc0aa5b95e1324",
      "old_mode": 33188,
      "old_path": "gdb/tui/tui-layout.c",
      "new_id": "2c4e60ab2cba28ad0f87b9f627ded105bf971e30",
      "new_mode": 33188,
      "new_path": "gdb/tui/tui-layout.c"
    }
  ]
}
