)]}'
{
  "commit": "e922d7b7c19e7f2d0b77f1eb182049c907e669dd",
  "tree": "264235519328fd9aa6a14f1658c86ad35ecb8ce5",
  "parents": [
    "565074f17c6d3849e8a496d5bd7fbf7147b134bf"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Wed May 20 13:14:07 2026 +0100"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Mon May 25 15:34:58 2026 +0100"
  },
  "message": "Fix \"set cwd ...\" on Cygwin, part 1\n\nWhen running gdb.base/exitsignal.exp on Cygwin, we see:\n\n (gdb) set cwd /cygdrive/d/cygwin-gdb/build-testsuite/outputs/gdb.base/exitsignal\n (gdb) run\n Starting program: /cygdrive/d/cygwin-gdb/build-testsuite/outputs/gdb.base/exitsignal/exitsignal\n Error converting inferior cwd: 28\n (gdb) FAIL: gdb.base/exitsignal.exp: runto: run to main\n\n28 is ENOSPC.  But this isn\u0027t really literally no space left, though.\ncygwin_conv_path documentation mentions that error code.\n\nAccording to the Cygwin API documentation for cygwin_conv_path, the\nfunction fails with ENOSPC (\"No space left on device\") when the size\nof the destination buffer is smaller than what is required for the\nconversion.  See:\n\n https://cygwin.com/cygwin-api/func-cygwin-conv-path.html\n\nIf we look closely at how the buffer size argument is being passed, we\nsee we have two problems here:\n\n1) Incorrectly passing down the input buffer size instead of the\noutput size.\n\nThe code passes strlen(inferior_cwd) as the size of the destination\nbuffer (infcwd). However, the target Windows path format\n(e.g. \"D:\\cygwin-gdb\\...\" in my case) could be longer or shorter than\nthe POSIX source path (\"/cygdrive/d/...\").  In my specific case, the\nsource string is 64 characters, while the target Windows string is 61\n(wide) characters (and twice as many bytes).\n\n2) Incorrectly passing character count instead of byte count\n\nThe conversion target token is CCP_POSIX_TO_WIN_W.  The _W means that\nthe destination buffer infcwd takes wide characters (wchar_t).  The\ndocumentation states that the size argument is in bytes, not\ncharacters.\n\nThis commit fixes it, by passing the byte size of the destination\nbuffer.\n\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\nChange-Id: I70af6ef394f48da35ccc2e04ef764915e09e59de\ncommit-id: 66c930c2\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d506b42fbdac22aaac6c6a5b411d841f95f6914d",
      "old_mode": 33188,
      "old_path": "gdb/windows-nat.c",
      "new_id": "862568fa21e01cd8f3cd22652a60391950bc6501",
      "new_mode": 33188,
      "new_path": "gdb/windows-nat.c"
    }
  ]
}
