Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
@ 2013-02-05 10:42 Jiong Wang
  2013-02-26 18:08 ` Pedro Alves
  2013-02-26 18:24 ` Pedro Alves
  0 siblings, 2 replies; 6+ messages in thread
From: Jiong Wang @ 2013-02-05 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Walter Lee

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

for tilegx, all general registers are 64bit, while the pseudo 'pc' is 
32bit under tilegx32.

gdb client treat 'pc' correctly in

static struct type *
tilegx_register_type (struct gdbarch *gdbarch, int regnum)
{
   if (regnum == TILEGX_PC_REGNUM)
     return builtin_type (gdbarch)->builtin_func_ptr;


   while gdbserver always treat it as 64bit, there
is mismatch.

gdb/ChangeLog:
         * configure.tgt: Enable gdbserver for tilegx
         * gdbserver/Makefile.in: Add rule for reg-tilegx32.c
         * gdbserver/configure.srv: Add rule for reg-tilegx32.o
         * gdbserver/linux-tile-low.c: Add tile_arch_setup and
         init_registers_tilegx32, tile_arch_setup will register
         different register info according to elf class. also,
         use "uint_reg_t" to represent register size.
         * regformats/reg-tilegx.dat: Change abi name to "tilegx.
         * regformats/reg-tilegx32.dat: New.


please review.

thanks.

-- 
Regards,
Jiong. Wang
Tilera Corporation.


[-- Attachment #2: 0002-fix-tilegx-gdbserver-bug-when-64bit-server-debug-32b.patch --]
[-- Type: text/x-patch, Size: 4869 bytes --]

---
 gdb/configure.tgt               |    1 +
 gdb/gdbserver/Makefile.in       |    2 ++
 gdb/gdbserver/configure.srv     |    1 +
 gdb/gdbserver/linux-tile-low.c  |   31 +++++++++++++++---
 gdb/regformats/reg-tilegx.dat   |    2 +-
 gdb/regformats/reg-tilegx32.dat |   67 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 98 insertions(+), 6 deletions(-)
 create mode 100644 gdb/regformats/reg-tilegx32.dat

diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 5b77bb2..d1e3a9b 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -579,6 +579,7 @@ tilegx-*-linux*)
         # Target: TILE-Gx
         gdb_target_obs="tilegx-tdep.o tilegx-linux-tdep.o solib-svr4.o \
 			symfile-mem.o glibc-tdep.o linux-tdep.o"
+	build_gdbserver=yes
         ;;
 
 xstormy16-*-*)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index f8b1794..79dc02c 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -689,6 +689,8 @@ reg-xtensa.c : $(srcdir)/../regformats/reg-xtensa.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-xtensa.dat reg-xtensa.c
 reg-tilegx.c : $(srcdir)/../regformats/reg-tilegx.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-tilegx.dat reg-tilegx.c
+reg-tilegx32.c : $(srcdir)/../regformats/reg-tilegx32.dat $(regdat_sh)
+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-tilegx32.dat reg-tilegx32.c
 
 #
 # Dependency tracking.  Most of this is conditional on GNU Make being
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index cdb5487..91ca290 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -318,6 +318,7 @@ case "${target}" in
 			srv_linux_regsets=yes
 			;;
   tilegx-*-linux*)	srv_regobj=reg-tilegx.o
+			srv_regobj="${srv_regobj} reg-tilegx32.o"
 			srv_tgtobj="linux-low.o linux-tile-low.o linux-osdata.o linux-procfs.o"
 			srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
 			srv_linux_regsets=yes
diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
index c73bdf2..f242675 100644
--- a/gdb/gdbserver/linux-tile-low.c
+++ b/gdb/gdbserver/linux-tile-low.c
@@ -20,10 +20,13 @@
 #include "server.h"
 #include "linux-low.h"
 
+#include <arch/abi.h>
 #include <sys/ptrace.h>
 
-/* Defined in auto-generated file reg-tile.c.  */
-void init_registers_tile (void);
+/* Defined in auto-generated file reg-tilegx.c.  */
+void init_registers_tilegx (void);
+/* Defined in auto-generated file reg-tilegx32.c.  */
+void init_registers_tilegx32 (void);
 
 #define tile_num_regs 65
 
@@ -103,7 +106,7 @@ tile_fill_gregset (struct regcache *regcache, void *buf)
 
   for (i = 0; i < tile_num_regs; i++)
     if (tile_regmap[i] != -1)
