[coldfire-gnu-discuss] uClinux & ColdFire pthread debugging using CodeSourcery 4.4-53
Harry Gunnarsson
mrharryg at gmail.com
Thu Mar 11 15:46:19 UTC 2010
Yes, I always check which lib path the compiler picks when experimenting
with -mcpu=xxxx
I know what you mean, it could be error prone picking the right binary and
making sure it is run.
Typically I NFS mount my linux host, put the binary on the nfs share.
Then on the target:
$ cd /var/mnt/jffs2_partition
$ cp /var/mnt/nfs/gdbserver .
$ cp /var/mnt/nfs/jth .
$ ./gdbserver :5000 ./jth
This is to be really sure I invoke the right gdbserver/testapp and to take
NFS out of the equation( even though it is working fine....)
In conclusion; I am pretty sure I invoke the correct binaries.
Harry
On Thu, Mar 11, 2010 at 6:56 AM, Maxim Kuvyrkov <maxim at codesourcery.com>wrote:
> On 3/10/10 7:18 PM, Harry Gunnarsson wrote:
>
>> Thanks for the reply
>>
>> Earlier, with CS 4.2, I used the -m5307 flag for compiling and linking
>>
>> As mentioned I did some more research on the options and now I typically
>> compile like this(The -D flags I don't really use, I brought them over
>> from the userspace makefiles for uClinux distro)
>>
>> m68k-uclinux-gcc -mcpu=5272 -g3 -DCONFIG_COLDFIRE -DEMBED -Dlinux
>> -D__linux__ -Dunix -D__uClinux__ -Isrc/pthread/join -DDEBUG -c
>> src/pthread/join/join.c -o objs/jthread_m68k_Ono/join.o
>> m68k-uclinux-gcc -mcpu=5272 -DCONFIG_COLDFIRE -Wl,--fatal-warnings
>> -Wl,-elf2flt -o objs/jthread_m68k_Ono/jthread_m68k_Ono.bflt
>> objs/jthread_m68k_Ono/join.o -lpthread
>>
>> Running with -v on linking, I see that the following path is used
>>
>> -L...installpath.../freescale-coldfire-4.4/bin/../m68k-uclinux/libc/m5206e/usr/lib
>>
>
> This is the correct binary.
>
>
>
>> Therefore I pick up gdbserver from this path
>>
>> freescale-coldfire-4.4/bin/../m68k-uclinux/libc/m5206e/usr/lib/bin/gdbserver
>> and put it on the target
>>
>> Then I run as usual
>> gdbserver :5000 ./jth...bflt
>>
>
> Are you sure you are invoking the very gdbserver you put on the target?
> May be the system gdbserver comes in PATH before the one you put on the
> target (I did this mistake a couple of times).
>
>
> --
> Maxim Kuvyrkov
> CodeSourcery
> maxim at codesourcery.com
> (650) 331-3385 x724
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20100311/74ee6bf6/attachment.html>
More information about the coldfire-gnu-discuss
mailing list