* gdb darwin target on Linux host?
@ 2010-10-20 13:53 Peter Steiner
2010-10-20 14:20 ` Tristan Gingold
[not found] ` <20101020143016.6BE9131366@nx.neverkill.us>
0 siblings, 2 replies; 15+ messages in thread
From: Peter Steiner @ 2010-10-20 13:53 UTC (permalink / raw)
To: gdb
Hi
I try to compile a darwin-target gdb running on a Linux host:
./configure --prefix=/usr/local/gdb --target=x86_64-darwin
this works up to the end of configure & make however does NOT generate a
gdb binary! After make install the bin directory is empty and NO gdb
binary has been linked at all.
if I do:
./configure --prefix=/usr/local/gdb --target=i386-darwin
this creates a gdb binary however it cannot read 64bit binaries from
darwin. Any idea what is wrong?
Thanks.
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: gdb darwin target on Linux host? 2010-10-20 13:53 gdb darwin target on Linux host? Peter Steiner @ 2010-10-20 14:20 ` Tristan Gingold 2010-10-20 14:26 ` Pedro Alves [not found] ` <20101020143016.6BE9131366@nx.neverkill.us> 1 sibling, 1 reply; 15+ messages in thread From: Tristan Gingold @ 2010-10-20 14:20 UTC (permalink / raw) To: Peter Steiner; +Cc: gdb On Oct 20, 2010, at 3:52 PM, Peter Steiner wrote: > Hi > > I try to compile a darwin-target gdb running on a Linux host: > > ./configure --prefix=/usr/local/gdb --target=x86_64-darwin > > this works up to the end of configure & make however does NOT generate a > gdb binary! After make install the bin directory is empty and NO gdb > binary has been linked at all. > > if I do: > > ./configure --prefix=/usr/local/gdb --target=i386-darwin > > this creates a gdb binary however it cannot read 64bit binaries from > darwin. Any idea what is wrong? Could you post the log messages ? I suppose that if no binary is built, then an error has occurred. Not sure why you try to build such a tool, as it would be basically useless to debug. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 14:20 ` Tristan Gingold @ 2010-10-20 14:26 ` Pedro Alves 2010-10-20 14:41 ` Tristan Gingold 0 siblings, 1 reply; 15+ messages in thread From: Pedro Alves @ 2010-10-20 14:26 UTC (permalink / raw) To: gdb; +Cc: Tristan Gingold, Peter Steiner On Wednesday 20 October 2010 15:20:49, Tristan Gingold wrote: > > On Oct 20, 2010, at 3:52 PM, Peter Steiner wrote: > > > Hi > > > > I try to compile a darwin-target gdb running on a Linux host: > > > > ./configure --prefix=/usr/local/gdb --target=x86_64-darwin > > > > this works up to the end of configure & make however does NOT generate a > > gdb binary! After make install the bin directory is empty and NO gdb > > binary has been linked at all. > > > > if I do: > > > > ./configure --prefix=/usr/local/gdb --target=i386-darwin > > > > this creates a gdb binary however it cannot read 64bit binaries from > > darwin. Any idea what is wrong? > > Could you post the log messages ? I suppose that if no binary is built, then an error has occurred. > > Not sure why you try to build such a tool, as it would be basically useless to debug. > > Apparently, the top-level configure is finicky about darwin versions: i[[3456789]]86-*-darwin*) noconfigdirs="$noconfigdirs ld gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; x86_64-*-darwin[[912]]*) noconfigdirs="$noconfigdirs ld gas gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; *-*-darwin*) noconfigdirs="$noconfigdirs ld gas gdb gprof" ^^^ noconfigdirs="$noconfigdirs sim target-rda" noconfigdirs="$noconfigdirs ${libgcj}" ;; Something like "--target=x86_64-darwin10" instead works, and I suppose "--target=i386-darwin --enable-64-bit-bfd" would solve the OPs second attempt. -- Pedro Alves ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 14:26 ` Pedro Alves @ 2010-10-20 14:41 ` Tristan Gingold 2010-10-20 14:50 ` Pedro Alves 0 siblings, 1 reply; 15+ messages in thread From: Tristan Gingold @ 2010-10-20 14:41 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb, Peter Steiner On Oct 20, 2010, at 4:26 PM, Pedro Alves wrote: > Apparently, the top-level configure is finicky about darwin versions: > > i[[3456789]]86-*-darwin*) > noconfigdirs="$noconfigdirs ld gprof" > noconfigdirs="$noconfigdirs sim target-rda" > ;; > x86_64-*-darwin[[912]]*) > noconfigdirs="$noconfigdirs ld gas gprof" > noconfigdirs="$noconfigdirs sim target-rda" > ;; > *-*-darwin*) > noconfigdirs="$noconfigdirs ld gas gdb gprof" > ^^^ > noconfigdirs="$noconfigdirs sim target-rda" > noconfigdirs="$noconfigdirs ${libgcj}" > ;; > > > Something like "--target=x86_64-darwin10" instead works, and > I suppose "--target=i386-darwin --enable-64-bit-bfd" would > solve the OPs second attempt. Ah, ah. Maybe you should remove the '[[912]]' part ? ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 14:41 ` Tristan Gingold @ 2010-10-20 14:50 ` Pedro Alves 2010-10-20 14:52 ` Nathan Froyd 0 siblings, 1 reply; 15+ messages in thread From: Pedro Alves @ 2010-10-20 14:50 UTC (permalink / raw) To: gdb; +Cc: Tristan Gingold, Peter Steiner On Wednesday 20 October 2010 15:41:32, Tristan Gingold wrote: > > On Oct 20, 2010, at 4:26 PM, Pedro Alves wrote: > > > Apparently, the top-level configure is finicky about darwin versions: > > > > i[[3456789]]86-*-darwin*) > > noconfigdirs="$noconfigdirs ld gprof" > > noconfigdirs="$noconfigdirs sim target-rda" > > ;; > > x86_64-*-darwin[[912]]*) > > noconfigdirs="$noconfigdirs ld gas gprof" > > noconfigdirs="$noconfigdirs sim target-rda" > > ;; > > *-*-darwin*) > > noconfigdirs="$noconfigdirs ld gas gdb gprof" > > ^^^ > > noconfigdirs="$noconfigdirs sim target-rda" > > noconfigdirs="$noconfigdirs ${libgcj}" > > ;; > > > > > > Something like "--target=x86_64-darwin10" instead works, and > > I suppose "--target=i386-darwin --enable-64-bit-bfd" would > > solve the OPs second attempt. > > Ah, ah. Maybe you should remove the '[[912]]' part ? I believe so, but I have zero powers over the top level, so someone interested in darwin needs to step up for that. :-) -- Pedro Alves ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 14:50 ` Pedro Alves @ 2010-10-20 14:52 ` Nathan Froyd 2010-10-20 15:09 ` Pedro Alves [not found] ` <20101020150949.4841131366@nx.neverkill.us> 0 siblings, 2 replies; 15+ messages in thread From: Nathan Froyd @ 2010-10-20 14:52 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb, Tristan Gingold, Peter Steiner On Wed, Oct 20, 2010 at 03:50:25PM +0100, Pedro Alves wrote: > On Wednesday 20 October 2010 15:41:32, Tristan Gingold wrote: > > On Oct 20, 2010, at 4:26 PM, Pedro Alves wrote: > > > x86_64-*-darwin[[912]]*) > > > noconfigdirs="$noconfigdirs ld gas gprof" > > > noconfigdirs="$noconfigdirs sim target-rda" > > > ;; > > > *-*-darwin*) > > > noconfigdirs="$noconfigdirs ld gas gdb gprof" > > > ^^^ > > > noconfigdirs="$noconfigdirs sim target-rda" > > > noconfigdirs="$noconfigdirs ${libgcj}" > > > ;; > > > > > > > > > Something like "--target=x86_64-darwin10" instead works, and > > > I suppose "--target=i386-darwin --enable-64-bit-bfd" would > > > solve the OPs second attempt. > > > > Ah, ah. Maybe you should remove the '[[912]]' part ? > > I believe so, but I have zero powers over the top level, so > someone interested in darwin needs to step up for that. :-) I think the decision is deliberate, as x86_64-darwin8 is not a valid target. -Nathan ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 14:52 ` Nathan Froyd @ 2010-10-20 15:09 ` Pedro Alves [not found] ` <20101020150949.4841131366@nx.neverkill.us> 1 sibling, 0 replies; 15+ messages in thread From: Pedro Alves @ 2010-10-20 15:09 UTC (permalink / raw) To: gdb; +Cc: Nathan Froyd, Tristan Gingold, Peter Steiner On Wednesday 20 October 2010 15:52:47, Nathan Froyd wrote: > I think the decision is deliberate, as x86_64-darwin8 is not a valid > target. That sounds like gcc-isms escaping into the top-level. config.sub expands x86_64-darwin to ... x86_64-pc-darwin, and neither bfd nor gdb (at least) need to distinguish between darwin revisions. IMO, if x86_64-darwin8 should be verbotten, there should be an explicit "x86_64-*-darwin8*" or some such forcing an error. -- Pedro Alves ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20101020150949.4841131366@nx.neverkill.us>]
* Re: gdb darwin target on Linux host? [not found] ` <20101020150949.4841131366@nx.neverkill.us> @ 2010-10-20 15:15 ` Peter Steiner 0 siblings, 0 replies; 15+ messages in thread From: Peter Steiner @ 2010-10-20 15:15 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb, Nathan Froyd, Tristan Gingold made a cross-check o a native darwin box, and I get the "not recognized" error too: root# gdb/gdb /bin/ls GNU gdb (GDB) 7.2 Copyright (C) 2010 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-apple-darwin10.0.0". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... "/bin/ls": not in executable format: File format not recognized ^^^^^^^ So, I assume your packaged libbfd cannot handle these binaries at all? (from your gdb-7.2.tar.bz2) ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20101020143016.6BE9131366@nx.neverkill.us>]
* Re: gdb darwin target on Linux host? [not found] ` <20101020143016.6BE9131366@nx.neverkill.us> @ 2010-10-20 14:42 ` Peter Steiner 2010-10-20 15:12 ` Tristan Gingold [not found] ` <20101020151257.25F2D31366@nx.neverkill.us> 0 siblings, 2 replies; 15+ messages in thread From: Peter Steiner @ 2010-10-20 14:42 UTC (permalink / raw) To: Tristan Gingold; +Cc: gdb On Wed, 2010-10-20 at 16:20 +0200, Tristan Gingold wrote: > Could you post the log messages ? I suppose that if no binary is > built, then an error has occurred. > > Not sure why you try to build such a tool, as it would be basically > useless to debug. > Hi found the bug - there must be some typo/bug in your build system as it does not build the gdb/ directory at all with --target=x86_64-darwin! I had to run configure in topdir first then after it finishes cd gdb, then rerun same configure (--target=x86_64-darwin) in gdb dir, make, cd .. && make install. This worked and gives me: l /usr/local/gdb/bin/ total 44032 drwxr-xr-x 2 root root 4096 2010-10-20 16:22 ./ drwxr-xr-x 6 root root 4096 2010-10-20 16:05 ../ -rwxr-xr-x 1 root root 17567402 2010-10-20 16:22 x86_64-apple-darwin-gdb* -rwxr-xr-x 1 root root 17567431 2010-10-20 16:22 x86_64-apple-darwin-gdbtui* BUT, there is another issue now. The so generated x86_64-apple-darwin-gdb* does not recognize 64bit binaries: (e.g. /home/exchange/ls is the binary I want to debug) /usr/local/gdb/bin/x86_64-apple-darwin-gdb /home/exchange/ls GNU gdb (GDB) 7.2 Copyright (C) 2010 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 "--host= --target=x86_64-apple-darwin". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... "/home/exchange/ls": not in executable format: File format not recognized Setting up the environment for debugging gdb. WHY it says: "/home/exchange/ls": not in executable format: File format not recognized ? as I built for the darwin target? file /home/exchange/ls /home/exchange/ls: Mach-O fat file with 2 architectures ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 14:42 ` Peter Steiner @ 2010-10-20 15:12 ` Tristan Gingold [not found] ` <20101020151257.25F2D31366@nx.neverkill.us> 1 sibling, 0 replies; 15+ messages in thread From: Tristan Gingold @ 2010-10-20 15:12 UTC (permalink / raw) To: Peter Steiner; +Cc: gdb On Oct 20, 2010, at 4:42 PM, Peter Steiner wrote: > On Wed, 2010-10-20 at 16:20 +0200, Tristan Gingold wrote: >> Could you post the log messages ? I suppose that if no binary is >> built, then an error has occurred. >> >> Not sure why you try to build such a tool, as it would be basically >> useless to debug. > "/home/exchange/ls": not in executable format: File format not > recognized > Setting up the environment for debugging gdb. > > WHY it says: > > "/home/exchange/ls": not in executable format: File format not > recognized > > ? > > as I built for the darwin target? > file /home/exchange/ls > /home/exchange/ls: Mach-O fat file with 2 architectures You can't debug fat binaries. You have to extract the executable you really want to debug. ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <20101020151257.25F2D31366@nx.neverkill.us>]
* Re: gdb darwin target on Linux host? [not found] ` <20101020151257.25F2D31366@nx.neverkill.us> @ 2010-10-20 15:24 ` Peter Steiner 2010-10-20 17:12 ` Stan Shebs 2010-10-20 15:35 ` Peter Steiner [not found] ` <1287588922.28107.281.camel@hp> 2 siblings, 1 reply; 15+ messages in thread From: Peter Steiner @ 2010-10-20 15:24 UTC (permalink / raw) To: Tristan Gingold; +Cc: gdb > > file /home/exchange/ls > > /home/exchange/ls: Mach-O fat file with 2 architectures > > You can't debug fat binaries. You have to extract the executable you really want to debug. > ok - but the packaged Apple darwin gdb (shipped with my install) CAN read the native binaries. So, what is the difference? Another/patched libbfd used by Apple? (e.g. http://www.opensource.apple.com/tarballs/gdb/gdb-1469.tar.gz gdb version is 6.3.50.20050815-cvs) however I do not want to debug natively (or my question here would be pointless), I want to cross-debug using a Linux host. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 15:24 ` Peter Steiner @ 2010-10-20 17:12 ` Stan Shebs 2010-10-21 7:49 ` Tristan Gingold 0 siblings, 1 reply; 15+ messages in thread From: Stan Shebs @ 2010-10-20 17:12 UTC (permalink / raw) To: gdb On 10/20/10 8:24 AM, Peter Steiner wrote: > ok - but the packaged Apple darwin gdb (shipped with my install) CAN > read the native binaries. So, what is the difference? Another/patched > libbfd used by Apple? > > (e.g. http://www.opensource.apple.com/tarballs/gdb/gdb-1469.tar.gz > gdb version is 6.3.50.20050815-cvs) "Patched" is, shall we say, an understatement. :-) > however I do not want to debug natively (or my question here would be > pointless), I want to cross-debug using a Linux host. So, uh, once you get the executable read in, how exactly do you expect to remote-control execution from Linux-land? Is there a Darwin GDBserver or equivalent that I don't know of? There is a kernel debugging setup, but it's not useful for apps. Stan ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? 2010-10-20 17:12 ` Stan Shebs @ 2010-10-21 7:49 ` Tristan Gingold 0 siblings, 0 replies; 15+ messages in thread From: Tristan Gingold @ 2010-10-21 7:49 UTC (permalink / raw) To: Stan Shebs; +Cc: gdb On Oct 20, 2010, at 7:12 PM, Stan Shebs wrote: > >> however I do not want to debug natively (or my question here would be >> pointless), I want to cross-debug using a Linux host. > > So, uh, once you get the executable read in, how exactly do you expect to remote-control execution from Linux-land? Is there a Darwin GDBserver or equivalent that I don't know of? As far as I know, no. Tristan. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb darwin target on Linux host? [not found] ` <20101020151257.25F2D31366@nx.neverkill.us> 2010-10-20 15:24 ` Peter Steiner @ 2010-10-20 15:35 ` Peter Steiner [not found] ` <1287588922.28107.281.camel@hp> 2 siblings, 0 replies; 15+ messages in thread From: Peter Steiner @ 2010-10-20 15:35 UTC (permalink / raw) To: Tristan Gingold; +Cc: gdb > > file /home/exchange/ls > > /home/exchange/ls: Mach-O fat file with 2 architectures > > You can't debug fat binaries. You have to extract the executable you really want to debug. > tried this - no luck at all! lipo -extract x86_64 /bin/ls -output ls.64 lipo -extract i386 /bin/ls -output ls.32 gdb-7.2 root# ./gdb/gdb /opt/src/ls.64 GNU gdb (GDB) 7.2 Copyright (C) 2010 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-apple-darwin10.0.0". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... "/opt/src/ls.64": not in executable format: File format not recognized gdb-7.2 root# ./gdb/gdb /opt/src/ls.32 GNU gdb (GDB) 7.2 Copyright (C) 2010 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-apple-darwin10.0.0". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... "/opt/src/ls.32": not in executable format: File format not recognized (this is all native darwin box) ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <1287588922.28107.281.camel@hp>]
* Re: gdb darwin target on Linux host? [not found] ` <1287588922.28107.281.camel@hp> @ 2010-10-20 15:45 ` Paul Starzetz 0 siblings, 0 replies; 15+ messages in thread From: Paul Starzetz @ 2010-10-20 15:45 UTC (permalink / raw) To: Tristan Gingold; +Cc: gdb On Wed, 2010-10-20 at 17:35 +0200, Peter Steiner wrote: > > > file /home/exchange/ls > > > /home/exchange/ls: Mach-O fat file with 2 architectures > > > > You can't debug fat binaries. You have to extract the executable you really want to debug. > > > > tried this - no luck at all! > > lipo -extract x86_64 /bin/ls -output ls.64 > lipo -extract i386 /bin/ls -output ls.32 ok ok I see my error... I must use -thin: lipo -thin x86_64 /bin/ls -output ls.64 now I can load it into native box gdb7.2: gdb-7.2 root# ./gdb/gdb /opt/src/ls.64 GNU gdb (GDB) 7.2 Copyright (C) 2010 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-apple-darwin10.0.0". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /opt/src/ls.64...(no debugging symbols found)...done. BUT: on a cross-gdb compiled on Linux host I get now another error trying to read the "thinned" ls.64: gdb-7.2/gdb # /usr/local/gdb/bin/x86_64-apple-darwin-gdb /home/exchange/ls.64 GNU gdb (GDB) 7.2 Copyright (C) 2010 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 "--host= --target=x86_64-apple-darwin". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/exchange/ls.64...I'm sorry, Dave, I can't do that. Symbol format `mach-o-x86-64' unknown. Setting up the environment for debugging gdb. why is that? I compiled on native darwin and Linux from the same tarball 7.2. ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2010-10-21 7:49 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-20 13:53 gdb darwin target on Linux host? Peter Steiner
2010-10-20 14:20 ` Tristan Gingold
2010-10-20 14:26 ` Pedro Alves
2010-10-20 14:41 ` Tristan Gingold
2010-10-20 14:50 ` Pedro Alves
2010-10-20 14:52 ` Nathan Froyd
2010-10-20 15:09 ` Pedro Alves
[not found] ` <20101020150949.4841131366@nx.neverkill.us>
2010-10-20 15:15 ` Peter Steiner
[not found] ` <20101020143016.6BE9131366@nx.neverkill.us>
2010-10-20 14:42 ` Peter Steiner
2010-10-20 15:12 ` Tristan Gingold
[not found] ` <20101020151257.25F2D31366@nx.neverkill.us>
2010-10-20 15:24 ` Peter Steiner
2010-10-20 17:12 ` Stan Shebs
2010-10-21 7:49 ` Tristan Gingold
2010-10-20 15:35 ` Peter Steiner
[not found] ` <1287588922.28107.281.camel@hp>
2010-10-20 15:45 ` Paul Starzetz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox