[PATCH] export dwarf2 loc_directive_seen flag

Bob Wilson bwilson@tensilica.com
Tue Nov 13 20:33:00 GMT 2007


I'm about to submit a patch to clean up the way the Xtensa port of GAS handles 
line numbers.  It will be similar to the ia64 port.  (I'm sending it separately 
to make it easier for someone to review and approve this piece of it.)

One issue is that the loc_directive_seen flag is not exported from dwarf2dbg.c. 
  The ia64 port handles this by overriding the .loc directive function and 
keeping its own local copies of that flag.  It would be a whole lot cleaner to 
just use the flag from dwarf2dbg.c.  I don't know the ia64 port very well to 
know if this would also be useful there -- overriding the directive function may 
be just as good for ia64 -- but I'd like this for my Xtensa patch.

Would it be OK to export it as a global variable?

Here's a patch to do that.  It is relative to my previous patch, but I can 
adjust that as needed.  An alternative would be to keep the flag static and add 
an accessor function to return its value.

gas/
	* dwarf2dbg.h (dwarf2_loc_directive_seen): New.
	* dwarf2dbg.c (loc_directive_seen): Make external and rename to...
	(dwarf2_loc_directive_seen): ...this.
	(dwarf2_emit_insn, dwarf2_consume_line_info)
	(dwarf2_emit_label, dwarf2_directive_loc): Use new name.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-export-locseen.patch
Type: text/x-diff
Size: 2195 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071113/cd5713db/attachment.bin>


More information about the Binutils mailing list