)]}'
{
  "commit": "0b35f123c200522998a81335dc218551ca7b3d92",
  "tree": "9f964fa813c131514c01b362d233e2f5e1066207",
  "parents": [
    "e6b3636709a19303859cb886f5212d5092837b27"
  ],
  "author": {
    "name": "Lancelot SIX",
    "email": "lancelot.six@amd.com",
    "time": "Mon Jan 17 06:13:39 2022 -0500"
  },
  "committer": {
    "name": "Lancelot SIX",
    "email": "lancelot.six@amd.com",
    "time": "Tue Feb 15 09:52:37 2022 +0000"
  },
  "message": "gdb: Respect the DW_CC_nocall attribute\n\nIt is possible for a compiler to optimize a function in a such ways that\nthe function does not follow the calling convention of the target.  In\nsuch situation, the compiler can use the DW_AT_calling_convention\nattribute with the value DW_CC_nocall to tell the debugger that it is\nunsafe to call the function.  The DWARF5 standard states, in 3.3.1.1:\n\n  \u003e If the value of the calling convention attribute is the constant\n  \u003e DW_CC_nocall, the subroutine does not obey standard calling\n  \u003e conventions, and it may not be safe for the debugger to call this\n  \u003e subroutine.\n\nNon standard calling convention can affect GDB\u0027s assumptions in multiple\nways, including how arguments are passed to the function, how values are\nreturned, and so on.  For this reason, it is unsafe for GDB to try to do\nthe following operations on a function with marked with DW_CC_nocall:\n\n- call / print an expression requiring the function to be evaluated,\n- inspect the value a function returns using the \u0027finish\u0027 command,\n- force the value returned by a function using the \u0027return\u0027 command.\n\nThis patch ensures that if a command which relies on GDB\u0027s knowledge of\nthe target\u0027s calling convention is used on a function marked nocall, GDB\nprints an appropriate message to the user and does not proceed with the\noperation which is unreliable.\n\nNote that it is still possible for someone to use a vendor specific\nvalue for the DW_AT_calling_convention attribute for example to indicate\nthe use of an alternative calling convention.  This commit does not\nprevent this, and target dependent code can be adjusted if one wanted to\nsupport multiple calling conventions.\n\nTested on x86_64-Linux, with no regression observed.\n\nChange-Id: I72970dae68234cb83edbc0cf71aa3d6002a4a540\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ff07086b46f8ce10c0126277ef1fa46d84e040b3",
      "old_mode": 33188,
      "old_path": "gdb/gdbtypes.c",
      "new_id": "a2dbe7551b54d7beee8ea0dfd3ce03a3929cb6c5",
      "new_mode": 33188,
      "new_path": "gdb/gdbtypes.c"
    },
    {
      "type": "modify",
      "old_id": "5072dc24bfabac2ab8ce48a254401dd2074f052c",
      "old_mode": 33188,
      "old_path": "gdb/gdbtypes.h",
      "new_id": "bd192da4b4b50524c599c7c9ebf138836127d8ac",
      "new_mode": 33188,
      "new_path": "gdb/gdbtypes.h"
    },
    {
      "type": "modify",
      "old_id": "8e896296b96c01f7559d6642a66f3b09445f6169",
      "old_mode": 33188,
      "old_path": "gdb/infcall.c",
      "new_id": "f8c812c8f611c82a6f37f8f714cbfaec3737d2ce",
      "new_mode": 33188,
      "new_path": "gdb/infcall.c"
    },
    {
      "type": "modify",
      "old_id": "1dc4e3638b3efdd37c2a5cbca9b881239c6b8c4c",
      "old_mode": 33188,
      "old_path": "gdb/infcmd.c",
      "new_id": "465c8f30f12514eee434e51dbd4e7f8241c68c14",
      "new_mode": 33188,
      "new_path": "gdb/infcmd.c"
    },
    {
      "type": "modify",
      "old_id": "b1bbf7d0f4493805da4c34cb3afd0f5cdbf174f3",
      "old_mode": 33188,
      "old_path": "gdb/stack.c",
      "new_id": "fe243b4310efdce2d0fdd71e6b5c2174c7fd84d0",
      "new_mode": 33188,
      "new_path": "gdb/stack.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0068ccdd6b4ff5d5b834a44dbb1a9e0335a2ea82",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/calling-convention.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0a11cb15c68ce0fde2a116963bebe5135a78a824",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/calling-convention.exp"
    }
  ]
}
