)]}'
{
  "commit": "fc7df214ef57f11a5d2c87f0dba24ad5ef5263f6",
  "tree": "42018ff7af93e3f72c44c225744ebf8be160dd22",
  "parents": [
    "d1a912db7fdf50c28224d20464bfa163d8438980"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Dec 04 14:23:17 2023 +0000"
  },
  "committer": {
    "name": "Richard Bunt",
    "email": "richard.bunt@linaro.org",
    "time": "Mon Dec 04 14:23:17 2023 +0000"
  },
  "message": "gdb: install CLI uiout while processing early init files\n\nThe next commit wants to use a \u0027show\u0027 command within an early\ninitialisation file, despite these commands not being in the list of\nacceptable commands for use within an early initialisation file.\n\nThe problem we run into is that the early initialisation files are\nprocessed before GDB has installed the top level interpreter.  The\ninterpreter is responsible to installing the default uiout (accessed\nthrough current_uiout), and as a result code that depends on\nuiout (e.g. \u0027show\u0027 commands) will end up dereferencing a nullptr, and\ncrashing GDB.\n\nI did consider moving the interpreter installation before the early\ninitialisation, and this would work fine except for the new DAP\ninterpreter, which relies on having Python available during its\ninitialisation.  Which means we can\u0027t install the interpreter until\nafter Python has been initialised, and the early initialisation\nhandling has to occur before Python is setup -- that\u0027s the whole point\nof this feature (to allow customisation of how Python is setup).\n\nSo, what I propose is that early within captured_main_1, we install a\ntemporary cli_ui_out as the current_uiout.  This will remain in place\nuntil the top-level interpreter is installed, at which point the\ntemporary will be replaced.\n\nWhat this means is that current_uiout will no longer be nullptr,\ninstead, any commands within an early initialisation file that trigger\noutput, will perform that output in a CLI style.\n\nI propose that we don\u0027t update the documentation for early\ninitialisation files, we leave the user advice as being only \u0027set\u0027 and\n\u0027source\u0027 commands are acceptable.  But now, if a user does try a\n\u0027show\u0027 command, then instead of crashing, GDB will do something\npredictable.\n\nI\u0027ve not added a test in this commit.  The next commit relies on this\npatch and will serve as a test.\n\nTested-By: Richard Bunt \u003crichard.bunt@linaro.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "486c1ffe0718991b3a6481a0f9ee8537af412cbf",
      "old_mode": 33188,
      "old_path": "gdb/main.c",
      "new_id": "eb11d6f2e46aeb4d7e257f80ebaac5d901099951",
      "new_mode": 33188,
      "new_path": "gdb/main.c"
    }
  ]
}
