Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gdb] cannot not open source file with Chinese/Unicode characters in path when debugging #602

Closed
aeschli opened this issue Mar 29, 2017 · 23 comments

Comments

@aeschli
Copy link

aeschli commented Mar 29, 2017

From @magicsong on March 29, 2017 14:22

  • VSCode Version:1.10
  • OS Version:ubuntu 16.04 lts

Steps to Reproduce:
I'm a chinese user, so maybe my issue is relative with language support problem.
1.debug a c++ project with cpptool
2.then VS Code reminds me cannot open some file like this:无法打开“PointTransformer.cpp”: 找不到文件(/home/magicsong/346226207346241243/Codes/DataTransform/GeoDataTransformer/PointTransformer.cpp)。In my computer, the file above is located in "/home/magicsong/文档/Codes/DataTransform/GeoDataTransformer/PointTransformer.cpp", does cpptool not support chinese? or something i miss when i debug?

Copied from original issue: microsoft/vscode#23575

@pieandcakes
Copy link
Contributor

@magicsong If you remove the Chinese characters in the path, does it work?

@magicsong
Copy link

@pieandcakes I still got this error when i change the path.I also change my OS language to English, and rebuild again, it still does not work.

@pieandcakes
Copy link
Contributor

@magicsong So you get the file not found after you change the path? Can you post the updated error when you remove the Chinese characters from the path?

@magicsong
Copy link

Unable to open 'raise.c': File not found (/build/glibc-9tT8Do/glibc-2.23/sysdeps/unix/sysv/linux/raise.c). After i google, it seems that the debug is OK now because this new error is different from my first error. So it does not work when i have chinese characters in my file path.

@pieandcakes
Copy link
Contributor

pieandcakes commented Mar 30, 2017

I've marked this as a bug so we can go investigate and fix the Chinese characters in path issue. Thank you for reporting it.

@sean-mcmanus
Copy link
Collaborator

What is the new error?

@pieandcakes
Copy link
Contributor

@sean-mcmanus Its the first sentence in @magicsong's last post.

@sean-mcmanus
Copy link
Collaborator

But that sounds the same as the first error. Both errors are about not being able to open the file.

@pieandcakes
Copy link
Contributor

The second error seems like the user is trying to step into library code and doesn't have the source files on their machine so the error is expected. The first is that the path is converting the Chinese characters into a series of numbers which is unexpected and a bug.

@pieandcakes pieandcakes changed the title cannot not open source file when debug cannot not open source file with Chinese characters in path when debugging Apr 3, 2017
@pieandcakes pieandcakes changed the title cannot not open source file with Chinese characters in path when debugging cannot not open source file with Chinese/Unicode characters in path when debugging Apr 10, 2017
@ygrayson
Copy link

@magicsong Are you able to solve the error "Unable to open 'raise.c': File not found (/build/glibc-9tT8Do/glibc-2.23/sysdeps/unix/sysv/linux/raise.c)". I got the same one and coincidentally (or not) I'm also a Chinese user.

@pieandcakes
Copy link
Contributor

@ygrayson that isn't an issue with Chinese users. That is gdb stopping in glibc code and the debugger returning a source code path of /build/glibc-9tT8Do/glibc-2.23/sysdeps/unix/sysv/linux/raise.c. Since you don't have glibc source, this is why you get an "Unable to open" message.

@ygrayson
Copy link

@pieandcakes Do I have any way to have the glibc source under the correct directory? My debugger works fine right now without any seg fault or other errors, but do I have any way to solve this error?

@pieandcakes
Copy link
Contributor

@ygrayson If you want to have the source for glibc, you can add mappings to it using "sourceFileMap". Otherwise you can just ignore it. Its not a real error.

@n-p-e
Copy link

n-p-e commented Aug 30, 2018

I'd like to know how to avoid this bug. If it is something about gdb, is removing Chinese the only solution?

@pieandcakes
Copy link
Contributor

@coffee-sgr As far as I know that is the only solution. We have the same problem with any Unicode characters, whether it be Chinese or not. If you find another workaround, please let us know.

@mxdh
Copy link

mxdh commented Mar 31, 2019

@pieandcakes I'm a Chinese user.
It seems that this issue is caused by gdb.
When I run gdb with powershell,it cannot display Chinese characters in path.
When gdb runs in MI mode,it seems that gdb changes Chinese characters into numbers.

@mxdh
Copy link

mxdh commented Apr 3, 2019

@LOVELIBERTY1314
Sorry,my English is not good.I am just a middle school student.
Win10 1809 x64,MinGw-w64 8.1.0,when I debug 19_1_递归.cpp,after I use b 21,it displays 19_1_.cpp.

@pieandcakes
Copy link
Contributor

@mxdh @LOVELIBERTY1314 the issue is with gdb when it runs in MI mode does not support any Unicode characters. There needs to be a fix within gdb itself.

@mxdh
Copy link

mxdh commented May 4, 2019

@pieandcakes Has anyone reported this issue to gnu?

@pieandcakes
Copy link
Contributor

@pieandcakes pieandcakes added external and removed bug labels May 4, 2019
@pieandcakes pieandcakes changed the title cannot not open source file with Chinese/Unicode characters in path when debugging [gdb] cannot not open source file with Chinese/Unicode characters in path when debugging May 4, 2019
@CodingByteFly
Copy link

CodingByteFly commented May 5, 2019 via email

@Kiswelrg
Copy link

Kiswelrg commented Nov 7, 2022

and even i got into the debug process, the breakpoints don't seem to work. so when will gdb supports non-ascii characters on file names.

@BillKek
Copy link

BillKek commented Aug 1, 2023

Try solution with lldb-mi as replacement of gdb. I have success on eclipse IDE with bat-file:

chcp 65001
SET PATH=C:\msys64\clang32\bin;C:\msys64\usr\bin;%PATH%
lldb-mi.exe %*

and with installed mingw-w64-clang-i686-lldb and mingw-w64-clang-i686-lldb-mi packages of windows-based msys2 system. I assume that VSCode works in a similar way relative to eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants