From: Richard Earnshaw <rearnsha@arm.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com, Richard.Earnshaw@arm.com
Subject: Re: [wip/cagney_regbuf-20020515-branch] Introduce regcache_move()
Date: Sat, 18 May 2002 04:18:00 -0000 [thread overview]
Message-ID: <200205181117.MAA27270@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Fri, 17 May 2002 12:36:12 EDT." <3CE5317C.6050609@cygnus.com>
ac131313@cygnus.com said:
> I suspect RichardE will come up with something for
> {read,write}_register_bytes :-)
Hmm, no. The more I look into read/write_register bytes the more that I'm
forced to the conclusion that it is just irredeemably broken when used by
gdb-core.
Consider executing the following statement on an ARM debug session with
the arm_apcs_32 variable set to zero.
(gdb) set $pc=main
In this mode the register r15 (the real PC register) is a combination of
the two pseudo registers $pc and $cpsr (the program status register), but
gdb-core doesn't know anything about this.
However, gdb-core currently performs the above asignment in valops.c by
using the write_register_bytes call with REGISTER_BYTE($pc) as the offset
into the regcache. REGISTER_BYTE(reg) must always return something useful
or gdb will just crash, so we are forced to return the address of the raw
R15 value in the cache.
Write_register_bytes will then overwrite the raw value in the cache
without any regard to the masking operations that should be occuring when
updating R15; the CPSR bits in the PC are just clobbered and we are left
with a broken value in the R15 register.
Conclusion: write_register_bytes is so broken that if gdb-core continues
to use it I shall have to have separate cache entries for the different
bits of R15 and then make the target code do the merging -- this is
substantially what the existing code in CVS does, but what I've been
trying to move away from (since currently two regcache entries can refer
to R15).
R.
next prev parent reply other threads:[~2002-05-18 11:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-17 9:36 Andrew Cagney
2002-05-18 4:18 ` Richard Earnshaw [this message]
2002-05-18 4:38 ` Richard Earnshaw
2002-05-18 11:27 ` Andrew Cagney
2002-05-18 12:08 ` Andrew Cagney
2002-05-19 7:47 ` Richard Earnshaw
2002-05-19 8:10 ` 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=200205181117.MAA27270@cam-mail2.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@sources.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