C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-19-2009, 12:28 AM   #1
Registered User
 
Join Date: Mar 2008
Location: India
Posts: 70
Cross Compiling GDB for MIPS

Iam trying to compile gdb-7.0 for mips.

Iam giving the configure options like below.

./configure --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include

Compiles well and gives me executable , when i run that i get the message like below

This GDB was configured as "x86_64-unknown-linux-gnu".

Where as the cross compiler pacakage "uclibc-crosstools_gcc-3.4.2_uclibc-20050502" mips-linux-gdb give's me the proper results like "This GDB was configured as "--host=i386-pc-linux-gnu --target=mips-linux-uclibc"

Can any body guide me where am i going wrong ?

It would be more help full if i get direct mips compiled gdbserver . My basic intention is to do the remote debugging for mips target board

Thanks
vlrk is offline   Reply With Quote
Old 10-19-2009, 08:24 AM   #2
Jaxom's & Imriel's Dad
 
Kennedy's Avatar
 
Join Date: Aug 2006
Location: Alabama
Posts: 801
Is mips-linux-* a uClibC compiler? BUILD= can be used to force the issue (of i386-pc-linux-gnu) if that is what you so choose.
Kennedy is offline   Reply With Quote
Old 10-20-2009, 11:04 PM   #3
Registered User
 
Join Date: Mar 2008
Location: India
Posts: 70
Kennedy thanks for your views,

I had a confusion in my end , when ever i was trying to run the gdb , it was executing gdb which i installed on my system not the one which i compiled for .

So once i realised that and tried to execute with ./gdb it gives me following error .

Code:
# ./gdb
bash: ./gdb: cannot execute binary file

# ll gdb
-rwxr-xr-x 1 root root 13386775 2009-10-20 11:07 gdb
I guess it compiled for mips thats the reason its not running in my environment.

Still my i have not met my requirement as i want to get gdbserver executable which i can run on my mips target board environment and gdb which i will start in my desktop system and using target remote command i can debug it.

Hope i am clear about my intentions .

Even i tried to use uClibc-0.9.30.1.tar.gz to get mips compiled gdbserver and mips-linxu-gdb unable to get the end results.

your advice / suggestiong would be highly helpfull .

thanks and regards
vlrk is offline   Reply With Quote
Old 10-20-2009, 11:09 PM   #4
Registered User
 
Join Date: Oct 2009
Location: While(1)
Posts: 316
Hey dude i think the problem is when u try to configure the GDB with MIPS

you didn't specify the location with prefix tag and it try to configure the default one which is configured with X86 linux 64 Bit

your configuration
Quote:
./configure --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include
do it like that may be it will help you

with prefix u can configure the path
Quote:
./configure --prefix=/opt/gdb/MIPS --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include
RockyMarrone is offline   Reply With Quote
Old 10-21-2009, 09:18 AM   #5
Jaxom's & Imriel's Dad
 
Kennedy's Avatar
 
Join Date: Aug 2006
Location: Alabama
Posts: 801
There are (if I can recall correctly) 4 config things: HOST, TARGET, BUILD, <something>. <something> is the one that you'll set to mips-linux -- stating that you want to debug those type binaries, but your TARGET will be for you local machine (ie, you'll want to use your native compiler to build it, but it will refer to the <something> libs when attempting to debug).

I just cannot recall what that <something> is. I'd have to download and attempt to install. Try ./configure --help for that information.
Kennedy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
buffered vs unbuffered question Overworked_PhD Linux Programming 6 07-04-2008 04:57 PM
Contiguous Array version of Linked List ampersand11 C Programming 19 10-07-2007 03:05 AM
Screwy Linker Error - VC2005 Tonto C++ Programming 5 06-19-2007 02:39 PM
Too much output in GDB MacNilly Tech Board 0 09-13-2006 12:45 PM
does gdb lie? dinjas C Programming 8 03-10-2005 05:17 PM


All times are GMT -6. The time now is 11:23 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22