Re: Help with building gdb with BDM support for the Coldfire
"Mark Giacobbe" <[email protected]> Thu, 1 May 2008 14:43:49 -0400
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers.coldfire |
|---|---|
| Message-ID | <[email protected]> |
Before (see below), I could not use the test of
telnet localhost bdm
I would get a refused connection. I found the issue for that. The bdm file
for xinetd.d was incorrect. I had to change the path to the server. The
included one in the README was incorrect for my system.
I changed it from
service bdm
{
socket_type = stream
port = 6543
wait = no
user = root
server = /usr/sbin/bdmd
server_args = -n
log_on_failure += USERID
disable = no
}
to
service bdm
{
socket_type = stream
port = 6543
wait = no
user = root
server = /usr/local/sbin/bdmd
server_args = -n
log_on_failure += USERID
disable = no
}
for the server I had to add 'local' to the path.
Now telnet works (for both user and root) and gdb works for both user and
root. Also I changed the owner/group for m68k-bdm-elf-gdb, and
m68k-gdb-server to user (not sure if this was needed, but I did it anyway).
I did this because I configured/compiled/installed everything as root.
Anyway thanks for your help, so far everything works.
Mark
On Mon, Apr 28, 2008 at 8:52 PM, Chris Johns <[email protected]>
wrote:
> Mark Giacobbe wrote:
>
> > Hi all -
> >
> > I'm trying to build gdb with bdm support for the Coldfire. I'm not a
> > linux power user, but know enough to muddle my way through things. I'm
> > using Fedora 8 (linux 2.6.24).
> >
> > I configured gdb 6.7 (--target=m68k-bdm-elf) and gdb seems to work.
> >
> >
> The configure command does not need the bdm part any more as there is no
> BDM patch for GDB. This means '--target=m68k-elf' should work. Then again
> the bdm part does not seem to hurt.
>
> I then followed the README file in m68k-bdm-1.4-pre2 from sourceforge.
> > It took a while to get the ioperm working, but it is working so far (I can
> > connect to my custom target board at least).
> >
> > But it will only work if I run m68k-bdm-elf-gdb as root. This is how I
> > start:
> >
> > [root@localhost bin]# ./m68k-bdm-elf-gdb
> > GNU gdb 6.7
> > Copyright (C) 2007 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-pc-linux-gnu
> > --target=m68k-bdm-elf".
> >
> > (gdb) target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
> > Remote debugging using | m68k-bdm-gdbserver pipe /dev/bdmcf0
> > m68k-bdm: architecture 68000 connected to /dev/bdmcf0
> > m68k-bdm: Coldfire debug module version is 1 (5307/5407(e))
> > Process /dev/bdmcf0 created; pid = 0
> > 0xb6eb7912 in ?? ()
> > (gdb)
> >
>
> Great.
>
>
> > And this is what I get if I try to use it from my regular account:
> > [pcmadm@localhost bin]$ ./m68k-bdm-elf-gdb
> > GNU gdb 6.7
> > Copyright (C) 2007 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-pc-linux-gnu
> > --target=m68k-bdm-elf".
> >
> > (gdb) target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
> > Remote debugging using | m68k-bdm-gdbserver pipe /dev/bdmcf0
> > trying kernel driver: /dev/bdmcf0
> > trying bdm server: localhost:/dev/bdmcf0
> > Ignoring packet error, continuing...
> > warning: unrecognized item "timeout" in "qSupported" response
> > m68k-bdm: error: No such device or address
> > m68k-bdm-gdbserver: Exiting
> > Remote communication error: Resource temporarily unavailable.
> > (gdb)
> >
> > What do I have to change so I can run this from my regular user account?
> >
> >
> The ioperm system call requires the program run as root. If you run gdb as
> a normal user (which I recommend you do) we need to transfer to a root
> program somehow to make the ioperm call. The bdmd server does this. If you
> look at the doco (http://bdm.sourceforge.net/doc.html) for "Step 3:
> Installing the Server" you will see the steps needed to install the server.
>
> FYI the server is just the same BDM code from the BDM library with a
> socket interface and protocol.
>
> It would seem I have introduced a bug in the pre2 release with the
> handling of no server present. You should get a different message and not
> ones relating to 'qSupport'.
>
> Regards
> Chris
>
> ---
> [email protected] Send a post to the list.
> [email protected] Join the list.
> [email protected] Join the list in digest mode.
> [email protected] Leave the list.
>
>