Re: syms_from_objfile() warnings and win32-nat.c IO redirection (Was: suppress annoying warnings about cygwin1.dbg)

Pedro Alves
2007-10-29T22:53:43Z

I'm a bit puzzled, since I've just found out that:

strip --strip-debug ${dest} -o ${stripped_file}
strip --only-keep-debug main.exe -o ${debug_file}
objcopy --add-gnu-debuglink=${debug_file} ${stripped_file} ${dest}

... currently plays nicelly in PE/coff + stabs+. The
CONTENTS | ALLOC sections simply get
the CONTENTS dropped, thus it seems that gdb
doesn't need any fixing after all.

>objdump.exe -h main.exe

main.exe: file format pei-i386

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000003a0 00401000 00401000 00000400 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00100000 00402000 00402000 00000800 2**4
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000040 00502000 00502000 00000000 2**4
ALLOC
3 .idata 00000170 00503000 00503000 00100800 2**2
CONTENTS, ALLOC, LOAD, DATA
4 .gnu_debuglink 00000014 00504000 00504000 00100a00 2**2
CONTENTS, READONLY, DEBUGGING

>objdump.exe -h main.exe.dbg

main.exe.dbg: file format pei-i386

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000003a0 00401000 00401000 00000000 2**4
ALLOC, LOAD, READONLY, CODE
1 .data 00100000 00402000 00402000 00000000 2**4
ALLOC, LOAD, DATA
2 .bss 00000040 00502000 00502000 00000000 2**4
ALLOC
3 .idata 00000170 00503000 00503000 00000000 2**2
ALLOC, LOAD, DATA
4 .stab 0000c630 00504000 00504000 00000268 2**2
CONTENTS, READONLY, DEBUGGING, EXCLUDE
5 .stabstr 0004e99f 00511000 00511000 0000ca68 2**0
CONTENTS, READONLY, DEBUGGING, EXCLUDE

Chris, Brian, would it be possible to instead fix the
cygwin1.dbg generation to do something similar to
the above recipe?

I'm posting a few patches to enable sepdebug.exp and
sepsymtab.exp testing on Cygwin.

I've also locally hacked shreloc.exp to generate seperate
debug info to test shared objects, and relocation, as
that isn't currently tested by sepdebug.exp. It worked
fine.

This means the patches upthread are withdrawn
for now.

Cheers,
Pedro Alves