public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "Tadej.Pecar@elaphe-ev.com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/31681] [powerpc] presence of SPE disables VLE instruction decoding
Date: Wed, 24 Apr 2024 20:16:04 +0000	[thread overview]
Message-ID: <bug-31681-4717-64Ir4Ur40o@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31681-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31681

--- Comment #3 from Tadej Pečar <Tadej.Pecar@elaphe-ev.com> ---
A quick hack that disables the SPE check, provides VLE variant & drops support
for VLE / non-VLE mixing in ppc-dis.c seems to get the disassembly going, but
this obviously can't be considered a final solution.

Need to clean it up.

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 23397d0..6a2d943 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3506,6 +3506,8 @@ static struct ppc_variant variants[] =
    bfd_mach_ppc_7400, &tdesc_powerpc_7400},
   {"e500", "Motorola PowerPC e500", bfd_arch_powerpc,
    bfd_mach_ppc_e500, &tdesc_powerpc_e500},
+  {"vle", "Motorola PowerPC VLE", bfd_arch_powerpc,
+   bfd_mach_ppc_vle, &tdesc_powerpc_e500},

   /* 64-bit */
   {"powerpc64", "PowerPC 64-bit user-level", bfd_arch_powerpc,
@@ -7565,7 +7567,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct
gdbarch_list *arches)
      which looks at each instruction and determines which unit (and
      which version of it) can execute it.  Grovel through the section
      looking for relevant e500 APUs.  */
-
+#if 0
   if (bfd_uses_spe_extensions (info.abfd))
     {
       arch = info.bfd_arch_info->arch;
@@ -7573,7 +7575,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct
gdbarch_list *arches)
       bfd_default_set_arch_mach (&abfd, arch, mach);
       info.bfd_arch_info = bfd_get_arch_info (&abfd);
     }
-
+#endif
   /* Find a default target description which describes our register
      layout, if we do not already have one.  */
   if (! tdesc_has_registers (tdesc))
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index d97137d..a5694c4 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -297,14 +297,14 @@ get_powerpc_dialect (struct disassemble_info *info)
     dialect = private_data (info)->dialect;

   /* Disassemble according to the section headers flags for VLE-mode.  */
-  if (dialect & PPC_OPCODE_VLE
-      && info->section != NULL && info->section->owner != NULL
-      && bfd_get_flavour (info->section->owner) == bfd_target_elf_flavour
-      && elf_object_id (info->section->owner) == PPC32_ELF_DATA
-      && (elf_section_flags (info->section) & SHF_PPC_VLE) != 0)
+//  if (dialect & PPC_OPCODE_VLE
+//      && info->section != NULL && info->section->owner != NULL
+//      && bfd_get_flavour (info->section->owner) == bfd_target_elf_flavour
+//      && elf_object_id (info->section->owner) == PPC32_ELF_DATA
+//      && (elf_section_flags (info->section) & SHF_PPC_VLE) != 0)
     return dialect;
-  else
-    return dialect & ~ PPC_OPCODE_VLE;
+//  else
+//    return dialect & ~ PPC_OPCODE_VLE;
 }

 /* Handle -m and -M options that set cpu type, and .machine arg.  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2024-04-24 20:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 13:33 [Bug tdep/31681] New: " Tadej.Pecar@elaphe-ev.com
2024-04-24 19:37 ` [Bug tdep/31681] " tromey at sourceware dot org
2024-04-24 19:47 ` Tadej.Pecar@elaphe-ev.com
2024-04-24 20:16 ` Tadej.Pecar@elaphe-ev.com [this message]

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=bug-31681-4717-64Ir4Ur40o@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).