)]}'
{
  "commit": "3dc9dde26d1c279e888d1fd0361f720e5a3721f3",
  "tree": "25ecdac4bfe73d9584a480081ab2d68282ebdf9f",
  "parents": [
    "70f479c6f8bf976ca680fd53d655ccec56b3f12e"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Mon Nov 07 09:55:23 2022 -0500"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Thu Nov 10 11:33:02 2022 -0500"
  },
  "message": "gdb: add prepare_reinflate/reinflate around print_frame_args in info_frame_command_core\n\nI noticed this crash:\n\n    $ ./gdb --data-directory\u003ddata-directory -nx -q \\\n          testsuite/outputs/gdb.python/pretty-print-call-by-hand/pretty-print-call-by-hand \\\n\t  -x testsuite/outputs/gdb.python/pretty-print-call-by-hand/pretty-print-call-by-hand.py \\\n\t  -ex \"b g\" -ex r\n    (gdb) info frame\n    Stack level 0, frame at 0x7fffffffdd80:\n     rip \u003d 0x555555555160 in g\n        (/home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/pretty-print-call-by-hand.c:41); saved rip \u003d 0x5555555551a3\n     called by frame at 0x7fffffffdda0\n     source language c.\n     Arglist at 0x7fffffffdd70, args: mt\u003dmytype is 0x555555556004 \"hello world\",\n        depth\u003d10\n\n    Fatal signal: Segmentation fault\n\nThis is another case of frame_info being invalidated under a function\u0027s\nfeet.  The stack trace when the frame_info get invalidated looks like:\n\n    ... many frames to pretty print the arg, that eventually invalidate the frame_infos ...\n    #35 0x00005568d0a8ab24 in print_frame_arg (fp_opts\u003d..., arg\u003d0x7ffc3216bcb0) at /home/simark/src/binutils-gdb/gdb/stack.c:489\n    #36 0x00005568d0a8cc75 in print_frame_args (fp_opts\u003d..., func\u003d0x621000233210, frame\u003d..., num\u003d-1, stream\u003d0x60b000000300)\n        at /home/simark/src/binutils-gdb/gdb/stack.c:898\n    #37 0x00005568d0a9536d in info_frame_command_core (fi\u003d..., selected_frame_p\u003dtrue) at /home/simark/src/binutils-gdb/gdb/stack.c:1682\n\nprint_frame_args knows that print_frame_arg can invalidate frame_info\nobjects, and therefore calls prepare_reinflate/reinflate.  However,\ninfo_frame_command_core has a separate frame_info_ptr instance (it is\npassed by value / copy).  So info_frame_command_core needs to know that\nprint_frame_args can invalidate frame_info objects, and therefore needs\nto prepare_reinflate/reinflate as well.  Add those calls, and enhance\nthe gdb.python/pretty-print-call-by-hand.exp test to test that command.\n\nReviewed-By: Bruno Larsen \u003cblarsen@redhat.com\u003e\nChange-Id: I9edaae06d62e97ffdb30938d364437737238a960\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "653251c200b48319114a38271824f8a32cf03a0b",
      "old_mode": 33188,
      "old_path": "gdb/stack.c",
      "new_id": "4e2342c2a8d907e79443425a5175b090166058b1",
      "new_mode": 33188,
      "new_path": "gdb/stack.c"
    },
    {
      "type": "modify",
      "old_id": "0aeb2218f9114d1f7d43d1f9fa177aa86e350227",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp",
      "new_id": "eb3fc9e35faf3c470da9e068616067c3abbdafe7",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp"
    }
  ]
}
