尝试使用Eclipse / CDT&amp ;;调试应用程序时出现“创建会话时出错” GDB

时间:2009-07-05 01:46:26

标签: eclipse debugging gdb eclipse-cdt

尝试调试简单的C ++应用程序时,我收到了一个相当神秘的错误。

消息:“创建会话时出错”

Stacktrace:

org.eclipse.cdt.debug.mi.core.MIException: Process Terminated
    at org.eclipse.cdt.debug.mi.core.MISession.setup(MISession.java:232)
    at org.eclipse.cdt.debug.mi.core.MISession.<init>(MISession.java:204)
    at org.eclipse.cdt.debug.mi.core.MIPlugin.createMISession0(MIPlugin.java:135)
    at org.eclipse.cdt.debug.mi.core.MIPlugin.createSession(MIPlugin.java:464)
    at org.eclipse.cdt.debug.mi.core.AbstractGDBCDIDebugger.createGDBSession(AbstractGDBCDIDebugger.java:114)
    at org.eclipse.cdt.debug.mi.core.AbstractGDBCDIDebugger.createSession(AbstractGDBCDIDebugger.java:68)
    at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugSession(LocalCDILaunchDelegate.java:343)
    at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.createCDISession(LocalCDILaunchDelegate.java:468)
    at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchLocalDebugSession(LocalCDILaunchDelegate.java:145)
    at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugger(LocalCDILaunchDelegate.java:112)
    at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launch(LocalCDILaunchDelegate.java:72)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

操作系统:Ubuntu 32 9.04

gdb:GNU gdb 6.8-debian

日食:20090619-0625

gdb在我的路径中,可从终端执行。

我也试过使用'elf'和'GNU'二进制解析器都无济于事。

任何想法?

阿什利

1 个答案:

答案 0 :(得分:2)

除了查看source code of MSISession

外,其他想法不多
        // The Process may have terminated earlier because
        // of bad arguments etc .. check this here and bail out.
        try {
            process.exitValue();
            InputStream err = process.getErrorStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(err));
            String line = null;
            try {
                line = reader.readLine();
                reader.close();
            } catch (Exception e) {
                // the reader may throw a NPE.
            }
            if (line == null) {
                line = MIPlugin.getResourceString("src.MISession.Process_Terminated"); //$NON-NLS-1$
            }
            throw new MIException(line);
        }

这意味着,不知何故,当你处于这个阶段时,进程已经产生了一些错误,可能是由于不好的参数。