From: Maxim Kuvyrkov <maxim@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Nathan Sidwell <nathan@codesourcery.com>,
Vladimir Prus <vladimir@codesourcery.com>,
Daniel Jacobowitz <dan@codesourcery.com>
Subject: [PATCH, M68K] Add regformat file for ColdFire registers
Date: Tue, 17 Nov 2009 12:28:00 -0000 [thread overview]
Message-ID: <4B0296C4.8070401@codesourcery.com> (raw)
In-Reply-To: <4B029388.5070001@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
The following patch adds regformat entry for the ColdFire registers and
adjusts configure scripts to select between the two register formats:
reg-m68k.dat and reg-cf.dat.
OK to apply?
Thanks,
--
Maxim Kuvyrkov
CodeSourcery
maxim@codesourcery.com
(650) 331-3385 x724
[-- Attachment #2: fsf-gdb-m68k-regs.ChangeLog --]
[-- Type: text/plain, Size: 444 bytes --]
2009-11-17 Nathan Sidwell <nathan@codesourcery.com>
2009-11-17 Vladimir Prus <vladimir@codesourcery.com>
* Makefile.in (reg-cf.o, reg-cf.c): New targets.
* configure.ac: Check for __mcoldfire__ and set
gdb_cv_m68k_is_coldfire.
* configure.srv: Use gdb_cv_m68k_is_coldfire to select between
reg-cf.o and reg-m68k.o.
* configure: Regenerated.
2009-11-17 Nathan Sidwell <nathan@codesourcery.com>
* regformats/reg-cf.dat: New file.
[-- Attachment #3: fsf-gdb-m68k-regs.patch --]
[-- Type: text/plain, Size: 4527 bytes --]
ChangeLog.regs | 10 ++++++++++
gdb/gdbserver/Makefile.in | 3 +++
gdb/gdbserver/configure | 29 +++++++++++++++++++++++++++++
gdb/gdbserver/configure.ac | 12 ++++++++++++
gdb/gdbserver/configure.srv | 12 ++++++++++--
gdb/regformats/reg-cf.dat | 33 +++++++++++++++++++++++++++++++++
6 files changed, 97 insertions(+), 2 deletions(-)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 155094b..cfd9d0f 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -359,6 +359,9 @@ reg-m32r.c : $(srcdir)/../regformats/reg-m32r.dat $(regdat_sh)
reg-m68k.o : reg-m68k.c $(regdef_h)
reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c
+reg-cf.o : reg-cf.c $(regdef_h)
+reg-cf.c : $(srcdir)/../regformats/reg-cf.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-cf.dat reg-cf.c
mips-linux.o : mips-linux.c $(regdef_h)
mips-linux.c : $(srcdir)/../regformats/mips-linux.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips-linux.dat mips-linux.c
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 955f716..93aeb78 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -4005,6 +4005,35 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_i386_is_x86_64" >&5
$as_echo "$gdb_cv_i386_is_x86_64" >&6; }
;;
+ m68k-*-*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for Coldfire" >&5
+$as_echo_n "checking if building for Coldfire... " >&6; }
+if test "${gdb_cv_m68k_is_coldfire+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $CFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef __mcoldfire__
+got it
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "got it" >/dev/null 2>&1; then :
+ gdb_cv_m68k_is_coldfire=yes
+else
+ gdb_cv_m68k_is_coldfire=no
+fi
+rm -f conftest*
+
+ CPPFLAGS="$save_CPPFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_m68k_is_coldfire" >&5
+$as_echo "$gdb_cv_m68k_is_coldfire" >&6; }
+ ;;
esac
. ${srcdir}/configure.srv
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 57eaf21..215387d 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -90,6 +90,18 @@ got it
[gdb_cv_i386_is_x86_64=no])
CPPFLAGS="$save_CPPFLAGS"])
;;
+ m68k-*-*)
+ AC_CACHE_CHECK([if building for Coldfire], [gdb_cv_m68k_is_coldfire],
+ [save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $CFLAGS"
+ AC_EGREP_CPP([got it], [
+#ifdef __mcoldfire__
+got it
+#endif
+ ], [gdb_cv_m68k_is_coldfire=yes],
+ [gdb_cv_m68k_is_coldfire=no])
+ CPPFLAGS="$save_CPPFLAGS"])
+ ;;
esac
. ${srcdir}/configure.srv
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index ea746be..1814b0e 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -98,13 +98,21 @@ case "${target}" in
srv_linux_usrregs=yes
srv_linux_thread_db=yes
;;
- m68*-*-linux*) srv_regobj=reg-m68k.o
+ m68*-*-linux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then
+ srv_regobj=reg-cf.o
+ else
+ src_regobj=reg-m68k.o
+ fi
srv_tgtobj="linux-low.o linux-m68k-low.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
- m68*-*-uclinux*) srv_regobj=reg-m68k.o
+ m68*-*-uclinux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then
+ srv_regobj=reg-cf.o
+ else
+ src_regobj=reg-m68k.o
+ fi
srv_tgtobj="linux-low.o linux-m68k-low.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
diff --git a/gdb/regformats/reg-cf.dat b/gdb/regformats/reg-cf.dat
new file mode 100644
index 0000000..068aa75
--- /dev/null
+++ b/gdb/regformats/reg-cf.dat
@@ -0,0 +1,33 @@
+name:m68k
+expedite:sp,fp,pc
+32:d0
+32:d1
+32:d2
+32:d3
+32:d4
+32:d5
+32:d6
+32:d7
+32:a0
+32:a1
+32:a2
+32:a3
+32:a4
+32:a5
+32:fp
+32:sp
+32:ps
+32:pc
+
+64:fp0
+64:fp1
+64:fp2
+64:fp3
+64:fp4
+64:fp5
+64:fp6
+64:fp7
+
+32:fpcontrol
+32:fpstatus
+32:fpiaddr
next prev parent reply other threads:[~2009-11-17 12:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 12:15 [PATCHES, M68K] Various fixes and improvements for M68K and ColdFire Maxim Kuvyrkov
2009-11-17 12:22 ` [PATCH, M68K] Handle lack of FPU registers Maxim Kuvyrkov
2009-11-17 12:28 ` Maxim Kuvyrkov [this message]
2009-11-17 12:34 ` [PATCH, M68K] Fix initialization Maxim Kuvyrkov
2009-11-17 12:36 ` [PATCH, M68K] Support xml testsuite Maxim Kuvyrkov
2009-11-17 15:40 ` [PATCHES, M68K] Various fixes and improvements for M68K and ColdFire Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B0296C4.8070401@codesourcery.com \
--to=maxim@codesourcery.com \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=nathan@codesourcery.com \
--cc=vladimir@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox