This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

support C/C++ identifiers named with non-ASCII characters


Hello, team.

This patch fixes the bug at
https://sourceware.org/bugzilla/show_bug.cgi?id=22973 .

Here is how to test the patch:

Step 1. If you are using Clang or any other C compilers that have implemented support for Unicode identifiers, then create a C file with the following
        content:

int main(int 參量, char* 參[])
{
  struct 集
  {
    int 數[3];
  } 集 = {100, 200, 300};
  int 序 = 2;
  return 0;
}

Or if you are using GCC, create a C file with the following content as a
workaround(GCC still doesn't actually support Unicode identifiers in 2018, which
is a pity):

int main(int \u53C3\u91CF, char* \u53C3[])
{
  struct \u96C6
  {
    int \u6578[3];
  } \u96C6 = {100, 200, 300};
  int \u5E8F = 2;
  return 0;
}

Step 2. Compile the C file.

Step 3. Run GDB for the compiled executable, add a breakpoint in "return 0".

Step 4. Run until the breakpoint.

Step 5. Test the following commands to see if they work:
        p 參量
        p 參
        p 集
        p 集.數
        p 集.數[序]

Thanks for your review.

Attachment: ChangeLog
Description: Text document

Attachment: diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]