Hi, I have issue when remote debugging 32bit binary on 64bit ppc remote qemu target

罗勇刚(Yonggang Luo) via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAE2XoE_+SwYx3eWZMP6w19+u3yRGwYTS=gjw8A84vm5a=O49qw@mail.gmail.com>
According to https://sourceware.org/bugzilla/show_bug.cgi?id=19797
gdb doesn't support debugging powerpc:e6500 yet,
After quick fix by following patch:
```
 gdb/rs6000-tdep.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 84278e708e7..9e1b6633e78 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3364,6 +3364,14 @@ static struct ppc_variant variants[] =
   {"e500", "Motorola PowerPC e500", bfd_arch_powerpc,
    bfd_mach_ppc_e500, &tdesc_powerpc_e500},

+  // TODO: What's e500mc should be
+  {"e500mc", "Freescale PowerPC e500mc", bfd_arch_powerpc,
+   bfd_mach_ppc_e500mc, &tdesc_powerpc_e500},
+
+  // TOOD: Check e6500 support
+  {"e6500", "Freescale PowerPC e6500", bfd_arch_powerpc,
+   bfd_mach_ppc_e6500, &tdesc_powerpc_64},
+
   /* 64-bit */
   {"powerpc64", "PowerPC 64-bit user-level", bfd_arch_powerpc,
    bfd_mach_ppc64, &tdesc_powerpc_altivec64},
@@ -6725,6 +6733,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct
gdbarch_list *arches)
      complain for a 32-bit binary on a 64-bit target; we do not yet
      support that.  For instance, the 32-bit ABI routines expect
      32-bit GPRs.
+     TODO: How to resolve this issue:

      As long as there isn't an explicit target description, we'll
      choose one based on the BFD architecture and get a word size
```

GDB told me:
```
Also complain for a 32-bit binary on a 64-bit target; we do not yet
     support that.  For instance, the 32-bit ABI routines expect
     32-bit GPRs.
```
My question is how to add support for debugging 32-bit ppc binary on 64-bit
target pcc?
The powerpc cpu are freescale e6500
-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.