)]}'
{
  "commit": "a640adf7cfb7920d7a0b6b34a671ea138a9cdc83",
  "tree": "03b58e047f82a3ee78314d74c8bebdceaef67d99",
  "parents": [
    "7a6cb96b710257a4f5bc7e85cc103b6bf8dfc25c"
  ],
  "author": {
    "name": "Kevin Buettner",
    "email": "kevinb@redhat.com",
    "time": "Wed Aug 18 19:53:09 2021 -0700"
  },
  "committer": {
    "name": "Kevin Buettner",
    "email": "kevinb@redhat.com",
    "time": "Fri Sep 03 08:54:12 2021 -0700"
  },
  "message": "Test case reproducing PR28030 bug\n\nThe original reproducer for PR28030 required use of a specific\ncompiler version - gcc-c++-11.1.1-3.fc34 is mentioned in the PR,\nthough it seems probable that other gcc versions might also be able to\nreproduce the bug as well.  This commit introduces a test case which,\nusing the DWARF assembler, provides a reproducer which is independent\nof the compiler version.  (Well, it\u0027ll work with whatever compilers\nthe DWARF assembler works with.)\n\nTo the best of my knowledge, it\u0027s also the first test case which uses\nthe DWARF assembler to provide debug info for a shared object.  That\nbeing the case, I provided more than the usual commentary which should\nallow this case to be used as a template when a combo shared\nlibrary / DWARF assembler test case is required in the future.\n\nI provide some details regarding the bug in a comment near the\nbeginning of locexpr-dml.exp.\n\nThis problem was difficult to reproduce; I found myself constantly\nreferring to the backtrace while trying to figure out what (else) I\nmight be missing while trying to create a reproducer.  Below is a\npartial backtrace which I include for posterity.\n\n #0  internal_error (\n    file\u003d0xc50110 \"/ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/gdbtypes.c\", line\u003d5575,\n    fmt\u003d0xc520c0 \"Unexpected type field location kind: %d\")\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdbsupport/errors.cc:51\n #1  0x00000000006ef0c5 in copy_type_recursive (objfile\u003d0x1635930,\n    type\u003d0x274c260, copied_types\u003d0x30bb290)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/gdbtypes.c:5575\n #2  0x00000000006ef382 in copy_type_recursive (objfile\u003d0x1635930,\n    type\u003d0x274ca10, copied_types\u003d0x30bb290)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/gdbtypes.c:5602\n #3  0x0000000000a7409a in preserve_one_value (value\u003d0x24269f0,\n    objfile\u003d0x1635930, copied_types\u003d0x30bb290)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/value.c:2529\n #4  0x000000000072012a in gdbscm_preserve_values (\n    extlang\u003d0xc55720 \u003cextension_language_guile\u003e, objfile\u003d0x1635930,\n    copied_types\u003d0x30bb290)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/guile/scm-value.c:94\n #5  0x00000000006a3f82 in preserve_ext_lang_values (objfile\u003d0x1635930,\n    copied_types\u003d0x30bb290)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/extension.c:568\n #6  0x0000000000a7428d in preserve_values (objfile\u003d0x1635930)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/value.c:2579\n #7  0x000000000082d514 in objfile::~objfile (this\u003d0x1635930,\n    __in_chrg\u003d\u003coptimized out\u003e)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/objfiles.c:549\n #8  0x0000000000831cc8 in std::_Sp_counted_ptr\u003cobjfile*, (__gnu_cxx::_Lock_policy)2\u003e::_M_dispose (this\u003d0x1654580)\n    at /usr/include/c++/11/bits/shared_ptr_base.h:348\n #9  0x00000000004e6617 in std::_Sp_counted_base\u003c(__gnu_cxx::_Lock_policy)2\u003e::_M_release (this\u003d0x1654580) at /usr/include/c++/11/bits/shared_ptr_base.h:168\n #10 0x00000000004e1d2f in std::__shared_count\u003c(__gnu_cxx::_Lock_policy)2\u003e::~__shared_count (this\u003d0x190bb88, __in_chrg\u003d\u003coptimized out\u003e)\n    at /usr/include/c++/11/bits/shared_ptr_base.h:705\n #11 0x000000000082feee in std::__shared_ptr\u003cobjfile, (__gnu_cxx::_Lock_policy)2\u003e::~__shared_ptr (this\u003d0x190bb80, __in_chrg\u003d\u003coptimized out\u003e)\n    at /usr/include/c++/11/bits/shared_ptr_base.h:1154\n #12 0x000000000082ff0a in std::shared_ptr\u003cobjfile\u003e::~shared_ptr (\n    this\u003d0x190bb80, __in_chrg\u003d\u003coptimized out\u003e)\n    at /usr/include/c++/11/bits/shared_ptr.h:122\n #13 0x000000000085ed7e in __gnu_cxx::new_allocator\u003cstd::_List_node\u003cstd::shared_ptr\u003cobjfile\u003e \u003e \u003e::destroy\u003cstd::shared_ptr\u003cobjfile\u003e \u003e (this\u003d0x114bc00,\n    __p\u003d0x190bb80) at /usr/include/c++/11/ext/new_allocator.h:168\n #14 0x000000000085e88d in std::allocator_traits\u003cstd::allocator\u003cstd::_List_node\u003cstd::shared_ptr\u003cobjfile\u003e \u003e \u003e \u003e::destroy\u003cstd::shared_ptr\u003cobjfile\u003e \u003e (__a\u003d...,\n    __p\u003d0x190bb80) at /usr/include/c++/11/bits/alloc_traits.h:531\n #15 0x000000000085e50c in std::__cxx11::list\u003cstd::shared_ptr\u003cobjfile\u003e, std::allocator\u003cstd::shared_ptr\u003cobjfile\u003e \u003e \u003e::_M_erase (this\u003d0x114bc00, __position\u003d\n  std::shared_ptr\u003cobjfile\u003e (expired, weak count 1) \u003d {get() \u003d 0x1635930})\n    at /usr/include/c++/11/bits/stl_list.h:1925\n #16 0x000000000085df0e in std::__cxx11::list\u003cstd::shared_ptr\u003cobjfile\u003e, std::allocator\u003cstd::shared_ptr\u003cobjfile\u003e \u003e \u003e::erase (this\u003d0x114bc00, __position\u003d\n  std::shared_ptr\u003cobjfile\u003e (expired, weak count 1) \u003d {get() \u003d 0x1635930})\n    at /usr/include/c++/11/bits/list.tcc:158\n #17 0x000000000085c748 in program_space::remove_objfile (this\u003d0x114bbc0,\n    objfile\u003d0x1635930)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/progspace.c:210\n #18 0x000000000082d3ae in objfile::unlink (this\u003d0x1635930)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/objfiles.c:487\n #19 0x000000000082e68c in objfile_purge_solibs ()\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/objfiles.c:875\n #20 0x000000000092dd37 in no_shared_libraries (ignored\u003d0x0, from_tty\u003d1)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/solib.c:1236\n #21 0x00000000009a37fe in target_pre_inferior (from_tty\u003d1)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/target.c:2496\n #22 0x00000000007454d6 in run_command_1 (args\u003d0x0, from_tty\u003d1,\n    run_how\u003dRUN_NORMAL)\n    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/infcmd.c:437\n\nI\u0027ll note a few points regarding this backtrace:\n\nFrame #1 is where the internal error occurs.  It\u0027s caused by an\nunhandled case for FIELD_LOC_KIND_DWARF_BLOCK.  The fix for this bug\nadds support for this case.\n\nFrame #22 - it\u0027s a partial backtrace - shows that GDB is attempting to\n(re)run the program.  You can see the exact command sequence that was\nused for reproducing this problem in the PR (at\nhttps://sourceware.org/bugzilla/show_bug.cgi?id\u003d28030), but in a\nnutshell, after starting the program and advancing to the appropriate\nsource line, GDB was asked to step into libstdc++; a \"finish\" command\nwas issued, returning a value.  The fact that a value was returned is\nvery important.  GDB was then used to step back into libstdc++.  A\nbreakpoint was set on a source line in the library after which a \"run\"\ncommand was issued.\n\nFrame #19 shows a call to objfile_purge_solibs.  It\u0027s aptly named.\n\nFrame #7 is a call to the destructor for one of the objfile solibs; it\nturned out to be the one for libstdc++.\n\nFrames #6 thru #3 show various value preservation frames.  If you look\nat preserve_values() in gdb/value.c, the value history is preserved\nfirst, followed by internal variables, followed by values for the\nextension languages (python and guile).\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2cfd1c613a4b55a68768c08bd67b921a67512a58",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/locexpr-data-member-location-lib.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "62845edcdf75ead0c1613f08ce817d7210565f0b",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/locexpr-data-member-location-main.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1f70e6a34bd00433e766d26732e97638d3348f52",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "81cd2b38e859380ba756441284ec80f10a8694be",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.h"
    }
  ]
}
