From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>
Subject: [RFC] Add xmlRegisters qSupported on ppc-lynx...
Date: Tue, 05 Jun 2012 17:03:00 -0000 [thread overview]
Message-ID: <20120605170305.GA25948@adacore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]
Hi Pedro,
I was wondering if you good give some feedback on something I am trying
to do. Basically, I am working on gdbserver for powerpc-lynx178.
Version 178 of LynxOS is based on an older version of LynxOS where XCOFF
is still in use. The object format is actually identical to the one
used on AIX.
The problem is that GDB and GDBserver use different register numberings.
On the target side, the register number is the same as the ones we see
on versions 4.x and 5.x. But on the GDB side, because the objfect format
is the same as on AIX, the architecture ends up being set to
"rs6000:6000" (instead of "powerpc:common"). As a result, there are
a few discrepancies in terms of a couple of registers ("fpscr" is the
one that attracted my attention).
So, my idea was to have GDBserver tell GDB what the number is.
Unlike what I am seeing on x86 targets, I don't think we need
anything fancy because, for now, the register map is completely
static. So we don't need to configure the register map besides
setting it at initialization (init_registers_powerpc_32).
The first thing I did was update rs6000-tdep.c so that GDB would
ask for xmlRegister support. And to my surprise, that was almost
enough to get things working. All I had to do next was to update
configure.tgt to include the appropriate XML files, and things
started working. I thought I would have to confirm support for
xmlRegister first, but it looks like it's not the case.
Can you tell me what you think of the following patch? Am I going
to need to do something a little more elaborate, for instance?
I am also worrying about breaking other power targets, but I hope
not. Hopefully GDB sends a qXfer:features:read:target.xml packet,
gets an error, and falls back to the default architecture...
Thanks!
--
Joel
[-- Attachment #2: 0001-gdbserver-lynx-ppc-xml.diff --]
[-- Type: text/x-diff, Size: 1399 bytes --]
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index d037c8e..fd26caf 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -230,6 +230,9 @@ case "${target}" in
;;
powerpc-*-lynxos*) srv_regobj="powerpc-32.o"
srv_tgtobj="lynx-low.o lynx-ppc-low.o"
+ srv_xmlfiles="rs6000/powerpc-32.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
srv_lynxos=yes
;;
s390*-*-linux*) srv_regobj="s390-linux32.o"
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index f848700..2252f54 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -79,6 +79,7 @@
#include "features/rs6000/powerpc-860.c"
#include "features/rs6000/powerpc-e500.c"
#include "features/rs6000/rs6000.c"
+#include "remote.h"
/* Determine if regnum is an SPE pseudo-register. */
#define IS_SPE_PSEUDOREG(tdep, regnum) ((tdep)->ppc_ev0_regnum >= 0 \
@@ -4284,6 +4285,9 @@ _initialize_rs6000_tdep (void)
initialize_tdesc_powerpc_e500 ();
initialize_tdesc_rs6000 ();
+ /* Tell remote stub that we support XML target description. */
+ register_remote_support_xml ("powerpc");
+
/* Add root prefix command for all "set powerpc"/"show powerpc"
commands. */
add_prefix_cmd ("powerpc", no_class, set_powerpc_command,
next reply other threads:[~2012-06-05 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 17:03 Joel Brobecker [this message]
2012-06-05 18:05 ` Pedro Alves
2012-06-05 20:27 ` Joel Brobecker
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=20120605170305.GA25948@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.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