Kaspar Siricenko Kaspar Siricenko - 25 days ago 15
C Question

Debugger in C::B. Can't open 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.


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

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;
}


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

Answer Source

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.

This is not an error, but rather part of the call to printf()

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

8       char strName[strLength][strNumTries];