From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25287 invoked by alias); 25 May 2010 03:26:14 -0000 Received: (qmail 25269 invoked by uid 22791); 25 May 2010 03:26:12 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-px0-f169.google.com (HELO mail-px0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 May 2010 03:26:08 +0000 Received: by pxi12 with SMTP id 12so4679115pxi.0 for ; Mon, 24 May 2010 20:26:07 -0700 (PDT) Received: by 10.143.153.22 with SMTP id f22mr4228625wfo.126.1274757967059; Mon, 24 May 2010 20:26:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.45.13 with HTTP; Mon, 24 May 2010 20:25:47 -0700 (PDT) In-Reply-To: References: From: Hui Zhu Date: Tue, 25 May 2010 03:26:00 -0000 Message-ID: Subject: Re: Can gdb display the source code lines with comments in other languages? To: Yongtao Yang , gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00073.txt.bz2 On Mon, May 24, 2010 at 20:33, Yongtao Yang wrote: > I think the encoding of your source file is UTF-8. I have tested that > gdb do support the UTF-8 encoded chinese characters, but it can't > display the chinese characters correctly in a GB2132 encoded source > file (e.g., source files edited by notepad.exe under windows). How to > configure gdb to support GB2132? I think this because you terminal didn't set to decode GB2132. You can try cat youcode.c If this comments cannot be display too. That is the reason. You can set your terminal to decode GB2132. GNU gdb (GDB) 7.1.50.20100524-cvs Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/teawater/gdb/a.out...done. (gdb) start Temporary breakpoint 1 at 0x8048428: file 1.c, line 21. Starting program: /home/teawater/gdb/a.out Temporary breakpoint 1, main (argc=3D1, argv=3D0xbffff5a4, envp=3D0xbffff5ac) at 1.c:21 21 if (argc < 2) /* =E6=94=B9=E4=BA=86=E4=B8=AD=E7=AB=AF=E8=AE=BE=E7=BD=AE= =E4=BB=80=E4=B9=88=E9=83=BD=E8=83=BD=E6=98=BE=E7=A4=BA */ Thanks, Hui > > On Mon, May 24, 2010 at 10:27 AM, Hui Zhu wrote: >> On Mon, May 24, 2010 at 00:51, Yongtao Yang wrote: >>> >>> Can gdb display the source code lines correctly with comments in other >>> languages, such as Chinese? >> >> gdb ./a.out >> GNU gdb (GDB) 7.1.50.20100524-cvs >> Copyright (C) 2010 Free Software Foundation, Inc. >> License GPLv3+: GNU GPL version 3 or later >> This is free software: you are free to change and redistribute it. >> There is NO WARRANTY, to the extent permitted by law. =C2=A0Type "show c= opying" >> and "show warranty" for details. >> This GDB was configured as "i686-pc-linux-gnu". >> For bug reporting instructions, please see: >> ... >> Reading symbols from /home/teawater/gdb/a.out...done. >> (gdb) start >> Temporary breakpoint 1 at 0x8048428: file 1.c, line 21. >> Starting program: /home/teawater/gdb/a.out >> >> Temporary breakpoint 1, main (argc=3D1, argv=3D0xbffff5a4, >> envp=3D0xbffff5ac) at 1.c:21 >> 21 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (argc < 2) /* =E4= =B8=BA=E4=BB=80=E4=B9=88=E4=B8=8D=E6=94=AF=E6=8C=81=EF=BC=9F */ >> >