)]}'
{
  "commit": "0dce428051fd2cf07f9d38e9efe2dbb5d8f7fbef",
  "tree": "36091490d5a3eb2e0c81d0217d90caf995eb4e98",
  "parents": [
    "3312f67c0957196e41db149343d04ee7b30cdc65"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Wed Feb 26 14:52:00 2020 +0100"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Wed Feb 26 14:52:00 2020 +0100"
  },
  "message": "[gdb] Don\u0027t set initial language if set manually\n\nInitially, gdb sets the language to auto/c:\n...\n$ gdb -q\n(gdb) show language\nThe current source language is \"auto; currently c\".\n...\n\nAnd after loading a c++ executable, that changes to auto/c++:\n...\n(gdb) file a.out\nReading symbols from a.out...\n(gdb) show language\nThe current source language is \"auto; currently c++\".\n...\n\nNow consider setting the language manually to c:\n...\n$ gdb -q\n(gdb) show language\nThe current source language is \"auto; currently c\".\n(gdb) set language c\n(gdb) show language\nThe current source language is \"c\".\n...\nThe resulting language is manual/c.\n\nSurprisingly, a subsequent load of the c++ executable:\n...\n(gdb) file a.out\nReading symbols from a.out...\n(gdb) show language\nThe current source language is \"c++\".\n...\ngets us language manual/c++.\n\nLoading the file should get us either:\n- auto/c++, or\n- manual/c.\nThat is, either the manual setting should be reset by loading, or the manual\nsetting should persist.\n\nFix this in the manual/c fashion. [ Though we could make some gdb setting to\nchoose one or the other. ]\n\nBuild and reg-tested on x86_64-linux.\n\n[ Note: In PR23710 comment 1 a cc1 binary is attached for which gdb is slow when\nloading and settting a breakpoint on do_rpo_vn:\n...\n$ time.sh gdb cc1 -batch -ex \"b do_rpo_vn\"\nBreakpoint 1 at 0xd40e30: do_rpo_vn. (2 locations)\nmaxmem: 1463496\nreal: 8.88\nuser: 8.59\nsystem: 0.35\n...\n\nThis fix enables a speedup by manually setting the language before\nloading, reducing executing time with ~17%, due to not having to load the full\nsymtab containing main:\n...\n$ time.sh gdb -iex \"set language c++\" cc1 -batch -ex \"b do_rpo_vn\"\nBreakpoint 1 at 0xd40e30: do_rpo_vn. (2 locations)\nmaxmem: 1067308\nreal: 7.36\nuser: 7.14\nsystem: 0.28\n... ]\n\ngdb/ChangeLog:\n\n2020-02-26  Tom de Vries  \u003ctdevries@suse.de\u003e\n\n\tPR gdb/25603\n\t* symfile.c (set_initial_language): Exit-early if\n\tlanguage_mode \u003d\u003d language_mode_manual.\n\ngdb/testsuite/ChangeLog:\n\n2020-02-26  Tom de Vries  \u003ctdevries@suse.de\u003e\n\n\tPR gdb/25603\n\t* gdb.base/persistent-lang.cc: New test.\n\t* gdb.base/persistent-lang.exp: New file.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "aa4b01bac3b828d70331f03dc4887e6c2f9ec374",
      "old_mode": 33188,
      "old_path": "gdb/ChangeLog",
      "new_id": "fb4cc033a9030bfaa1416b84727e7ad025eb6d6c",
      "new_mode": 33188,
      "new_path": "gdb/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "f7bada75f3501bc8358f638df51d5968bccdeed9",
      "old_mode": 33188,
      "old_path": "gdb/symfile.c",
      "new_id": "f1edf2dca5dd128ee1f70c30c1801c2d9b981088",
      "new_mode": 33188,
      "new_path": "gdb/symfile.c"
    },
    {
      "type": "modify",
      "old_id": "720febb65cc35b1e67106d6136adbb3406a87f36",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/ChangeLog",
      "new_id": "a352c74f0f86417a8a8f36172336b505619112ac",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/ChangeLog"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f4825c8a7c1186e3fc77e381a89369df031109f1",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/persistent-lang.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bcc4ef74698a72290239eb39f38ee4b1f9dcacfd",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/persistent-lang.exp"
    }
  ]
}
