)]}'
{
  "commit": "56260065c80caf67b57ec612b85bb978e06dad2d",
  "tree": "a99e8d6be7dbb3c994fea5ccbc239f97c9e7bd57",
  "parents": [
    "3e9907d8496edb66086dcdebd3a9cb2b3c918e77"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed Jul 31 07:42:56 2024 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed Aug 28 10:30:31 2024 +0100"
  },
  "message": "gdb: Add \u0027maint info inline-frames\u0027 command\n\nWhile reviewing a patch I wanted to view GDB\u0027s inline frame state.  I\ndon\u0027t believe there\u0027s currently a maintenance command to view this\ninformation, so in this commit I\u0027ve added one.\n\nThe new command is:\n\n  maintenance info inline-frames\n  maintenance info inline-frames ADDRESS\n\nThe command lists the inline frames that start at ADDRESS, or at the\ncurrent $pc if no ADDRESS is given.  The command also displays the\n\"outer\" function in which the inline functions are present.\n\nAn example of the command output:\n\n  (gdb) maintenance info inline-frames\n  Cached inline state information for thread 1.\n  program counter \u003d 0x401137\n  skipped frames \u003d 1\n    bar\n  \u003e foo\n    main\n  (gdb)\n\nThis tells us that function \u0027main\u0027 called \u0027foo\u0027 which called \u0027bar\u0027.\nThe functions \u0027foo\u0027 and \u0027bar\u0027 are both inline and both start at the\naddress 0x401137.  Currently GDB considers the inferior to be stopped\nin frame \u0027foo\u0027 (note the \u0027\u003e\u0027 marker), this means that there is 1\nskipped frame (function \u0027bar\u0027).\n\nThe function \u0027main\u0027 is the outer function.  The outer function might\nnot start at 0x401137, it is simply the function that contains the\ninline functions.\n\nIf the user does a \u0027step\u0027 then GDB will not actually move the inferior\nforward, but will instead simply tell the user that the inferior\nentered \u0027bar\u0027.  The output of \u0027maint info inline-frames\u0027 will change\nlike this:\n\n  (gdb) step\n  bar () at inline.c:6\n  6\t  ++global_counter;\n  (gdb) maintenance info inline-frames\n  Cached inline state information for thread 1.\n  program counter \u003d 0x401137\n  skipped frames \u003d 0\n  \u003e bar\n    foo\n    main\n  (gdb)\n\nNow GDB is in function \u0027bar\u0027 and there are no skipped frames.\n\nI have renamed skipped_symbols to function symbols within the\ninline_state class.  We are now going to carry the \"outer\"\nfunction (the function that contains all the inlined functions) within\nthis list (as the last entry), so the old name didn\u0027t really make\nsense.  As a consequence of this rename I\u0027ve updated some comments.\n\nI\u0027ve changed stopped_by_user_bp_inline_frame to take a symbol rather\nthan a block.  Previously we just used the block to access the\nassociated function symbol.  After this commit we can just pass in the\nfunction symbol directly, so lets do that.\n\nNew function gather_inline_frames contains some of the logic pulled\nfrom skip_inline_frames.  This new function builds the list of all\nsymbols of inlined functions that start at a given $pc value and also\nthe \"outer\" function that contains all of the inlined functions.\n\nIn skip_inline_frames I\u0027ve split the loop logic into two.  The loop to\nbuild the function symbol list has moved to gather_inline_frames.  The\nloop to figure out how many of the inlined functions we are skipping\nremains in skip_inline_frames and uses the result of calling\ngather_inline_frames.\n\nIn inline_skipped_symbol there are some minor updates to the comment,\nand I\u0027ve tweaked one of the asserts now that the function symbols list\nalso contains the \"outer\" function (a \u003c\u003d becomes \u003c).\n\nThe maintenance_info_inline_frames function is now and implements the\nnew maintenance command.\n\nAnd _initialize_inline_frame is updated to register the new command.\n\nI\u0027ve added a basic test for the new command.  Please excuse the file\nname for the new test, in the next commit I\u0027ll be adding additional\ntests and at that point the file name will make sense.\n\nReviewed-By: Eli Zaretskii \u003celiz@gnu.org\u003e\nApproved-By: Simon Marchi \u003csimon.marchi@efficios.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6bded319161dd5cdd729dc63d3bdb1c2a278ea4d",
      "old_mode": 33188,
      "old_path": "gdb/NEWS",
      "new_id": "a65c557e334682131c8716f80505ec5e0aa5a0ea",
      "new_mode": 33188,
      "new_path": "gdb/NEWS"
    },
    {
      "type": "modify",
      "old_id": "7938b0799f9a0a05b2a4a15e2547efd73efc313c",
      "old_mode": 33188,
      "old_path": "gdb/doc/gdb.texinfo",
      "new_id": "e85099f7d650bdce08321735c3b60d221545a6d9",
      "new_mode": 33188,
      "new_path": "gdb/doc/gdb.texinfo"
    },
    {
      "type": "modify",
      "old_id": "56b295520f956cafe9d76d1d5cd953524cb434c7",
      "old_mode": 33188,
      "old_path": "gdb/inline-frame.c",
      "new_id": "8ba886c3efc84c4885cb0a529a26991fd1978cd3",
      "new_mode": 33188,
      "new_path": "gdb/inline-frame.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "35b20648cd5c84e404b713b7f601255c6dbd0f1c",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cbf090deba21d48165e411d8a8ef04b63782b28f",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/maint-info-inline-frames-and-blocks.exp"
    }
  ]
}
