)]}'
{
  "commit": "f9e9e263f5d8aa60f34207c056fd3c6d8bd5d8ff",
  "tree": "07b57b1af87a2ed109ee40cc7732a9f15c54461a",
  "parents": [
    "d62eaecf2e6fc2bce3a0d3a711666c700e79a51a"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Sat Jun 28 13:03:14 2025 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Sat Jun 28 13:03:14 2025 +0200"
  },
  "message": "[gdb/tdep] Add \"maint set console-translation-mode \u003cbinary|text\u003e\" command\n\nOn MSYS2, say we record a brief gdb session using TERM\u003ddumb script:\n...\n$ gdb -q\n(gdb) print 1\n$1 \u003d 1\n(gdb) q\n...\n\nWhen looking at the resulting typescript, we notice something odd:\n...\n$ gdb -q^M\n(gdb) print 1^M\n$1 \u003d 1^M^M\n(gdb) q^M\n...\n\nFor some reason, we have \"$1 \u003d 1\\r\\r\\n(gdb) \".\n\nLooking at the documentation of _setmode [1], it mentions translation mode\n_O_TEXT as a mode in which \"\\n\" is translated into \"\\r\\n\" on output.\n\nSo, it looks like this translation happens twice.\n\nAdd a command \"maint set console-translation-mode \u003cbinary|text\u003e\" command that\nallows us to set the translation mode of stdout/stderr to binary, such that we\nget instead:\n...\n$ gdb -q -ex \"maint set console-translation-mode binary\"^M\n(gdb) print 1^M\n$1 \u003d 1^M\n(gdb) q^M\n...\n\nSince we run into this in the testsuite, add\n\"maint set console-translation-mode binary\" to INTERNAL_GDBFLAGS.\n\nBased on \"maint set testsuite-mode on/off\" from these patches [2][3] by Pierre\nMuller.\n\nCompared to that proposal, I dropped the name testsuite-mode, because the\nbehaviour is not specific to the testsuite.\n\nAlso I chose values binary/text instead of on/off because eventually there may\nbe other translation mode values that we need [4].\n\nCo-Authored-By: Pierre Muller \u003cmuller@sourceware.org\u003e\nReviewed-By: Eli Zaretskii \u003celiz@gnu.org\u003e\n\n[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode\n[2] https://sourceware.org/legacy-ml/gdb-patches/2013-09/msg00939.html\n[3] https://sourceware.org/legacy-ml/gdb-patches/2013-09/msg00940.html\n[4] https://learn.microsoft.com/en-us/cpp/c-runtime-library/translation-mode-constants\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6c8a008d39d31659709f9e259c8f930662514b00",
      "old_mode": 33188,
      "old_path": "gdb/NEWS",
      "new_id": "2abe376a5837e46bb3763ccf699098446ff9d856",
      "new_mode": 33188,
      "new_path": "gdb/NEWS"
    },
    {
      "type": "modify",
      "old_id": "4ef640698bd814a2b2ed99f44eb2ee35bd80b6b4",
      "old_mode": 33188,
      "old_path": "gdb/doc/gdb.texinfo",
      "new_id": "b6d626b40318178469443155c4a6ea0a28948417",
      "new_mode": 33188,
      "new_path": "gdb/doc/gdb.texinfo"
    },
    {
      "type": "modify",
      "old_id": "84a7b9f7a528129ce2189d6be212337981a1ffda",
      "old_mode": 33188,
      "old_path": "gdb/mingw-hdep.c",
      "new_id": "481bd41e1527a55f1e263d6cda90d32f63c97a4c",
      "new_mode": 33188,
      "new_path": "gdb/mingw-hdep.c"
    },
    {
      "type": "modify",
      "old_id": "3f1cd55d7273a0a9ecdd870213cb450e8843ecb8",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/lib/gdb.exp",
      "new_id": "777d64d14d1cb806b6d9fe4b3045b34510862131",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/lib/gdb.exp"
    }
  ]
}
