|
From: Howard C. <hy...@sy...> - 2005-08-12 10:03:16
|
Josef Weidendorfer wrote: > On Friday 12 August 2005 09:51, Tom Hughes wrote: > >> Remembering symbols after an unmap is hard - the problem is that a >> future dlopen could reuse the same addresses so it means storing >> temporal information of some sort with all the backtraces. This has >> been discussed in depth numerous times in the past. >> > > Temporal information is not really needed. You have to convert the address to > "time-independent" information at the time the stacktrace is taken. > > The backtraces could store (mapped object, offset) instead of a pure address. > "mapped object" being a small struct with the object name which is not to be > discarded. When a object is re"dl"opened, one would have to make sure that it > is identified as the old one. > Matching for repeated open/close cycles isn't really necessary. (Nor is it always fruitful, since the object may not be mapped to the same address every time, and it's valuable to know both the absolute address and the object/offset coordinates.) > But you still have the problem with discarded debug info to map offsets to > symbol names. You also would have to store the symbol names themself in the > backtraces (or some IDs together with a string table). > Or just reopen the object file and retrieve the symbol names when needed. That's what I do in FunctionCheck, using libbfd. > Actually, in callgrind I have "context objects" which are similar to > stacktraces, and they stay valid after dlclose's. I am doing the above. > > Josef > -- -- Howard Chu Chief Architect, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc OpenLDAP Core Team http://www.openldap.org/project/ |