)]}'
{
  "commit": "4076f962e8cd73219dfd48a6f682df1ab391c48c",
  "tree": "23256cf22815022235da3d5c660ecbdfadffc4ba",
  "parents": [
    "8358d39b4f0c5c9d29714676bcccb1d59014997f"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Sat Jun 22 10:10:29 2024 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Sat Sep 07 20:28:57 2024 +0100"
  },
  "message": "gdb: split apart two different types of filename completion\n\nUnfortunately we have two different types of filename completion in\nGDB.\n\nThe majority of commands have what I call unquoted filename\ncompletion, this is for commands like \u0027set logging file ...\u0027, \u0027target\ncore ...\u0027, and \u0027add-auto-load-safe-path ...\u0027.  For these commands\neverything after the command name (that is not a command option) is\ntreated as a single filename.  If the filename contains white space\nthen this does not need to be escaped, nor does the filename need to\nbe quoted.  In fact, the filename argument is not de-quoted, and does\nnot have any escaping removed, so if a user does try to add such\nthings, they will be treated as part of the filename.  As an example:\n\n  (gdb) target core \"/path/that contains/some white space\"\n\nWill look for a directory calls \u0027\"\u0027 (double quotes) in the local\ndirectory.\n\nA small number of commands do de-quote and remove escapes from\nfilename arguments.  These command accept what I call quoted and\nescaped filenames.  Right now these are the commands that specify the\nfile for GDB to debug, so:\n\n  file\n  exec-file\n  symbol-file\n  add-symbol-file\n  remove-symbol-file\n\nAs an example of this in action:\n\n  (gdb) file \"/path/that contains/some white space\"\n\nIn this case GDB would load the file:\n\n  /path/that contains/some white space\n\nCurrent filename completion always assumes that filenames can be\nquoted, though escaping doesn\u0027t work in completion right now.  But the\nassumption that quoting is allowed is clearly wrong.\n\nThis commit splits filename completion into two.  The existing\nfilename_completer is retained, and is used for unquoted filenames.  A\nsecond filename_maybe_quoted_completer is added which can be used for\ncompleting quoted filenames.\n\nThe filename completion test has been extended to cover more cases.\nAs part of the extended testing I need to know the character that\nshould be used to separate filenames within a path.  For this TCL 8.6+\nhas $::tcl_platform(pathSeparator).  To support older versions of TCL\nI\u0027ve added some code to testsuite/lib/gdb.exp.\n\nYou might notice that after this commit the completion for unquoted\nfiles is all done in the brkchars phase, that is the function\nfilename_completer_handle_brkchars calculates the completions and\nmarks the completion_tracker as using a custom word point.  The reason\nfor this is that we don\u0027t want to break on white space for this\ncompletion, but if we rely on readline to find the completion word,\nreadline will consider the entire command line, and with no white\nspace in the word break character set, readline will end up using the\nentire command line as the word to complete.\n\nFor now at least, the completer for quoted filenames does generate its\ncompletions during the completion phase, though this is going to\nchange in a later commit.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1008ec23ba523a23de8590fe45689c4a87c01328",
      "old_mode": 33188,
      "old_path": "gdb/completer.c",
      "new_id": "93eb8db6db06d23b1af7273ba4fc775a7519c8e3",
      "new_mode": 33188,
      "new_path": "gdb/completer.c"
    },
    {
      "type": "modify",
      "old_id": "98a12f3907c64b04ab60a2b347110ad627bbeb77",
      "old_mode": 33188,
      "old_path": "gdb/completer.h",
      "new_id": "c6d064ec9d6c11450530264ab064aeb738d5e1d4",
      "new_mode": 33188,
      "new_path": "gdb/completer.h"
    },
    {
      "type": "modify",
      "old_id": "683b0a17b1415c7b25944d33a625062868d9edda",
      "old_mode": 33188,
      "old_path": "gdb/exec.c",
      "new_id": "38ce4619907b9c0d8feac4c4fc2dec45dd2557b0",
      "new_mode": 33188,
      "new_path": "gdb/exec.c"
    },
    {
      "type": "modify",
      "old_id": "2a5507686b0f653a5e6af1c7dafbfdc2b3d1b292",
      "old_mode": 33188,
      "old_path": "gdb/guile/scm-cmd.c",
      "new_id": "8255529a2fe83413cb96f9db55248324c897cd50",
      "new_mode": 33188,
      "new_path": "gdb/guile/scm-cmd.c"
    },
    {
      "type": "modify",
      "old_id": "2ce2c90d80562415c9ff32b82adefb91c4e50586",
      "old_mode": 33188,
      "old_path": "gdb/python/py-cmd.c",
      "new_id": "e042f20fa0d9698244b938d6aa2f0ee1f24fce82",
      "new_mode": 33188,
      "new_path": "gdb/python/py-cmd.c"
    },
    {
      "type": "modify",
      "old_id": "cf7ab0b94e68541cf59e3578adf7208fce382b60",
      "old_mode": 33188,
      "old_path": "gdb/symfile.c",
      "new_id": "c3cd961c0b9c1ebd0ceb282e544c41b8a2532ea2",
      "new_mode": 33188,
      "new_path": "gdb/symfile.c"
    },
    {
      "type": "modify",
      "old_id": "b700977cec57ad799acbf068f14fd0859918d996",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/filename-completion.exp",
      "new_id": "37629bfbf7716092c0b73ee73e614b2150754d2d",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/filename-completion.exp"
    },
    {
      "type": "modify",
      "old_id": "0174aae2129c037a97ff4467db8da6906485058d",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/lib/gdb.exp",
      "new_id": "6c4ffc1abaa8130e5a13fc30e59d1b22c34d36ac",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/lib/gdb.exp"
    }
  ]
}
