Byte-order problems with GDB and BDM driver

Dario Alcocer dalcocer at home.com
Tue Jun 20 23:22:50 UTC 2000


>>>>> "Eric" == Eric Norum <eric at cls.usask.ca> writes:

    Eric> I use the gdb/BDM package on a Pentium PC (RedHat 6.1) with
    Eric> a Motorola MC68360 target with no problems.

This would mean that the driver is using cpu32_serial_clock() with
your board, and cf_pe_serial_clock() with mine.  I wonder if this
would make a difference?

    Eric> Are you sure your executable image is correct?

Hmm, yes, I'm *pretty sure* it is:

    $ cd /usr/local/rtems/tools/gdb-4.18
    $ cat config.status
    #!/bin/sh
    # This file was generated automatically by configure.  Do not edit.
    # This directory was configured as follows:
    ./configure --host=i686-pc-linux-gnu --target=m68k-bdm-elf
    --prefix=/opt/rtems/gdb --verbose --norecursion 
    # 
    $ ls -l gdb/gdb
    -rwxrwxr-x   1 alcocer  software  3659379 Jun 20 10:51 gdb/gdb*
    $ ls -l /opt/rtems/gdb/bin/m68k-bdm-elf-gdb 
    -rwxr-xr-x   1 alcocer  alcocer   3659379 Jun 20 10:51 /opt/rtems/gdb/bin/m68k-bdm-elf-gdb*
    $ cmp gdb/gdb
    $ 

    Eric> What version of the gdb/BDM package are you using?

