V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hailongs
V2EX  ›  C

gdb 调试问题

  •  
  •   hailongs · 2016-01-15 11:29:09 +08:00 · 886 次点击
    这是一个创建于 3024 天前的主题,其中的信息可能已经有所发展或是发生改变。

    gdb 调试打印中文如何打印,每次打印都会打印如下。。

    $23 = 0x6d26ecd8 "һ\274", <incomplete sequence \323>

    2 条回复    2016-01-15 20:54:43 +08:00
    zts1993
        1
    zts1993  
       2016-01-15 20:05:40 +08:00 via Android
    非二进制安全字符串?
    yeahren
        2
    yeahren  
       2016-01-15 20:54:43 +08:00
    (gdb) help printf
    printf "printf format string", arg1, arg2, arg3, ..., argn
    This is useful for formatted output in user-defined commands.
    .
    .
    .
    (gdb) printf "%s\n", test_chinese_str
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3829 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:18 · PVG 18:18 · LAX 03:18 · JFK 06:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.