Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: macro@codesourcery.com, brobecker@adacore.com,
	lgustavo@codesourcery.com,        gdb@sourceware.org
Subject: Re: Assuming types for PC
Date: Tue, 11 Jun 2013 09:21:00 -0000	[thread overview]
Message-ID: <51B6EC1F.3020401@redhat.com> (raw)
In-Reply-To: <201306101844.r5AIi8Ou017730@glazunov.sibelius.xs4all.nl>

On 06/10/2013 07:44 PM, Mark Kettenis wrote:
>> Date: Mon, 10 Jun 2013 19:04:08 +0100
>> From: "Maciej W. Rozycki" <macro@codesourcery.com>
>>
>>  I think it is important to let the user access the full width of the PC 
>> both for writes and -- more importantly -- for reads (as in: why did my 
>> program crash, did it jump to an odd place?), as this lets the user do 
>> with GDB what hardware permits.  There is nothing in hardware that 
>> prevents one from writing an out-of-valid ABI address space value to the 
>> PC at a program's runtime (neither on Linux nor on bare iron) when 
>> executing an n32 program.  I think GDB should not stand in a user's way 
>> and should allow the same to be done via ptrace(2) or RSP.
> 
> Absolutely!

+1.  Hmm, it'd be nice to have this spelled out in the internals manual
(or the wiki?).  I while ago I pointed this out on a review of some
port.  Can't recall which, but in the end I let it go.  Maybe I should
have pushed back stronger.

>>  Overall I think the test is too strict.  If you think the use of "long 
>> long" is unfortunate for the PC, then an artificial type might be created 
>> internally within GDB specifically for the PC, similarly to what we do 
>> e.g. for IEEE 754 data types and floating-point registers in some cases.
> 
> An artificial type like that probably is the way to go.

I agree.  Something like the GDB equivalent of:

  typedef void * ptr64 __attribute ((mode(DI)));

(That worked last time I tried it on x32, probably works on MIPS too.)

-- 
Pedro Alves


  reply	other threads:[~2013-06-11  9:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 14:19 Luis Machado
2013-06-10 14:31 ` Mark Kettenis
2013-06-10 14:34   ` Luis Machado
2013-06-10 14:45     ` Joel Brobecker
2013-06-10 14:49       ` Luis Machado
2013-06-10 14:56         ` Joel Brobecker
2013-06-10 15:04     ` Mark Kettenis
2013-06-10 15:18       ` Luis Machado
2013-06-10 18:04       ` Maciej W. Rozycki
2013-06-10 18:44         ` Mark Kettenis
2013-06-11  9:21           ` Pedro Alves [this message]
2013-06-11 10:09             ` 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=51B6EC1F.3020401@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=lgustavo@codesourcery.com \
    --cc=macro@codesourcery.com \
    --cc=mark.kettenis@xs4all.nl \
    /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