zoukankan      html  css  js  c++  java
  • cygwin 里的 gdb 没法输入重定向 (待解决)

    问题

    cygwin 里的 gdb 没法输入重定向
    运行程序的时候用 ./my.exe <cin.txt 就好,但是 gdb 不行。
    按照正常 gdb 流程:

    1. g++ ...
    2. gdb ./my.exe
    3. run < cin.txt

    但是这个办法仅限 Unix ,在 cygwin的邮件列表 里找到了原因:

    It's a bug in all Win32 ports of gdb.

    This has to do with how GDB starts a "inferior" subprocess that it
    wants to debug; on Unix, it uses the shell to do the redirection, but
    on win32, gdb uses CreateProcess. Currently, the cmd arg parser in
    win32/gdb doesn't look for redirection symbols, and so it doesn't do
    what you'd expect. Also, someone has to write the small piece of code
    that does the redirection by passing the descriptor to CreateProcess
    etc.

    See target.c (child_create_inferior) for how it's done on Unix boxes and
    win32-nat.c (child_create_inferior) for how it's done on win32.

    It can be fixed without too much trouble, but someone needs to do it.

    然后……我看到日期居然是 Date: Wed, 21 Apr 1999 13:20:03 -0500 (CDT)

    淦!1999年!在 StackOverflow 上找了几个问题,也是差不多 10 年前的问题了,给出的方案也都是上面那个适用 Unix 的。

    解决方案

    没找到,无解。只好先用 VisualStudio 了。

    查了下 win32-nat.c (child_create_inferior) 结果啥也查不到……

    有哪位靓仔知道该咋办的话,请务必告知,感谢!

  • 相关阅读:
    多条件查询测试用例设计方法(1)—Pairwise(转)
    单例饿汉式和饱汉式各自的有缺点(转)
    Intellij IDEA生成JavaDoc(转)
    Linux常用命令分类
    Linux 常用命令
    数据库简单测试
    postman参数为Json数据结构
    WEB测试常见BUG
    APP应用测试技巧
    APP软件半成品测试技巧
  • 原文地址:https://www.cnblogs.com/adjwang/p/14186674.html
Copyright © 2011-2022 走看看