On systems where we have an address mask, add support to process save-core to note the number of bits used for addressing in the corefile in an LC_NOTE, and look for that value in a corefile and set the mask in the Process.
In a live debug session on Apple Silicon using arm64e, debugserver reports the number of bits used for addressing. Corefiles of those same processes don't currently record this information any place, making them hard to use. This is a simple patch to add the LC_NOTE and read it back in again, nothing fancy.
I added a couple of comments on the masks to note that the mask uses 1 bits to indicate bits not used in addressing, open to disagreements about this but it always seemed backwards to me (I know we're following what the Linux kernel provides) and I will confuse myself if I'm not careful. Basically, leaving notes so Future Jason doesn't have to puzzle over the right answer quite so long, because I'm sure I'll forget this again.
Given that this function and the one below are basically doing the same thing, would it make sense to make this a generic helper that takes a lambda so we can share the logic to get to the LC_NOTE data?