From: Pedro Alves <palves@redhat.com>
To: Jiong Wang <jiwang@tilera.com>
Cc: gdb-patches@sourceware.org, Walter Lee <walt@tilera.com>
Subject: Re: [RFC/TileGX 2/2] fix gdbserver bug for 32bit elf
Date: Tue, 26 Feb 2013 18:08:00 -0000 [thread overview]
Message-ID: <512CFA08.6060507@redhat.com> (raw)
In-Reply-To: <5110E21A.2060308@tilera.com>
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
next prev parent reply other threads:[~2013-02-26 18:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-05 10:42 Jiong Wang
2013-02-26 18:08 ` Pedro Alves [this message]
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
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=512CFA08.6060507@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jiwang@tilera.com \
--cc=walt@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