• 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) 结果啥也查不到……

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

  • 相关阅读:
    hdu 4948 Kingdom(推论)
    codeforces 407 div1 A题(Functions again)
    Atcoder regular Contest 073(C
    Atcoder regular Contest 073(D
    Nginx阅读笔记(二)之location的用法
    Nginx阅读笔记
    django virtualenv
    Supervisor
    捕捉攻击者
    django user模块改写
  • 原文地址:https://www.cnblogs.com/adjwang/p/14186674.html
Copyright © 2020-2023  润新知