)]}'
{
  "commit": "6d0aebbcff0636fb11fb26116ef7ae53ecca314f",
  "tree": "e124b2dadad119fef30628afc8ff18e4ccd279e9",
  "parents": [
    "f555b327d41ed72ffae28caae550f5f86312db43"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Wed Sep 07 09:59:12 2022 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Wed Sep 07 09:59:12 2022 +0200"
  },
  "message": "[gdb/testsuite] Use prototype to call libc functions\n\nOn openSUSE Tumbleweed (using glibc 2.36), I run into:\n...\n(gdb) print /d (int) munmap (4198400, 4096)^M\nInvalid cast.^M\n(gdb) FAIL: gdb.base/break-main-file-remove-fail.exp: cmdline: \\\n  get integer valueof \"(int) munmap (4198400, 4096)\"\n...\n\nThe problem is that after starting the executable, the symbol has type\n\"void (*) (void)\":\n...\n(gdb) p munmap\n$1 \u003d {\u003ctext variable, no debug info\u003e} 0x401030 \u003cmunmap@plt\u003e\n(gdb) start\n  ...\n(gdb) p munmap\n$2 \u003d {void (void)} 0x7ffff7feb9a0 \u003c__GI_munmap\u003e\n...\nwhich causes the \"Invalid cast\" error.\n\nLooking at the debug info for glibc for symbol __GI_munmap:\n...\n \u003c0\u003e\u003c189683\u003e: Abbrev Number: 1 (DW_TAG_compile_unit)\n    \u003c189691\u003e   DW_AT_name        : ../sysdeps/unix/syscall-template.S\n    \u003c189699\u003e   DW_AT_producer    : GNU AS 2.39.0\n\u003c1\u003e\u003c1896ae\u003e: Abbrev Number: 2 (DW_TAG_subprogram)\n    \u003c1896af\u003e   DW_AT_name        : __GI___munmap\n    \u003c1896b3\u003e   DW_AT_external    : 1\n    \u003c1896b4\u003e   DW_AT_low_pc      : 0x10cad0\n    \u003c1896bc\u003e   DW_AT_high_pc     : 37\n...\nthat\u0027s probably caused by this bit (or similar bits for other munmap aliases).\n\nThis is fixed in gas on trunk by commit 5578fbf672e (\"GAS: Add a return type\ntag to DWARF DIEs generated for function symbols\").\n\nWork around this (for say gas 2.39) by explicitly specifying the prototype for\nmunmap.\n\nLikewise for getpid in a couple of other test-cases.\n\nTested on x86_64-linux.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "41c3114aa0558192eb8c6157a7cfa50002ee4ce0",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/break-main-file-remove-fail.exp",
      "new_id": "444b1d33aced0fac784175ffd976c3c31df3d720",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/break-main-file-remove-fail.exp"
    },
    {
      "type": "modify",
      "old_id": "692048f82a34abdeea997ad571794aa5181705aa",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/dprintf-detach.exp",
      "new_id": "b6da01a2845aa7b864e5c00843dfa14a09e9c8be",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/dprintf-detach.exp"
    },
    {
      "type": "modify",
      "old_id": "7967e2e43df5ea70dda780e25eb9975f5b307c5e",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/info-os.exp",
      "new_id": "d12f8750a9cc5b319f520e2f22417a5469a6f648",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/info-os.exp"
    },
    {
      "type": "modify",
      "old_id": "f10c7fdcd255d000327e2c80ee2cb5e93e25074f",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.threads/siginfo-threads.exp",
      "new_id": "8dd34b753a261e861b3fa04dedd908b096ad7194",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.threads/siginfo-threads.exp"
    }
  ]
}
