From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: jimb@redhat.com, gdb@sources.redhat.com Subject: More on DWARF2 Date: Wed, 18 Jul 2001 22:12:00 -0000 Message-id: <87k815bizp.fsf@cgsoftware.com> X-SW-Source: 2001-07/msg00266.html Oh, and you can't simply call read_comp_unit because it knows the hash tables need to be emptied, and trashes them. That's why i mentioned about the different abbrev tables, etc. So your die reference list would be broken, etc. There is also no list of die's to extend, we don't pass one around. Any communication between routines, except recently (Kevin's changes to pass around a cu header in some cases), is done through global variables. We also destroy the temp obstack at the end of reading the CU, which destroys the DIE list. You're proposing something that is about 75% of the work of what i've done. However, it requires *more* memory than we currently use, because it would mean retaining more info, with no real way to distinguish the lifetimes of the info. I actually started by doing that, and then noticed we might as well just modularize it the whole way, and keep all the info about a given compilation unit, in a structure for that compilation unit, so we could throw it out when that compilation unit was done. You are proposing something that still keeps around the global variables, etc. It's the difference between 2 months, and 2 and a half months, of coding. I figured since the original design had come back to bite us in the ass, I might as well do what I could to prevent it from happening again, and if it did happen, to make it so pieces could be reused without so much pain and suffering. The changes you propose will touch about the same amount of code I touched, in reality, as well. Fully modularizing it from 75% of the way there removes more code than it adds (It removed 30k from the diff), so you might actually touch *more* code. If you wanted to try it, you can take my patches (or I can give you an older diff where i had gone this way), and you can see it's going to require about the same amount of work. You'll have to touch just about every procedure either way. Unless, of course, you start introducing more global variables to communicate state, which IMHO, is a bad idea. --Dan -- "He asked me if I knew what time it was. I said, "Yes, but not right now." "-Steven Wright