Page MenuHomeFreeBSD

libstats: Fix ABI assertion.
AbandonedPublic

Authored by brooks on Thu, Oct 31, 9:49 PM.

Details

Reviewers
jhb
Summary

On platforms where pointers are larger than 64-bits, struct statsblob
may be harmlessly padded out such that opaque[] always has some included
space. Make the assertion more general by compating to the offset of
opaque rather than the size of sizeof(struct statsblob).

truss: centralize pointer-constructing casts.

Arguments pointers are passed around as integrer types and need
to be converted to pointers when performing ptrace IO operations such as
in get_struct(). Move the casts into get_struct() and friends and take
a uintptr_t argument rather than a void *.

Add a print_pointer function that takes a uintptr_t and uses a single
case plus "%p" to print pointers.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 27303
Build 25563: arc lint + arc unit

Event Timeline

brooks created this revision.Thu, Oct 31, 9:49 PM

This is extracted from CheriBSD. I'm not 100% it's something we want, but figure we should either upstream it (so I don't have compile errors every time a call to get_struct() is added) or remove it.

brooks abandoned this revision.Thu, Oct 31, 9:53 PM

ARG, this was forked form the wrong branch. Will redo