From: Pedro Alves <palves@redhat.com>
To: Jeff Kenton <jkenton@tilera.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Add support for Tilera TILE-Gx processor (part 1/3: gdb)
Date: Fri, 25 May 2012 15:17:00 -0000 [thread overview]
Message-ID: <4FBFA26F.20002@redhat.com> (raw)
In-Reply-To: <4FBE8B5E.6050800@tilera.com>
On 05/24/2012 08:26 PM, Jeff Kenton wrote:
> On 05/23/2012 01:33 PM, Pedro Alves wrote:
>> Hi Jeff,
>>
>> On 05/21/2012 03:23 PM, Jeff Kenton wrote:
>>
>>
>
> - Comments applied.
> - SIGTRAMP frame handling improved.
> - Patch attached.
For the future, it's easier for the reviewer if you reply to the issues
and questions raised. For example, in patch 2, I'm left wondering if the
ps_get_thread_area addition fixed any testsuite failures, indicating it is
correct. I'm also left wondering what does "improved" mean
(probably fixed something in the testsuite?).
> diff -r -u -N /home/packages/gdb-7.4x/gdb/tilegx-linux-tdep.c ./gdb/tilegx-linux-tdep.c
> --- /home/packages/gdb-7.4x/gdb/tilegx-linux-tdep.c 1969-12-31 19:00:00.000000000 -0500
> +++ ./gdb/tilegx-linux-tdep.c 2012-05-24 13:43:30.089276000 -0400
> +/* Supply raw registers from REGCACHE to REGS. */
> +
> +/* TILE-Gx has 56 general purpose registers,
> + plus 8 special general purpose registers (network and ZERO),
> + plus 1 magic register (PC == 64).
> + We only need the following 2 enums here. */
> +
> +enum {
> + E_NUM_EASY_REGS = 56,
> + E_PC_REGNUM = 64
> +};
> +
> +enum { tilegx_reg_size = 8 };
I didn't pay close attention to what these two enums were before. The standard thing
to do instead of defining tilegx_reg_size twice, and hacking up that short
enum for the register numbers, is to move the register numbers enum from
tilegx-tdep.c to and tilegx-tdep.h file, and include that where necessary,
so we only have one place with the register numbers.
'E_' isn't a great prefix (does it mean 'enum'?), so please replace it with
something like TILEGX_PC_REGNUM, etc. along with the move.
> +/* OS specific initialization of gdbarch. */
> +
> +static void
> +tilegx_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
> +{
> + int arch_size = 64;
> +
> + /* Handle arch_size == 32 or 64. Default to 64. */
> + if (info.abfd)
> + arch_size = bfd_get_arch_size (info.abfd);
> +
> + if (arch_size != 32)
> + arch_size = 64;
Why is this 'if' necessary? Does bfd_get_arch_size ever return anything
not 32 or 64? In any case, you can just use gdbarch_addr_bit here,
as tilegx_gdbarch_init has already done the similar bfd_get_arch_size bit.
> +/* This is the implementation of gdbarch method breakpoint_from_pc. */
> +
> +static const unsigned char *
> +tilegx_breakpoint_from_pc (struct gdbarch *gdbarch,
> + CORE_ADDR *pcptr, int *lenptr)
> +{
> + /* 64-bit pattern for a { bpt ; nop } bundle. */
> + static unsigned char breakpoint[] =
static const.
> + { 0x00, 0x50, 0x48, 0x51, 0xae, 0x44, 0x6a, 0x28 };
> +
> + *lenptr = sizeof (breakpoint);
> + return breakpoint;
> +}
> +
I think we're getting close. If Joel or anyone else has further comments,
the next iteration should be about ready to go in.
--
Pedro Alves
next prev parent reply other threads:[~2012-05-25 15:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 16:09 Jeff Kenton
2012-05-14 16:21 ` Joel Brobecker
2012-05-21 14:23 ` Jeff Kenton
2012-05-23 17:34 ` Pedro Alves
2012-05-24 19:26 ` Jeff Kenton
2012-05-25 15:17 ` Pedro Alves [this message]
2012-05-29 15:24 ` Jeff Kenton
2012-05-29 17:11 ` Jeff Kenton
2012-05-29 15:24 ` Jeff Kenton
2012-05-30 19:56 ` Pedro Alves
2012-05-30 20:09 ` Jeff Kenton
2012-05-31 8:53 ` [patch] Compilation regression on older gcc + 32-bit host [Re: [PATCH] Add support for Tilera TILE-Gx processor (part 1/3: gdb)] Jan Kratochvil
2012-05-31 10:05 ` Pedro Alves
2012-05-31 15:40 ` [patch] Require long long for GDB [Re: [patch] Compilation regression on older gcc + 32-bit host] Jan Kratochvil
2012-06-01 14:45 ` [commit] Fix tilegx-linux-tdep.c compilation [Re: [patch] Require long long for GDB] Jan Kratochvil
2012-05-14 16:24 ` [PATCH] Add support for Tilera TILE-Gx processor (part 1/3: gdb) 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=4FBFA26F.20002@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jkenton@tilera.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