This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

break $function in coff/pe doesn't break exactly before the first statement?


Hi all,

I am trying to run the testsuite against my arm-wince gdbserver port (what a pain!),
but I am getting a lot of failures all coming from the same symptom.
I then switched to native cygwin to see if the same happens there.


$ cat main.c
#include <stdio.h>

int main()
{
 printf ("hello world!\n");
 return 0;
}

$./gdb.exe main.exe
GNU gdb 6.5.50.20061115-cvs
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) b main
Breakpoint 1 at 0x401075: file main.c, line 4.
(gdb) r
Starting program: /cygdrive/d/cegccsf/cegcc/cegcc/src/build-gdb_server_cygwin/gdb/mytest/main.exe


Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll

Breakpoint 1, main () at main.c:4
4       {
(gdb)

While on i686-linux, the breakpoint stops at:
5  printf ("hello world!\n");

So on coff targets, an extra 'next' is required to get to the first statement of the function.

I get the same sympton with either stabs:
cygwin$gcc main.c -g3 -O0 -o main.exe

or dwarf:
cygwin$gcc main.c -g3 -gdwarf-2 -O0 -o main.exe

Is this intended behavior?
If yes, should the testsuite be fixed?
Else, any hints where I should be looking at to fix this?

=== gdb Summary ===

# of expected passes 9537
# of unexpected failures 513
# of expected failures 46
# of unknown successes 3
# of known failures 24
# of unresolved testcases 38
# of untested testcases 12
# of unsupported tests 26
/cygdrive/d/cegccsf/cegcc/cegcc/src/build-gdb_server_cygwin/gdb/testsuite/../../gdb/gdb version 6.5.50.20061115-cvs -nx


Outch! > 500. Talk about regressions :)

Cheers,
Pedro Alves



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]