Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Piet/Pete Delaney <piet@sgi.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb@sources.redhat.com, Piet Delaney <piet@sgi.com>
Subject: Re: ia64-stub.c
Date: Tue, 22 Jan 2002 23:47:00 -0000	[thread overview]
Message-ID: <20020122234732.A59205@sgi.com> (raw)
In-Reply-To: <1020123022623.ZM7453@localhost.localdomain>

On Tue, Jan 22, 2002 at 07:26:23PM -0700, Kevin Buettner wrote:
> > > > I thought I read that the predict registers p0..p63 are 1 bit and packed into
> > > > a single 64 bit chunk of memory.
> > > 
> > > They're packed into the pr register.  ia64-tdep.c knows how to unpack
> > > this register to give you discreet p0..p63 registers.  (Note that from
> > > GDB's standpoint these registers are read-only.  A bit of work still
> > > needs to be done to make them writable too.)
> > 
> > I get the impression that theses can't be fetched with the 'g' command. 
> > This seems to be insistant with the protocol.txt on the 'g' cmd:
> 
> As noted above, there are a number of registers which are included in
> the "g" packet which the IA-64 port disregards.  r32-r127 are retrieved
> using an offset from BSP from the backing store (i.e, from memory).
> The predicate registers are transferred in a single 64 bit word (the
> pr register) and are split out to show individual 1-bit registers
> by gdb.  Something similar occurs for the NaT bits.  Most of these
> are indicated via a -1 in the u_offsets[] array.  (Some of these,
> however, are simply not retrievable via the ptrace interface and
> are therefore marked with -1.)

In the kernel the registers may not always flushed out the the backing store.
In a SPARC kernel a 2nd level trap is required for the kernel code to flush
the registers to the backing store. A similar case may apply to ia64. Like
in the even of a stack overflow (backing store isn't mapped). 

I would think it preferable for gdb to accept values in the 'g' packet
and if it doesn't receive a copy of the r32-r127 registers to then try
to fetch them using an offset from the BSP.

Isn't it possible to transfer predicate registers in the 'g' reply packet?

There isn't a 'pr' register defined in the ia64_register_names[] array,
so the convention isn't clear. If the REGISTER_RAW_SIZE macro indicates
they are 1 byte or perhaps 1 bit each, then the transfer is possible.
The REGISTER_RAW_SIZE implies that the 'g' packet reply should provide
the predict registers at 8 byte offsets like all of the other registers
other than the floats.

Unless the REGISTER_RAW_SIZE is correct for the predicate registers the
position of the most important registers (ip, psp) in the 'g' packet reply
isn't obvious. 

  "p0",   "p1",   "p2",   "p3",   "p4",   "p5",   "p6",   "p7",
  "p8",   "p9",   "p10",  "p11",  "p12",  "p13",  "p14",  "p15",
  "p16",  "p17",  "p18",  "p19",  "p20",  "p21",  "p22",  "p23",
  "p24",  "p25",  "p26",  "p27",  "p28",  "p29",  "p30",  "p31",
  "p32",  "p33",  "p34",  "p35",  "p36",  "p37",  "p38",  "p39",
  "p40",  "p41",  "p42",  "p43",  "p44",  "p45",  "p46",  "p47",
  "p48",  "p49",  "p50",  "p51",  "p52",  "p53",  "p54",  "p55",
  "p56",  "p57",  "p58",  "p59",  "p60",  "p61",  "p62",  "p63",

  "b0",   "b1",   "b2",   "b3",   "b4",   "b5",   "b6",   "b7",

  "vfp", "vrap",

  "pr", "ip", "psr", "cfm",							<<<--- ip

  "kr0",   "kr1",   "kr2",   "kr3",   "kr4",   "kr5",   "kr6",   "kr7",
  "", "", "", "", "", "", "", "",
  "rsc", "bsp", "bspstore", "rnat",						<<<--- bsp
  "", "fcr", "", "",
  "eflag", "csd", "ssd", "cflg", "fsr", "fir", "fdr",  "",
  "ccv", "", "", "", "unat", "", "", "",
  "fpsr", "", "", "", "itc",
  "", "", "", "", "", "", "", "", "", "",
  "", "", "", "", "", "", "", "", "",
  "pfs", "lc", "ec",


So even after I fetch the bsp and ip from kdb it's not clear where they
go in the 'g' packet reply. I had expected the u_offsets[] to provide
insight into the expected location but it seems the offsets are only
used for the ptrace interface.

Can I assume the REGISTER_RAW_SIZE macro is right and all registers other
than the floating point are 8 bytes? My experience up to now is that they
weren't. The ip register wasn't in the right place following this direct 
interpretation of the REGISTER_RAW_SIZE macro and the ia64_register_names.

-piet


  reply	other threads:[~2002-01-23  7:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-21  1:00 ia64-stub.c Piet/Pete Delaney
2002-01-21 13:45 ` ia64-stub.c Kevin Buettner
     [not found]   ` <20020122105652.A57552@sgi.com>
     [not found]     ` <1020122190037.ZM5902@localhost.localdomain>
     [not found]       ` <20020122121956.B57552@sgi.com>
2002-01-22 12:51         ` ia64-stub.c Piet/Pete Delaney
2002-01-22 13:57           ` ia64-stub.c Kevin Buettner
2002-01-22 15:35             ` ia64-stub.c Piet/Pete Delaney
2002-01-22 18:27               ` ia64-stub.c Kevin Buettner
2002-01-22 23:47                 ` Piet/Pete Delaney [this message]
2002-01-23  3:16                   ` ia64-stub.c Kevin Buettner
2002-01-23  4:44                     ` ia64-stub.c Piet/Pete Delaney
2002-01-23  7:29                   ` ia64-stub.c Andrew Cagney

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=20020122234732.A59205@sgi.com \
    --to=piet@sgi.com \
    --cc=gdb@sources.redhat.com \
    --cc=kevinb@redhat.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