UTF-8 identifiers in gdb

78 views
Skip to first unread message

Åke Forslund

unread,
Jun 8, 2013, 5:57:32 AM6/8/13
to cgdb...@googlegroups.com
Hello,

I was looking into the issue with UTF-8 identifiers not working (issue #9 on github) and thought I'd add support to the gdb input window as well, while I got the basics working (updated parse() in scroller.c) I realised that gdb (at least my setup) can list utf-8 variables but you can't reference them (at least using the utf-8 representation).
This is what I get:

(gdb) list
1       package main
2       import "fmt"
3
4       func main() {
5           var пример = "aaa"
6           var 世界 = "bbb"
7           fmt.Println(пример, 世界)
8       }

variable names are shown without any problems.

But using
(gdb) info locals
$U43f$$U440$$U438$$U43c$$U435$$U440$ = 0x403020 "aaa"
$U4e16$$U754c$ = 0x403024 "bbb"

I can't just copy the variable names from any of the above examples and print them (Error messages are "Invalid character '�' in expression" and "$1 = void" respectively)
Is this behaviour for gdb in general or do I have a problem with my settings? My gdb-version is GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu.

I'd like to know if there is any idea of continuing my work to add utf-8 support in the gdb command window.

Best regards
/Åke


Reply all
Reply to author
Forward
0 new messages