Page MenuHomeFreeBSD

libstats: Fix ABI assertion.
AbandonedPublic

Authored by brooks on Oct 31 2019, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 18 2024, 12:09 AM
Unknown Object (File)
Dec 30 2023, 9:43 PM
Unknown Object (File)
Dec 3 2023, 9:48 AM
Unknown Object (File)
Nov 30 2023, 10:02 AM
Unknown Object (File)
Sep 21 2023, 5:41 PM
Unknown Object (File)
Sep 11 2023, 4:58 AM
Unknown Object (File)
Jul 13 2023, 2:06 AM
Unknown Object (File)
Jun 27 2023, 6:21 AM
Subscribers
None

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 Passed
Unit
No Test Coverage
Build Status
Buildable 27303
Build 25563: arc lint + arc unit

Event Timeline

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.

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