)]}'
{
  "commit": "b20885b0a439ff8bd0e4fd00c666589ffca10fa2",
  "tree": "68038c10a641c6fad03852521c5122e16c428222",
  "parents": [
    "7f51f2cd5866d485898fd4b60827fa3643252b71"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Fri Oct 20 14:23:40 2023 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed Nov 08 11:18:40 2023 +0000"
  },
  "message": "gdb: add a custom command completer for disassemble command\n\nAdd a new command completer function for the disassemble command.\nThere are two things that this completion function changes.  First,\nafter the previous commit, the new function calls skip_over_slash_fmt,\nwhich means that hitting tab after entering a /OPT flag now inserts a\nspace ready to start typing the address to disassemble at:\n\n  (gdb) disassemble /r\u003cTAB\u003e\n  (gdb) disassemble /r \u003cCURSOR\u003e\n\nBut also, we now get symbol completion after a /OPT option set,\npreviously this would do nothing:\n\n  (gdb) disassemble /r mai\u003cTAB\u003e\n\nBut now:\n\n  (gdb) disassemble /r mai\u003cTAB\u003e\n  (gdb) disassemble /r main \u003cCURSOR\u003e\n\nWhich was my main motivation for working on this commit.\n\nHowever, I have made a second change in the completion function.\nCurrently, the disassemble command calls the generic\nlocation_completer function, however, the disassemble docs say:\n\n     Note that the \u0027disassemble\u0027 command\u0027s address arguments are specified\n  using expressions in your programming language (*note Expressions:\n  Expressions.), not location specs (*note Location Specifications::).\n  So, for example, if you want to disassemble function \u0027bar\u0027 in file\n  \u0027foo.c\u0027, you must type \u0027disassemble \u0027foo.c\u0027::bar\u0027 and not \u0027disassemble\n  foo.c:bar\u0027.\n\nAnd indeed, if I try:\n\n  (gdb) disassemble hello.c:main\n  No symbol \"hello\" in current context.\n  (gdb) disassemble hello.c::main\n  No symbol \"hello\" in current context.\n  (gdb) disassemble \u0027hello.c\u0027::main\n  Dump of assembler code for function main:\n  ... snip ...\n\nBut, if I do this:\n\n  (gdb) disassemble hell\u003cTAB\u003e\n  (gdb) disassemble hello.c:\u003cCURSOR\u003e\n\nwhich is a consequence of using the location_completer function.  So\nin this commit, after calling skip_over_slash_fmt, I forward the bulk\nof the disassemble command completion to expression_completer.  Now\nwhen I try this:\n\n  (gdb) disassemble hell\u003cTAB\u003e\n\ngives nothing, which I think is an improvement.  There is one slight\ndisappointment, if I do:\n\n  (gdb) disassemble \u0027hell\u003cTAB\u003e\n\nI still get nothing.  I had hoped that this would expand to:\n\u0027hello.c\u0027:: but I guess this is a limitation of the current\nexpression_completer implementation, however, I don\u0027t think this is a\nregression, the previous expansion was just wrong.  Fixing\nexpression_completer is out of scope for this commit.\n\nI\u0027ve added some disassembler command completion tests, and also a test\nthat disassembling using \u0027FILE\u0027::FUNC syntax works, as I don\u0027t think\nthat is tested anywhere.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "90989588babc0ffdedda086ce9e651fa3e8b73ce",
      "old_mode": 33188,
      "old_path": "gdb/cli/cli-cmds.c",
      "new_id": "fd93e5b4ccbb2c14fbf0b648159a031e72b6de4d",
      "new_mode": 33188,
      "new_path": "gdb/cli/cli-cmds.c"
    },
    {
      "type": "modify",
      "old_id": "4686e6f8f340591142f09a9f171b1b383ab54014",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/completion.exp",
      "new_id": "15937810d2f524033c72d8cb446f0609e0c2fe34",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/completion.exp"
    },
    {
      "type": "modify",
      "old_id": "78df18d9e96f297be3bfad737bc4d90cc8aefb94",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.disasm/basics.exp",
      "new_id": "3dfc16e04cfb9e4176563248064ce79b72a3134c",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.disasm/basics.exp"
    }
  ]
}