-      collect_register (regcache, i, ((unsigned int *) buf) + tile_regmap[i]);
+      collect_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
 }
 
 static void
@@ -113,7 +116,7 @@ tile_store_gregset (struct regcache *regcache, const void *buf)
 
   for (i = 0; i < tile_num_regs; i++)
     if (tile_regmap[i] != -1)
-      supply_register (regcache, i, ((unsigned long *) buf) + tile_regmap[i]);
+      supply_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
 }
 
 struct regset_info target_regsets[] =
@@ -123,9 +126,27 @@ struct regset_info target_regsets[] =
   { 0, 0, 0, -1, -1, NULL, NULL }
 };
 
+static void
+tile_arch_setup (void)
+{
+  int pid = pid_of (get_thread_lwp (current_inferior));
+  unsigned int machine;
+  int is_elf64 = linux_pid_exe_is_elf_64_file (pid, &machine);
+
+  if (sizeof (void *) == 4)
+    if (is_elf64 > 0)
+      error (_("Can't debug 64-bit process with 32-bit GDBserver"));
+
+  if (!is_elf64)
+    init_registers_tilegx32();
+  else
+    init_registers_tilegx();
+}
+
+
 struct linux_target_ops the_low_target =
 {
-  init_registers_tile,
+  tile_arch_setup,
   tile_num_regs,
   tile_regmap,
   NULL,
diff --git a/gdb/regformats/reg-tilegx.dat b/gdb/regformats/reg-tilegx.dat
index fc971f9..588252f 100644
--- a/gdb/regformats/reg-tilegx.dat
+++ b/gdb/regformats/reg-tilegx.dat
@@ -1,4 +1,4 @@
-name:tile
+name:tilegx
 expedite:sp,lr,pc
 64:r0
 64:r1
diff --git a/gdb/regformats/reg-tilegx32.dat b/gdb/regformats/reg-tilegx32.dat
new file mode 100644
index 0000000..d8bfe2a
--- /dev/null
+++ b/gdb/regformats/reg-tilegx32.dat
@@ -0,0 +1,67 @@
+name:tilegx32
+expedite:sp,lr,pc
+64:r0
+64:r1
+64:r2
+64:r3
+64:r4
+64:r5
+64:r6
+64:r7
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:r16
+64:r17
+64:r18
+64:r19
+64:r20
+64:r21
+64:r22
+64:r23
+64:r24
+64:r25
+64:r26
+64:r27
+64:r28
+64:r29
+64:r30
+64:r31
+64:r32
+64:r33
+64:r34
+64:r35
+64:r36
+64:r37
+64:r38
+64:r39
+64:r40
+64:r41
+64:r42
+64:r43
+64:r44
+64:r45
+64:r46
+64:r47
+64:r48
+64:r49
+64:r50
+64:r51
+64:r52
+64:tp
+64:sp
+64:lr
+64:sn
+64:io0
+64:io1
+64:us0
+64:us1
+64:us2
+64:us3
+64:zero
+32:pc
-- 
1.7.10.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
  2013-02-05 10:42 [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf Jiong Wang
@ 2013-02-26 18:08 ` Pedro Alves
  2013-02-27  4:27   ` Jiong Wang
  2013-02-26 18:24 ` Pedro Alves
  1 sibling, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2013-02-26 18:08 UTC (permalink / raw)
  To: Jiong Wang; +Cc: gdb-patches, Walter Lee

On 02/05/2013 10:42 AM, Jiong Wang wrote:
> for tilegx, all general registers are 64bit, while the pseudo 'pc' is 32bit under tilegx32.

You mention the 'pc' as a pseudo register.  At the
hardware/kernel level, on tilegx32, is 'pc' 32-bit or 64-bit?
I thought Tile-GX was always 64-bit, and tilegx32 was just an ABI.
Is the kernel already trimming the PC?

I'm a bit ambivalent in these cases.

On the one hand, I tend to think it'd be better to send the
whole 64 bits to GDB, and have GDB trim to 32-bits.  There's always
the possibility the bug the user is debugging is caused by the PC
register ending up loaded with >32-bit (say, bad asm, or a bad function
pointer?), and a design that trims at such a low level leaves no
chance of gdb diagnosing it.  If you look at the x32 support, you'll
find we still send a 64-bit RIP down to GDB.

OTOH, I don't care that much about Tile-GX to argue, so I won't
and this is fine with me.  ;-)

> gdb client treat 'pc' correctly in
> 
> static struct type *
> tilegx_register_type (struct gdbarch *gdbarch, int regnum)
> {
>   if (regnum == TILEGX_PC_REGNUM)
>     return builtin_type (gdbarch)->builtin_func_ptr;
> 
> 
>   while gdbserver always treat it as 64bit, there
> is mismatch.
> 
> gdb/ChangeLog:


>         * gdbserver/Makefile.in: Add rule for reg-tilegx32.c
>         * gdbserver/configure.srv: Add rule for reg-tilegx32.o

gdbserver has it's own ChangeLog.  Move these entries there, and
drop the "gdbserver/" prefix.

Missing period at end of sentences.

>         * gdbserver/linux-tile-low.c: Add tile_arch_setup and
>         init_registers_tilegx32, tile_arch_setup will register
>         different register info according to elf class. also,

Double space after '.'.  "also" should be capitalized, but, just
remove it altogether and start with "Use".

>         use "uint_reg_t" to represent register size.
>         * regformats/reg-tilegx.dat: Change abi name to "tilegx.

Missing ".

>         * regformats/reg-tilegx32.dat: New.

Most of these entries are missing the "(context)" bits.
Please see the numerous entries in gdbserver/ChangeLog touching
similar code.

Other than that, it looks good.

Thanks,
-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
  2013-02-05 10:42 [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf Jiong Wang
  2013-02-26 18:08 ` Pedro Alves
@ 2013-02-26 18:24 ` Pedro Alves
  1 sibling, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2013-02-26 18:24 UTC (permalink / raw)
  To: Jiong Wang; +Cc: gdb-patches, Walter Lee

On 02/05/2013 10:42 AM, Jiong Wang wrote:
> for tilegx, all general registers are 64bit, while the pseudo 'pc' is 32bit under tilegx32.
> 
> gdb client treat 'pc' correctly in
> 
> static struct type *
> tilegx_register_type (struct gdbarch *gdbarch, int regnum)
> {
>   if (regnum == TILEGX_PC_REGNUM)
>     return builtin_type (gdbarch)->builtin_func_ptr;
> 
> 
>   while gdbserver always treat it as 64bit, there
> is mismatch.
> 
> gdb/ChangeLog:
>         * configure.tgt: Enable gdbserver for tilegx

This bit is an unrelated change.  Please split it out
into a separate patch, and post it in a new self-contained
thread, along with its own rationale.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
  2013-02-26 18:08 ` Pedro Alves
@ 2013-02-27  4:27   ` Jiong Wang
  2013-02-27 14:06     ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Jiong Wang @ 2013-02-27  4:27 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Walter Lee

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]


at 2013/2/27 2:08, Pedro Alves written:
> You mention the 'pc' as a pseudo register.  At the
> hardware/kernel level, on tilegx32, is 'pc' 32-bit or 64-bit?
> I thought Tile-GX was always 64-bit, and tilegx32 was just an ABI.
       thanks for review these.

       yes, exactly, TileGX is always 64bit.  On tilegx32, at 
hardware/kernel level, 'pc' is 64bit.
> Is the kernel already trimming the PC?
      No trimming, the kernel always return 64bit.

      below is the updated ChangeLog, and patch.

      please review. thanks.

      gdb/

        * regformats/reg-tilegx.dat (name): Change abi name to "tilegx".
        * regformats/reg-tilegx32.dat: New.

      gdb/gdbserver/

         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
         (reg-tilegx32.c): New rule.
         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to 
srv_regobj.
         * linux-tile-low.c (tile_arch_steup): New function.  Invoke
         different register info initializer according to elf class.
         (init_registers_tilgx32): New function.  The tilegx32 register info
         initializer.
         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
         (tile_store_gregset): Likewise.




[-- Attachment #2: fix-gdbserver.patch --]
[-- Type: text/x-patch, Size: 4801 bytes --]

---
 gdb/gdbserver/Makefile.in       |  3 +++
 gdb/gdbserver/configure.srv     |  1 +
 gdb/gdbserver/linux-tile-low.c  | 31 ++++++++++++++++++++++++++-----
 gdb/regformats/reg-tilegx.dat   |  2 +-
 gdb/regformats/reg-tilegx32.dat | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 6 deletions(-)

diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index dffe8ae..ee2c400 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -320,6 +320,7 @@ clean:
 	rm -f reg-arm.c reg-bfin.c i386.c reg-ia64.c reg-m32r.c reg-m68k.c
 	rm -f reg-sh.c reg-sparc.c reg-spu.c amd64.c i386-linux.c
 	rm -f reg-cris.c reg-crisv32.c amd64-linux.c reg-xtensa.c
+	rm -f reg-tilegx.c reg-tilegx32.c
 	rm -f arm-with-iwmmxt.c
 	rm -f arm-with-vfpv2.c arm-with-vfpv3.c arm-with-neon.c
 	rm -f mips-linux.c mips64-linux.c
@@ -694,6 +695,8 @@ reg-xtensa.c : $(srcdir)/../regformats/reg-xtensa.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-xtensa.dat reg-xtensa.c
 reg-tilegx.c : $(srcdir)/../regformats/reg-tilegx.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-tilegx.dat reg-tilegx.c
+reg-tilegx32.c : $(srcdir)/../regformats/reg-tilegx32.dat $(regdat_sh)
+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-tilegx32.dat reg-tilegx32.c
 
 #
 # Dependency tracking.  Most of this is conditional on GNU Make being
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 93c499c..b9a99d0 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -333,6 +333,7 @@ case "${target}" in
 			srv_linux_regsets=yes
 			;;
   tilegx-*-linux*)	srv_regobj=reg-tilegx.o
+			srv_regobj="${srv_regobj} reg-tilegx32.o"
 			srv_tgtobj="linux-low.o linux-tile-low.o linux-osdata.o linux-procfs.o"
 			srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
 			srv_linux_regsets=yes
diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
index c73bdf2..f242675 100644
--- a/gdb/gdbserver/linux-tile-low.c
+++ b/gdb/gdbserver/linux-tile-low.c
@@ -20,10 +20,13 @@
 #include "server.h"
 #include "linux-low.h"
 
+#include <arch/abi.h>
 #include <sys/ptrace.h>
 
-/* Defined in auto-generated file reg-tile.c.  */
-void init_registers_tile (void);
+/* Defined in auto-generated file reg-tilegx.c.  */
+void init_registers_tilegx (void);
+/* Defined in auto-generated file reg-tilegx32.c.  */
+void init_registers_tilegx32 (void);
 
 #define tile_num_regs 65
 
@@ -103,7 +106,7 @@ tile_fill_gregset (struct regcache *regcache, void *buf)
 
   for (i = 0; i < tile_num_regs; i++)
     if (tile_regmap[i] != -1)
-      collect_register (regcache, i, ((unsigned int *) buf) + tile_regmap[i]);
+      collect_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
 }
 
 static void
@@ -113,7 +116,7 @@ tile_store_gregset (struct regcache *regcache, const void *buf)
 
   for (i = 0; i < tile_num_regs; i++)
     if (tile_regmap[i] != -1)
-      supply_register (regcache, i, ((unsigned long *) buf) + tile_regmap[i]);
+      supply_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
 }
 
 struct regset_info target_regsets[] =
@@ -123,9 +126,27 @@ struct regset_info target_regsets[] =
   { 0, 0, 0, -1, -1, NULL, NULL }
 };
 
+static void
+tile_arch_setup (void)
+{
+  int pid = pid_of (get_thread_lwp (current_inferior));
+  unsigned int machine;
+  int is_elf64 = linux_pid_exe_is_elf_64_file (pid, &machine);
+
+  if (sizeof (void *) == 4)
+    if (is_elf64 > 0)
+      error (_("Can't debug 64-bit process with 32-bit GDBserver"));
+
+  if (!is_elf64)
+    init_registers_tilegx32();
+  else
+    init_registers_tilegx();
+}
+
+
 struct linux_target_ops the_low_target =
 {
-  init_registers_tile,
+  tile_arch_setup,
   tile_num_regs,
   tile_regmap,
   NULL,
diff --git a/gdb/regformats/reg-tilegx.dat b/gdb/regformats/reg-tilegx.dat
index fc971f9..588252f 100644
--- a/gdb/regformats/reg-tilegx.dat
+++ b/gdb/regformats/reg-tilegx.dat
@@ -1,4 +1,4 @@
-name:tile
+name:tilegx
 expedite:sp,lr,pc
 64:r0
 64:r1
diff --git a/gdb/regformats/reg-tilegx32.dat b/gdb/regformats/reg-tilegx32.dat
new file mode 100644
index 0000000..d8bfe2a
--- /dev/null
+++ b/gdb/regformats/reg-tilegx32.dat
@@ -0,0 +1,67 @@
+name:tilegx32
+expedite:sp,lr,pc
+64:r0
+64:r1
+64:r2
+64:r3
+64:r4
+64:r5
+64:r6
+64:r7
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:r16
+64:r17
+64:r18
+64:r19
+64:r20
+64:r21
+64:r22
+64:r23
+64:r24
+64:r25
+64:r26
+64:r27
+64:r28
+64:r29
+64:r30
+64:r31
+64:r32
+64:r33
+64:r34
+64:r35
+64:r36
+64:r37
+64:r38
+64:r39
+64:r40
+64:r41
+64:r42
+64:r43
+64:r44
+64:r45
+64:r46
+64:r47
+64:r48
+64:r49
+64:r50
+64:r51
+64:r52
+64:tp
+64:sp
+64:lr
+64:sn
+64:io0
+64:io1
+64:us0
+64:us1
+64:us2
+64:us3
+64:zero
+32:pc

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
  2013-02-27  4:27   ` Jiong Wang
@ 2013-02-27 14:06     ` Pedro Alves
  2013-02-27 14:10       ` Jiong Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2013-02-27 14:06 UTC (permalink / raw)
  To: Jiong Wang; +Cc: gdb-patches, Walter Lee

On 02/27/2013 04:26 AM, Jiong Wang wrote:
> 
> at 2013/2/27 2:08, Pedro Alves written:
>> You mention the 'pc' as a pseudo register.  At the
>> hardware/kernel level, on tilegx32, is 'pc' 32-bit or 64-bit?
>> I thought Tile-GX was always 64-bit, and tilegx32 was just an ABI.
>       thanks for review these.
> 
>       yes, exactly, TileGX is always 64bit.  On tilegx32, at hardware/kernel level, 'pc' is 64bit.
>> Is the kernel already trimming the PC?
>      No trimming, the kernel always return 64bit.

Oh well.  Makes me feel even more this isn't the best approach, but,

> 
>      below is the updated ChangeLog, and patch.
> 
>      please review. thanks.
> 
>      gdb/
> 
>        * regformats/reg-tilegx.dat (name): Change abi name to "tilegx".
>        * regformats/reg-tilegx32.dat: New.
> 
>      gdb/gdbserver/
> 
>         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
>         (reg-tilegx32.c): New rule.
>         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
>         * linux-tile-low.c (tile_arch_steup): New function.  Invoke

Typo: "setup".

>         different register info initializer according to elf class.
>         (init_registers_tilgx32): New function.  The tilegx32 register info
>         initializer.
>         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
>         (tile_store_gregset): Likewise.

OK.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
  2013-02-27 14:06     ` Pedro Alves
@ 2013-02-27 14:10       ` Jiong Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Jiong Wang @ 2013-02-27 14:10 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Walter Lee

于 2013/2/27 22:06, Pedro Alves 写道:
> On 02/27/2013 04:26 AM, Jiong Wang wrote:
>> at 2013/2/27 2:08, Pedro Alves written:
>>> You mention the 'pc' as a pseudo register.  At the
>>> hardware/kernel level, on tilegx32, is 'pc' 32-bit or 64-bit?
>>> I thought Tile-GX was always 64-bit, and tilegx32 was just an ABI.
>>        thanks for review these.
>>
>>        yes, exactly, TileGX is always 64bit.  On tilegx32, at hardware/kernel level, 'pc' is 64bit.
>>> Is the kernel already trimming the PC?
>>       No trimming, the kernel always return 64bit.
> Oh well.  Makes me feel even more this isn't the best approach, but,
>
>>       below is the updated ChangeLog, and patch.
>>
>>       please review. thanks.
>>
>>       gdb/
>>
>>         * regformats/reg-tilegx.dat (name): Change abi name to "tilegx".
>>         * regformats/reg-tilegx32.dat: New.
>>
>>       gdb/gdbserver/
>>
>>          * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
>>          (reg-tilegx32.c): New rule.
>>          * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
>>          * linux-tile-low.c (tile_arch_steup): New function.  Invoke
> Typo: "setup".
>
>>          different register info initializer according to elf class.
>>          (init_registers_tilgx32): New function.  The tilegx32 register info
>>          initializer.
>>          (tile_fill_gregset): Use "uint_reg_t" to represent register size.
>>          (tile_store_gregset): Likewise.
> OK.

thanks, I will commit this after fixing typo.

Regards,
Jiong
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-27 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05 10:42 [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf Jiong Wang
2013-02-26 18:08 ` Pedro Alves
2013-02-27  4:27   ` Jiong Wang
2013-02-27 14:06     ` Pedro Alves
2013-02-27 14:10       ` Jiong Wang
2013-02-26 18:24 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox