delphi - Process termination callback -


i wrote code capable produce coverage data of map file , without need of application debugging , capable of generating xml report compatible cobertura report , opencover further analisis , graphic reports.

thing is, far have call function generate report manually , idea generate automatically process exiting.

my first approach try , write hooks @ rtlexituserprocess/rtlexituserthread/exitprocess each function cover specific case, if force process end (kill using taskkill example) or close application console window ctrl+c behavior changes.

is there way can create reliable callback called when application end? when debugging app , when process dies receive debug event detailed information.

thanks in advance

no, cannot hook termination of own process. if could, malicious (or buggy) program hook refuse follow through termination. it's different debugger because debugger separate program.

were writing program, i'd put reporting code in finalization section of relevant unit. delphi rtl call program shuts down, in reverse order units initialized in, again order in units used. use analysis unit in program, , finalized late in termination sequence, allowing capture data possible.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -