bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc + gdb + breakpoint => SIGSEGV (Cygwin)


From: dave_140390
Subject: gcc + gdb + breakpoint => SIGSEGV (Cygwin)
Date: Sat, 1 Mar 2008 11:35:45 -0800 (PST)
User-agent: G2/1.0

Hi,

I have a problem when trying to use gdb with a program compiled with
gcc in Cygwin.

I compile this program:

<main.c>
int main(int argc, char** argv)
{
    return 0;
}
</main.c>

with this command:

  gcc -g main.c

and I get this file:

  9757 Mar  1 21:27 a.exe

I then start gdb:

  gdb a.exe

and running the program in gdb works:

  (gdb) run
  Starting program: /c/TEMP/a.exe
  Loaded symbols for /c/WINNT/system32/ntdll.dll
  Loaded symbols for /c/WINNT/system32/kernel32.dll
  Loaded symbols for /usr/bin/cygwin1.dll
  Loaded symbols for /c/WINNT/system32/advapi32.dll
  Loaded symbols for /c/WINNT/system32/rpcrt4.dll
  Loaded symbols for /c/WINNT/system32/secur32.dll

  Program exited normally.

but doing the same with a breakpoint yields SIGSEGV:

  gdb a.exe
  (gdb) list
  1       int main(int argc, char** argv)
  2       {
  3           return 0;
  4       }
  (gdb) break 3
  Breakpoint 1 at 0x40107a: file main.c, line 3.
  (gdb) run
  Starting program: /c/TEMP/a.exe
  Loaded symbols for /c/WINNT/system32/ntdll.dll
  Loaded symbols for /c/WINNT/system32/kernel32.dll
  Loaded symbols for /usr/bin/cygwin1.dll
  Loaded symbols for /c/WINNT/system32/advapi32.dll
  Loaded symbols for /c/WINNT/system32/rpcrt4.dll
  Loaded symbols for /c/WINNT/system32/secur32.dll

  Program received signal SIGSEGV, Segmentation fault.
  [Switching to thread 44692.0xaea4]
  0x005c004d in ?? ()
  (gdb)

What could be wrong?

I have completely uninstalled, then reinstalled Cygwin, without help.

-- dave

The versions I use
------------------
`gcc -v' yields:

<gcc -v>
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/
configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --
infodir=/usr/share/info --enable-languages=c,ada,c+
+,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --
disable-java-awt --with-system-zlib --enable-interpreter --disable-
libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-
win32-registry --enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
</gcc -v>

When starting gdb, I get:

<gdb>
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-cygwin".
</gdb>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]