[coldfire-gnu-discuss] Linux debug with P&E BDM - Toolchain Sourcery G++ Lite 4.2-125
Malnar, Tom
Tom.Malnar at christiedigital.com
Wed Oct 1 22:14:56 UTC 2008
We are doing the same thing with windows, eclipse and GDB. We ran into the same issue and the set solib-absolute-prefix fixed us.
Looking at your line you point to your libs source directory. I believe the shared libraries use the root as a starting path in the debugger (I may be wrong). We set "solib-absolute-prefix" to our root directory.
These are indicating your path is wrong and I think its assuming root because of the '/lib':
&"Error while mapping shared library sections:\n"
&"/lib/libc.so.6: No such file or directory.\n"
Error while mapping shared library sections:
/lib/libc.so.6: No such file or directory.
Error while mapping shared library sections:
&"Error while mapping shared library sections:\n"
&"/lib/ld.so.1: No such file or directory.\n"
/lib/ld.so.1: No such file or directory.
Try changing the path followed by the gdb command "info shared" to see if it found the libraries.
-----Original Message-----
From: raul.moreno at telvent.com [mailto:raul.moreno at telvent.com]
Sent: Wednesday, October 01, 2008 8:30 AM
To: coldfire-gnu-discuss at codesourcery.com
Subject: [coldfire-gnu-discuss] Linux debug with P&E BDM - Toolchain Sourcery G++ Lite 4.2-125
Hi everybody!
Currently I have two different problem, but both related to the debugging.
I am using a M5484Lite EVB. I downloaded the Sourcery G++ Lite 4.2-125
toolchain and I want to use Linux as the operating system, so I use the
m68k-linux-gnu- commands.
I know it sounds weird, but the team works in Windows. We installed the
Eclipse on Windows, in spite of developing to a Linux target. We followed
as a guide a pair of example I found in internet about how to add a CDT
plug to Eclipse (document "Open source Coldfire IDE" and "ARM cross
development with GNU Toolchain and Eclipse").
Here the problem goes:
1. Applications debug. First of all I have to say I have been able to debug
a simple application! But I still have a doubt about the libraries.
I use the gdbserver in the target and m68k-linux-gnu-gdb in the host.
Next I show what appears in the console:
189-gdb-set confirm off
189^done
(gdb)
190-gdb-set width 0
190^done
(gdb)
191-gdb-set height 0
191^done
192-interpreter-exec console echo
(gdb)
192^done
(gdb)
193-gdb-show prompt
193^done,value="(gdb) "
(gdb)
194 set solib-absolute-prefix
C:\\Toolchain_CodeSourcery\\m68k-linux-gnu\\libc\\usr\\lib
&"set solib-absolute-prefix
C:\\\\Toolchain_CodeSourcery\\\\m68k-linux-gnu\\\\libc\\\\usr\\\\lib \n"
set solib-absolute-prefix
C:\Toolchain_CodeSourcery\m68k-linux-gnu\libc\usr\lib
194^done
195 set remote exec-file Hello.elf
(gdb)
&"set remote exec-file Hello.elf \n"
195^done
set remote exec-file Hello.elf
196 target remote 172.19.134.100:2345
(gdb)
&"target remote 172.19.134.100:2345\n"
target remote 172.19.134.100:2345
~"[New Thread 206]\n"
[New Thread 206]
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
&"warning: Unable to find dynamic linker breakpoint function.\nGDB will be
unable to debug shared library initializers\nand track explicitly loaded
dynamic code."
&"\n"
~"0x80005cdc in ?? ()\n"
0x80005cdc in ?? ()
196^done
197-stack-list-frames
(gdb)
197^done,stack=[frame={level="0",addr="0x80005cdc",func="??"},frame={level="1",addr="0x00000001",func="??"},frame={level="2",addr="0xbfe9df6d",func="??"},frame={level="3",addr="0x00000000",func="??"}]
...
217 c
&"c\n"
c
&"Error while mapping shared library sections:\n"
&"/lib/libc.so.6: No such file or directory.\n"
Error while mapping shared library sections:
/lib/libc.so.6: No such file or directory.
Error while mapping shared library sections:
&"Error while mapping shared library sections:\n"
&"/lib/ld.so.1: No such file or directory.\n"
/lib/ld.so.1: No such file or directory.
~"\nBreakpoint "
Breakpoint ~"1, main (arg=1, argv=0xbfe9dec4) at main.c:15\n"
1, main (arg=1, argv=0xbfe9dec4) at main.c:15
~"15\t\tint a = 2;\n"
15 int a = 2;
217^done
...
Red lines show the probems I've got. I thought I would solve the first red
errors using "set solib-absolute-prefix" or "set sysroot", but it didn't. I
am not sure if it just says I can't debug the shared libraries.
The second one I don't know what it means (error mapping libraries???).
However, I can debug right.
2. Linux kernel debug. First I try to to debug the Linux kernel from the
command-line and after that I'll try to do it with Eclipse. I continue
working on Windows, although if it was completely necessary, I would do on
Linux, only for the kernel.
I have a P&E Parallel Port Cable BDM and a USBMultilink and it seems, both
work:
C:\Toolchain_CodeSourcery\bin>m68k-linux-gnu-sprite.exe -i
CodeSourcery ColdFire Debug Sprite (Sourcery G++ Lite 4.2-125)
pe: [speed=<n:0-31>&memory-timeout=<n:0-99>] P&E Adaptor
pe://USBMultilink/PE6015776 - USB1 : USB-ML-CF Rev C (PE6015776)
pe://CycloneProMaxSerial:1 - COM1 : Serial Port 1
pe://ParallelPortCable:1 - LPT1 : Parallel Port 1 (Address $0378)
ccs: [timeout=<n>&speed=<n>] CCS Adaptor
ccs://$Host:$Port/$Chain_position - CCS address
tblcf: TBLCF Interface
I am trying with the parallel one. I create the xml for my board
m5484Liteevb.xml:
<?xml version="1.0"?>
<!DOCTYPE board SYSTEM "board.dtd">
<!-- Description for m54854Lite Evaluation Board
Version:Sourcery G++ Lite 4.2-125
BugURL:https://support.codesourcery.com/GNUToolchain/
Copyright 2007, 2008 CodeSourcery.
The authors hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose,
provided
that existing copyright notices are retained in all copies and that
this
notice is included verbatim in any distributions. No written
agreement,
license, or royalty fee is required for any of the authorized uses.
Modifications to this software may be copyrighted by their authors
and need not follow the licensing terms described here, provided that
the new terms are clearly indicated on the first page of each file
where
they apply. -->
<board>
<properties>
<property name="cache"/>
</properties>
<initialize>
<!-- If MBAR changes all following writes must change
and if a memory configuration file is used,
the reserved areas in the register block must
change also. -->
<!-- Turn on MBAR at 0x1000_0000 -->
<write-register address="0xc0f" value="0x10000000"/>
<!-- Turn on RAMBAR0 at address 2000_0000 -->
<write-register address="0xc04" value="0x20000021"/>
<!-- Turn on RAMBAR1 at address 2000_1000 -->
<write-register address="0xc05" value="0x20001021"/>
<!-- Init CS0 (BootFLASH @ FE00_0000 - FE1F_FFFF 2Mbytes) -->
<write-memory address="0x10000500" value="0xfe000000"/>
<write-memory address="0x10000508" value="0x1980"/>
<write-memory address="0x10000504" value="0x1f0001"/>
<!-- SDRAM Initialization @ 0000_0000 - 03FF_FFFF 64Mbytes -->
<write-memory address="0x10000004" value="0x2aa"/>
<write-memory address="0x10000020" value="0x19"/>
<write-memory address="0x10000024" value="0x0"/>
<write-memory address="0x10000108" value="0x53722930"/>
<write-memory address="0x1000010c" value="0x24330000"/>
<write-memory address="0x10000104" value="0xe10f0002"/>
<write-memory address="0x10000100" value="0x40010000"/>
<write-memory address="0x10000100" value="0x5890000"/>
<write-memory address="0x10000104" value="0xe10f0002"/>
<write-memory address="0x10000104" value="0xe10f0004"/>
<write-memory address="0x10000104" value="0xe10f0004"/>
<write-memory address="0x10000100" value="0x1890000"/>
<write-memory address="0x10000104" value="0x710f0f00"/>
<delay time="100ms"/>
</initialize>
<memory-map>
<memory-device address="0x00000000" size="64MB" type="ram">
<description>64MBytes DDR SDRAM</description>
</memory-device>
<memory-device address="0x20000000" size="4KB" type="ram">
<description>4KBytes Internal SRAM</description>
</memory-device>
<memory-device address="0x20001000" size="4KB" type="ram">
<description>4KBytes Internal SRAM</description>
</memory-device>
<memory-device address="0xfe000000" size="4MB" type="flash"
device="cfi">
<description>4MBytes External BootFlash, 16bit wide</description>
</memory-device>
</memory-map>
</board>
Next
C:\Toolchain_CodeSourcery\bin>m68k-linux-gnu-gdb.exe
C:\\Proyectos\\workspace_Ec
lipseCF\\Linux_kernel\\vmlinux
GNU gdb (Sourcery G++ Lite 4.2-125) 6.7.50.20080107-cvs
Copyright (C) 2008 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=i686-mingw32 --target=m68k-linux-gnu".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>.
..
<-linux-gnu-sprite.exe pe://ParallelPortCable m5484Liteevb
Remote debugging using | m68k-linux-gnu-sprite.exe pe://ParallelPortCable
m5484L
iteevb
m68k-linux-gnu-sprite: Opening P&E ParallelPortCable port 1 (LPT1 :
Parallel Por
t 1 (Address $0378))
m68k-linux-gnu-sprite: Target reset
0x00000000 in ?? ()
(gdb) load
Loading section .text.head, size 0x102a lma 0x20000
Loading section .text, size 0x1a1512 lma 0x2102c
Loading section .cpuinit.text, size 0xa26 lma 0x1c2540
Loading section .meminit.text, size 0x1aa lma 0x1c2f66
Loading section __ex_table, size 0x26d0 lma 0x1c3110
Loading section .rodata, size 0x4a943 lma 0x1c6000
Loading section .pci_fixup, size 0x580 lma 0x210944
Loading section __ksymtab, size 0x3ee8 lma 0x210ec4
Loading section __ksymtab_gpl, size 0x14f0 lma 0x214dac
Loading section __ksymtab_strings, size 0xb172 lma 0x21629c
Loading section __param, size 0xbf0 lma 0x221410
Loading section .data, size 0x10b40 lma 0x222000
Loading section .cpuinit.data, size 0x32 lma 0x232b40
Loading section .meminit.data, size 0xc lma 0x232b72
Loading section .data.cacheline_aligned, size 0xb0 lma 0x232b80
Loading section .notes, size 0x24 lma 0x232c30
Loading section .init.text, size 0x1223e lma 0x234000
Loading section .init.data, size 0x168c lma 0x24623e
Loading section .init.setup, size 0x264 lma 0x2478d0
Loading section .initcall.init, size 0x1f4 lma 0x247b34
Loading section .con_initcall.init, size 0x8 lma 0x247d28
Loading section .init.ramfs, size 0x86 lma 0x248000
Loading section .data.init_task, size 0x2000 lma 0x24a000
Start address 0x20000, load size 2261467
Transfer rate: 6 KB/sec, 7463 bytes/write.
(gdb) break start_kernel
Breakpoint 1 at 0x2347f8: file init/main.c, line 512.
(gdb) l
1 init/main.c: No such file or directory.
in init/main.c
(gdb) c
Continuing.
Breakpoint 1, start_kernel () at init/main.c:512
512 in init/main.c
(gdb) c
Continuing.
m68k-linux-gnu-sprite: error: Hardware device not ready
Error from remote target: Hardware device not ready
(gdb)
You can see at the beginning it seems that all is OK, but after loading
the image in RAM, I try to debug but the main.c is not found.
I also tried to debug with Eclipse, but an error occurs.
Could you help with these problems?
Thanks in advance and sorry for the long message.
Raúl Moreno
***********Internet Email Confidentiality Footer*************
This email and any files transmitted with it are confidential and intended
solely for the use of the organization or individual to whom they are
addressed. It is expressly forbidden to retransmit or copy email and/or
this attached files without our permission . If you are not the
addressee indicated in this message (or responsible for delivery of the
message to such person), you may not copy or deliver this message
to anyone. In such case, you should destroy this message and kindly
notify the sender by reply email. Please advise immediately if you or
your employer does not consent to Internet email for messages of this
kind. Opinions, conclusions and other information in this message that
do not relate to the official business of my firm shall be understood as
neither given nor endorsed by it.
More information about the coldfire-gnu-discuss
mailing list