While the MSF stores the stream count as u32, it seems to be a general pattern in PDBs to store u16 stream indices and indicate the absence of a stream with 0xffff. To abstract this behavior, this PR introduces a transparent StreamIndex type.
All code is refactored to use this new type now. As a nice side effect, the access to DBI extra streams is now much smoother. Also, this forces us to check for the absence of streams more consistently when using stream indices internally (e.g. as it was missed for module info streams initially).
The only exception to this seems to be the named stream table, which contains u32 stream indices. I've decided to make a lossy conversion to a StreamIndex, since this is in the public interface. In general, the StreamNames type might need a refactor, but that's for a different PR.
While the MSF stores the stream count as
u32
, it seems to be a general pattern in PDBs to storeu16
stream indices and indicate the absence of a stream with0xffff
. To abstract this behavior, this PR introduces a transparentStreamIndex
type.All code is refactored to use this new type now. As a nice side effect, the access to DBI extra streams is now much smoother. Also, this forces us to check for the absence of streams more consistently when using stream indices internally (e.g. as it was missed for module info streams initially).
The only exception to this seems to be the named stream table, which contains
u32
stream indices. I've decided to make a lossy conversion to aStreamIndex
, since this is in the public interface. In general, theStreamNames
type might need a refactor, but that's for a different PR.