GDB trava tentando abrir o arquivo / proc no bash no Windows no Ubuntu 16.04.2 LTS [closed]

1

Instalei o Ubuntu 16.04.2 LTS no meu Windows 10 e recebi um problema que O GDB trava tentando chamar popen :

$ sudo gdb out
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from linx.out...done.
(gdb) r
Starting program: /bin/x64/Debug/out
warning: unable to open /proc file '/proc/2710/status'
warning: unable to open /proc file '/proc/2710/status'

Program terminated with signal SIGKILL, Killed.
The program no longer exists.

Tudo está bem ao chamar do shell.

main.cpp code:

#include <iostream>
#include <string>

using namespace std;

int main(int, char*[])
{
    char buffer[1024];
    FILE* f = popen("ls -la", "r");
    if (f != nullptr)
    {
        while (!feof(f))
        {
            if (fgets(buffer, 1024, f) != nullptr)
            {
                cout << buffer;
            }
        }
        pclose(f);
    }
    return 0;
}

comando de compilação com informações de depuração:

g++ -g main.cpp -o out

e sem:

g++ main.cpp -o out

Versão do Windows:

C:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.15063 N/A Build 15063

Versões do Linux:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

$ gdb --version
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.

$ g++ --version
g++ (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 6.3.0 20170519
Copyright (C) 2016 Free Software Foundation, Inc.

Alguma sugestão de como resolver isso?

    
por Vitali Malyuk 20.06.2017 / 14:40

0 respostas