I'm using gdb-4.18, with the BDM and RTEMS patches applied:

    $ md5sum ../archive/gdb-4.18.tar.gz 
    828d28487af6cec074639c1102569473  ../archive/gdb-4.18.tar.gz
    $ md5sum ../archive/gdb-4.18-bdm-000131.tgz 
    c90cb1ac658f07c5f1ef9304d192f882  ../archive/gdb-4.18-bdm-000131.tgz
    $ md5sum ../archive/gdb-4.18-rtems-20000524.diff.gz 
    72f00b298c95d968212c8b77c240aca3  ../archive/gdb-4.18-rtems-20000524.diff.gz
    $ tar xzvf ../archive/gdb-4.18.tar.gz
    $ tar xzf ../archive/gdb-4.18-bdm-000131.tgz
    $ cd gdb-4.18
    $ patch -p1 < ../gdb-4.18-bdm/gdbPatches/gdb-4.18-patch 
    patching file `gdb/Makefile.in'
    Hunk #1 succeeded at 949 with fuzz 2.
    patching file `gdb/config/m68k/bdm.mt'
    patching file `gdb/config/m68k/tm-bdm.h'
    patching file `gdb/configure.tgt'
    patching file `gdb/doc/all-cfg.texi'
    patching file `gdb/doc/gdb.texinfo'
    patching file `gdb/doc/remote.texi'
    patching file `gdb/findvar.c'
    patching file `gdb/remote-m68k-bdm.c'
    $ zcat ../../archive/gdb-4.18-rtems-20000524.diff.gz | patch -p1
    patching file `bfd/config.bfd'
    patching file `config.sub'
    patching file `gdb/167bug-rom.c'
    patching file `gdb/ChangeLog'
    patching file `gdb/Makefile.in'
    Hunk #7 succeeded at 952 with fuzz 2.
    Hunk #12 succeeded at 1566 (offset 3 lines).
    patching file `gdb/config/i386/i386RTEMS.mt'
    patching file `gdb/config/i386/i386classix.mt'
    patching file `gdb/config/i386/tm-i386.h'
    patching file `gdb/config/i386/tm-i386rte.h'
    patching file `gdb/config/m68k/m68kclassix.mt'
    patching file `gdb/config/m68k/monitor.mt'
    patching file `gdb/config/powerpc/powerpcclassix_elf.mt'
    patching file `gdb/config/powerpc/ppc-eabi.mt'
    patching file `gdb/config/powerpc/ppc-sim.mt'
    patching file `gdb/config/powerpc/rtems.mt'
    patching file `gdb/config/powerpc/tm-ppc-rtems.h'
    patching file `gdb/config/sparc/sparc-em.mt'
    patching file `gdb/config/sparc/sparcclassix.mt'
    patching file `gdb/config/sparc/sparcclassix_aout.mt'
    patching file `gdb/config/sparc/sparcclassix_elf.mt'
    patching file `gdb/configure.in'
    patching file `gdb/configure'
    patching file `gdb/configure.tgt'
    Hunk #5 succeeded at 164 with fuzz 1 (offset 1 line).
    Hunk #7 succeeded at 237 (offset 1 line).
    Hunk #9 succeeded at 259 (offset 1 line).
    patching file `gdb/dbxread.c'
    patching file `gdb/defs.h'
    patching file `gdb/demangle.c'
    patching file `gdb/dwarfread.c'
    patching file `gdb/eppcbug-rom.c'
    patching file `gdb/gdbthread.h'
    patching file `gdb/inflow.c'
    patching file `gdb/infptrace.c'
    patching file `gdb/infrun.c'
    patching file `gdb/m68k-tdep.c'
    patching file `gdb/main.c'
    patching file `gdb/ppc2dink32-rom.c'
    patching file `gdb/printcmd.c'
    patching file `gdb/remote-rte.c'
    patching file `gdb/rtems/Makefile.in'
    patching file `gdb/rtems/configure.in'
    patching file `gdb/rtems/configure'
    patching file `gdb/rtems/i386/remdeb_f.x'
    patching file `gdb/rtems/m68k/remdeb_f.x'
    patching file `gdb/rtems/powerpc/remdeb_f.x'
    patching file `gdb/rtems/remdeb.x'
    patching file `gdb/rtems/rteRemDeb.x'
    patching file `gdb/rtems/servcmd.h'
    patching file `gdb/rtems/sparc/remdeb_f.x'
    patching file `gdb/rtems/sparc-v9/remdeb_f.x'
    patching file `gdb/rtems.c'
    patching file `gdb/thread.c'
    patching file `gdb/thread.h'
    patching file `gdb/thread_rte.c'
    patching file `gdb/thread_rte.h'
    patching file `include/ChangeLog'
    patching file `include/demangle.h'
    patching file `include/elf/reloc-macros.h'
    patching file `intl/config.h'
    patching file `libiberty/cplus-dem.c'
    patching file `sim/ChangeLog'
    patching file `sim/configure.in'
    patching file `sim/configure'
    patching file `sim/erc32/Makefile.in'
    patching file `sim/ppc/ChangeLog'
    patching file `sim/ppc/Makefile.in'
    patching file `sim/ppc/aclocal/sysv-ipc.m4'
    patching file `sim/ppc/configure.in'
    patching file `sim/ppc/configure'
    patching file `sim/ppc/debug.c'
    patching file `sim/ppc/debug.h'
    patching file `sim/ppc/emul_unix.c'
    patching file `sim/ppc/events.c'
    patching file `sim/ppc/hw_sem.c'
    patching file `sim/ppc/hw_shm.c'
    patching file `sim/ppc/interrupts.c'

I verfied that this is the verison I'm running by rebuilding the image
with 'make' without using the 'install' target and comparing
gdb-4.18/gdb and /opt/rtems/gdb/bin/m68k-bdm-elf-gdb using cmp(1):

    $ ls -l gdb/gdb
    -rwxrwxr-x   1 alcocer  software  3659379 Jun 20 15:30 gdb/gdb*
    $ ll /opt/rtems/gdb/bin/m68k-bdm-elf-gdb 
    -rwxr-xr-x   1 alcocer  alcocer   3659379 Jun 20 10:51
    /opt/rtems/gdb/bin/m68k-bdm-elf-gdb*
    $ cmp gdb/gdb /opt/rtems/gdb/bin/m68k-bdm-elf-gdb 
    $ ll /opt/rtems/gdb/bin/m68k-bdm-elf-gdb 
    -rwxr-xr-x   1 alcocer  alcocer   3659379 Jun 20 10:51
    /opt/rtems/gdb/bin/m68k-bdm-elf-gdb*
    $ date
    Tue Jun 20 15:32:52 PDT 2000
    $ 

Any thoughts on how to fix this would be *greatly* appreciated.

-- 
Dario Alcocer // dalcocer at home.com




More information about the users mailing list