From: Peter H S. <smi...@us...> - 2003-06-27 05:05:11
|
I think Nick is on to something here. You're already keeping a table of stack traces to identify "duplicate calls". You know the range of addresses at munmap time, so you can sift through your table to find the ones you need to "sourcify" now. The cost of sifting the table is linear, and some removal of duplicates has already occurred. When you encounter an address in the region you're about to munmap, create the source string for it and add that address and its source string to a "special table", and index that table with a "special address." Maybe 0xFFFF0001, 0xFFFF0002 could be the "special addresses." Somewhere that mmap isn't going to find (I'm not an X86 architect, and I don't play one on TV :-) For completeness, when you create the source string, tack on the original address, and maybe something that helps with understanding when the text was loaded. You could get fancy and refer to the Nth load of the library, and also log each library load so the poor slobs debugging the code can match things up. I think there won't be many pathological cases where the size of the translated stack address strings is more than the munmapped file... Peter |