C :: B中的调试器.无法打开cygwin.S [英] Debugger in C::B. Can't open cygwin.S

查看:120
本文介绍了C :: B中的调试器.无法打开cygwin.S的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在声明一个简单的二维数组时发现了调试器的一个非常奇怪的行为.似乎无法在库中打开文件cygwin.S.

Hi I just discovered a quite weird behaviour of the debugger when declaring a simple two-dimensional array. It looks like it can't open a file cygwin.S in the library.

无法打开文件:../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S

Cannot open file: ../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S

在../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S:169

At ../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S:169

无需调试即可执行.有一个代码示例:

An execution without debugging works fine. There is an example of the code:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    const int strNumTries = 15;
    const int strLength = 98;
    char strName[strLength][strNumTries];

    printf("Hello world!\n");

    return 0;
}

调试器使用'step in'方法在char数组声明上停止.那么可能是什么问题?

Debugger stops on the char array declaration using 'step in' method. So what's the problem it may be?

推荐答案

我怀疑您看到的是这样的东西:

I suspect your seeing something like this:

GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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 untitled...done.
(gdb) br main
Breakpoint 1 at 0x4005f1: file untitled.c, line 6.
(gdb) r
Starting program: /home/xxxx/untitled 
.
.
.

Breakpoint 1, main () at untitled.c:6
6       const int strNumTries = 15;
(gdb) s
7       const int strLength = 98;
(gdb) 
8       char strName[strLength][strNumTries];
(gdb) 
10      printf("Hello world!\n");
(gdb) 
_IO_puts (str=0x400794 "Hello world!") at ioputs.c:34
34  ioputs.c: No such file or directory.
(gdb) 
36  in ioputs.c
(gdb) 
strlen () at ../sysdeps/x86_64/strlen.S:66
66  ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) 
67  in ../sysdeps/x86_64/strlen.S
(gdb) 
68  in ../sysdeps/x86_64/strlen.S

最后一行重复多次,然后再转到其他任何子功能.

where that last line repeats many times before moving on to any other sub functions.

这不是错误,而是对 printf()

以下是唯一与数组声明有关的gdb输出:

the following is the only gdb output that has anything to do with the array declaration:

8       char strName[strLength][strNumTries];

这篇关于C :: B中的调试器.无法打开cygwin.S的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