Hi, attached is a patch that adds support for .debug_loc sections as generated by newer versions of GCC (eg. from rtlopt-branch). It works in this way: - Parse .debug_loc into a list of new internal structures (struct loclist_master, struct loclist_block). Each loclist_master belongs to one variable and contains a pointer to a chain of loclist_blocks that represent different locations where the given variable can be found during it's life. - Next the .debug_info is parsed and when a new symbol is being added, the function new_symbol() first checks, if it's location is described by a location list or not. If not, then the old method is used. If there is a location list (in loclist_master) found for this variable, each one of its loclist_blocks is parsed and added to symbol.loclist chain. The structure symbol itself is filled up with the first loclist entry found for this symbol (ie with the values for the lowest PC where the symbol is valid). - When the variable's value is to be read (in read_var_value()), it's first checked if there is a non-null loclist pointer in variable's 'symbol' structure. If not, everything continued like it did until now. If there is a loclist it's searched for a block valid for the actual PC and if found, the variable is updated with description found there. If a valid block is not found, it's assumed that a variable was already optimized out on this PC and again the symbol structure is updated in an appropriate way. Comments? Approvals? Michal Ludvig -- * SuSE CR, s.r.o * mludvig@suse.cz * (+420) 296.545.373 * http://www.suse.cz