This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC/RFA] gdb extension for Harvard architectures
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [RFC/RFA] gdb extension for Harvard architectures
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 02 Oct 2001 18:16:05 -0500
- Cc: Jim Blandy <jimb at cygnus dot com>,Michael Snyder <msnyder at cygnus dot com>, gdb-patches at sources dot redhat dot com
- References: <3BB4D843.A92818B9@cygnus.com> <3BB512A9.6050801@cygnus.com><3BB5195F.6050603@cygnus.com> <npu1xhq0d9.fsf@zwingli.cygnus.com><3BBA2DC9.5060500@cygnus.com>
Andrew Cagney <ac131313@cygnus.com> writes:
> Any way, consider the intent of someone entering a sequence like:
>
> (gdb) x/w foo
> 0x0
> (gdb) x/i foo
> nop
> (gdb) print/x *(int*)foo
> 0xdeadbeef
>
> vs
> (gdb) print/x *(int*)foo
> 0x0
>
> and where should this go:
>
> (gdb) set *(int*)foo = 0xdeadbeef
>
> This mysterious address switching strikes me as wierd.
It *is* weird, but I think it's an intrinsic weirdness of Harvard
architectures that it would be a disservice to conceal.
Seriously, you can't protect the user from the oddities of the chip
they're working on. And I think we shouldn't: GDB's job is to help
people observe the behavior of the program, and tools for observation
must be careful not to edit reality too much. It's perfectly okay to
tell someone, "You don't understand your architecture; do it this
way." (Rather, the manual should say this, and we should point them
at it.)