Described is a system and method of regenerating stack unwind data in the
presence of exceptions. The system is directed to generating metadata for
use during stack unwinding. The system includes procedures, a first
plurality of metadata, and an unwind rewriter. Each metadata is
associated with a corresponding procedure in the procedures. The unwind
rewriter generates new metadata from the first plurality of metadata in
response to a modification of the sequence of binary instructions within
a procedure, such that the new metadata accurately represents the
modified sequence of binary instructions. The method regenerates metadata
in response to a binary modification to a procedure by receiving a first
group of metadata associated with the unmodified procedure, parsing the
first group of metadata, and generating a second group of metadata that
accurately represents the binary modification to the procedure.