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]

Re: gdb seems to be broken on darwin 10.5.8 and later


On Thu, Oct 01, 2009 at 01:29:28PM +0200, Jonas Maebe wrote:
>
> On 30 Sep 2009, at 18:20, Jack Howarth wrote:
>
>> Now gdb errors out earlier and claims that darwin executables
>> aren't valid executable files. Is anyone else seeing that on
>> darwin?
>
> Since you mentioned later that you are on 10.6, might the problem be  
> that previously you only tested gdb on programs compiled under 10.5.x or 
> with "-mmacosx-version-min 10.5" (or earlier), while you are now trying 
> with a program compiled on and for 10.6? Apple added/changed some things 
> to the Mach-O object format in 10.6 (just like in 10.5), and e.g. (some?) 
> binaries compiled for 10.6 are not recognised as valid executables at all 
> on 10.5 or earlier. gdb might be confused for similar reasons.
>
> You may want to try compiling your program with "-mmacosx-version-min  
> 10.5" and check again.
>
>
> Jonas

Actually tonight's gdb cvs built on x86_64-apple-darwin10 seems to work
fairly well with the proposed macho changes as long as I run as root.
Targeting binaries for 10.6 doesn't seem to be a problem. The only issue
I have run into so far is with binaries built at -O3 with gcc trunk.
With Apple's gcc-4.2 compiler, if I compile...

gcc -m64 -g -O3 himenoBMTxpa.c

break points are set normally...

(gdb) break 4
Breakpoint 1 at 0x100001b14: file himenoBMTxpa.c, line 4.

but with binaries built with gcc 4.5, I find that this doesn't work...

(gdb) break 4
Breakpoint 1 at 0x100002832: file himenoBMTxpa.c, line 70. (4 locations)

The problem disappears if I regress the compile back to -O2 with gcc 4.5.
Is this problem being seen with gdb under linux?
             Jack


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