A method and system for lazily registering dynamically generated code and corresponding
unwind information of a process. In one embodiment, the present invention detects
a request for first unwind information related to first corresponding dynamically
generated code. The present embodiment creates a module which includes data related
to the first unwind information and the first corresponding dynamically generated
code, and provides an application program interface (API) which allows the data
to be registered such that dynamic registration of the first unwind information
and the first corresponding dynamically generated code is enabled. The present
embodiment also couples an API invocation code sequence to the first corresponding
dynamically generated code such that upon execution of the first corresponding
dynamically generated code, the API invocation code sequence instructs the API
to facilitate registration of the data.