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

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

  • 相关阅读:
    分布式缓存Redis的集群-主从复制
    搭建私有Nuget服务
    分布式缓存Redis的持久化方式RDB和AOF
    .Net Core使用分布式缓存Redis:Lua脚本
    .Net Core使用分布式缓存Redis:数据结构
    .Net Core使用分布式缓存Redis:基础
    Android基础开发归档
    gdb 调试
    linux shell 常用表达式汇总
    V8 data struct
  • 原文地址:https://www.cnblogs.com/adjwang/p/14186674.html
Copyright © 2011-2022 走看看