This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about blockframe.c:inside_main_func()



On Apr 28, 2004, at 6:02 PM, Joel Brobecker wrote:


Indeed, it seems that we could improve a bit this code: It really looks
like we are trying to compute the low/high addresses for function main
twice! Even when main is found within the debug info, we go through the
through the trouble of finding the bounds of function "main" from the
min syms anyway. A missing condition somewhere?

Yeah, if I'm not mistaken we'll look up main() twice for each frame in a backtrace every time. With a GUI front end keeping a stack view up-to-date on each step, and apps with deep stacks, that will add up pretty fast. Here at Apple we found some real performance problems with this type of code path - things that slowed down with deep stacks and frequent 'backtraces' from the UI - so it's work fixing.


Looking at the individual changes to inside_main_func, I'm pretty well convinced this is just a combination of edits that didn't look at the function's behavior overall. But it's worth checking with Andrew to see if there is some edge-case that isn't immediately obvious which would cause us to do this recomputation all the time..

J


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]