)]}'
{
  "commit": "1d45d90934b10862c00a22bcf4075815a785001b",
  "tree": "64ac6a72a23c6192d45cdac5d9c8621c2e4195c5",
  "parents": [
    "5d4a870e05ac45e3f5a301c672a4079995b5db7a"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon Oct 16 16:32:28 2023 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon Oct 16 16:32:28 2023 +0200"
  },
  "message": "[gdb/symtab] Work around PR gas/29517\n\nWhen using glibc debuginfo generated with gas 2.39, we run into PR gas/29517:\n...\n$ gdb -q -batch a.out -ex start -ex \"p (char *)strstr (\\\"haha\\\", \\\"ah\\\")\"\nTemporary breakpoint 1 at 0x40051b: file hello.c, line 6.\n\nTemporary breakpoint 1, main () at hello.c:6\n6\t  printf (\"hello\\n\");\nInvalid cast.\n...\nwhile without glibc debuginfo installed we get the expected result:\n...\n$n \u003d 0x7ffff7daa1b1 \"aha\"\n...\nand likewise with glibc debuginfo generated with gas 2.40.\n\nThe strstr ifunc resolves to __strstr_sse2_unaligned.  The problem is that gas\ngenerates dwarf that states that the return type is void:\n...\n\u003c1\u003e\u003c3e1e58\u003e: Abbrev Number: 2 (DW_TAG_subprogram)\n    \u003c3e1e59\u003e   DW_AT_name        : __strstr_sse2_unaligned\n    \u003c3e1e5d\u003e   DW_AT_external    : 1\n    \u003c3e1e5e\u003e   DW_AT_low_pc      : 0xbbd2e\n    \u003c3e1e66\u003e   DW_AT_high_pc     : 0xbc1c3\n...\nwhile the return type should be a DW_TAG_unspecified_type, as is the case\nwith gas 2.40.\n\nWe can still use the workaround of casting to another function type for both\n__strstr_sse2_unaligned:\n...\n(gdb) p ((char * (*) (const char *, const char *))__strstr_sse2_unaligned) \\\n  (\"haha\", \"ah\")\n$n \u003d 0x7ffff7daa211 \"aha\"\n...\nand strstr (which requires using *strstr to dereference the ifunc before we\ncast):\n...\ngdb) p ((char * (*) (const char *, const char *))*strstr) (\"haha\", \"ah\")\n$n \u003d 0x7ffff7daa251 \"aha\"\n...\nbut that\u0027s a bit cumbersome to use.\n\nWork around this in the dwarf reader, such that we have instead:\n...\n(gdb) p (char *)strstr (\"haha\", \"ah\")\n$n \u003d 0x7ffff7daa1b1 \"aha\"\n...\n\nThis also requires fixing producer_is_gcc to stop returning true for\nproducer \"GNU AS 2.39.0\".\n\nTested on x86_64-linux.\n\nApproved-By: Andrew Burgess \u003caburgess@redhat.com\u003e\n\nPR symtab/30911\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d30911\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "89de40daab0331278f26f7d11e3289d11aeefd48",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cu.c",
      "new_id": "a908ec908cdcfebeb607a2ba656dbef72c33cf78",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cu.c"
    },
    {
      "type": "modify",
      "old_id": "0c15d8b02db8503681c565cd6c2613e025987409",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cu.h",
      "new_id": "6c6117105031cba508093b7593c30b3a766e0fd7",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cu.h"
    },
    {
      "type": "modify",
      "old_id": "d4aec19d31db9fd2f1249634800ec40fdfa499b2",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "2eb34b241db700fccc6aaf296d508659468cc6fc",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    },
    {
      "type": "modify",
      "old_id": "655eb9712834e1a5742f67125b6865b708c3a56e",
      "old_mode": 33188,
      "old_path": "gdb/producer.c",
      "new_id": "9fcf749e3d44523c01d0fd381f677bde47712c12",
      "new_mode": 33188,
      "new_path": "gdb/producer.c"
    },
    {
      "type": "modify",
      "old_id": "1df09214d4a469588e1c45c67405fbc8cb494838",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c",
      "new_id": "e07d9517ff217b911a67e7cde0c9a2261f5405b3",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c"
    },
    {
      "type": "modify",
      "old_id": "5fa6ee544b284db2023ad6bd9f86785ed4eeae3a",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp",
      "new_id": "a6f2a57e33ed06f1ff420cb4c6d76adfb7ba65f2",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp"
    }
  ]
}
