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

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

  • 相关阅读:
    图论
    后缀数组专题
    AC自动机
    线段树·二
    nginx实现负载均衡
    关于mysql binlog二进制
    linux下每次git clone无需多次输入账号密码
    Centos7 yum安装 MySQL5.7.25
    docker基本操作和部署
    composer update 或者 composer install提示killed解决办法
  • 原文地址:https://www.cnblogs.com/adjwang/p/14186674.html
Copyright © 2011-2022 走看看