Re: RFC: Correct "paddr_t" in gdb_proc_service.h

Daniel Jacobowitz
2006-03-15T19:50:30Z

On Wed, Mar 15, 2006 at 11:36:50AM -0500, Daniel Jacobowitz wrote:
> - ret = target_write_memory (addr, buf, len);
> + ret = target_write_memory ((unsigned long) addr, buf, len);
> else
> - ret = target_read_memory (addr, buf, len);
> + ret = target_read_memory ((unsigned long) addr, buf, len);

On Wed, Mar 15, 2006 at 11:45:53AM -0800, Michael Snyder wrote:
> Seems ok -- except the cast for target_read_memory
> should be (CORE_ADDR) addr, n'est ce pas?

Oh, I'm glad you asked :-) No, it shouldn't be, and yes, it should
raise a red flag. psaddr_t is defined to void * by glibc. That means
that if we cast it directly to a CORE_ADDR, we may get a warning about
it being the wrong size, from GCC.

Ugh, that means on MIPS for correctness we ought to be sign extending
it. I don't know the right way to do that. It didn't affect my
testing, because 32-bit user addresses have the high bit clear.

Um... I'll have to think about it some more :-(