thanks for doing this.  it will make sanitizer_linux.cc's
port for GetPcSpBp() *much* simplier.

> Module Name:  src
> Committed By: kamil
> Date:         Thu Feb 15 15:53:57 UTC 2018
> 
> Modified Files:
>       src/sys/arch/sparc/include: mcontext.h

this doesn't seem right.  at least, it does not match
the usage from libsanitizer:

  uptr *stk_ptr;
#  if defined (__arch64__)
  stk_ptr = (uptr *) (*sp + 2047);
#  else
  stk_ptr = (uptr *) *sp;
#  endif
  *bp = stk_ptr[15];

i don't understand either ofthe sparc versions you have.

+ #define       _UC_MACHINE_FP(uc)      
(((uc)->uc_mcontext.__gregs[_REG_O6])+0x80e)
+ #define       _UC_MACHINE_FP(uc)      
(((uc)->uc_mcontext.__gregs[_REG_O6])+0xf)

both of these grab something invalid and will likely
cause a run-time unaligned access fault as the result
will be aligned to 0x3.  there's an extra deref here
in the sparc case that is needed.  oh, i see where the
additional 0xf offset comes from.  you've conflated
byte and word sizes here.  the 64 bit stack pointer
is offset by -2047 from its actual value.  that's a
byte address.  the 15 is an array offset, which is
either 4 or 8 bytes.

the rest of them seem right as well as i could tell,
given ia64 is kind of a wreck..


.mrg.

Reply via email to