On 11/14/14 11:17, Bernd Schmidt wrote:
The situation with debugging on ptx is a little strange - it allows .file and .loc directives for line numbers, and it provides a way to define dwarf2 debug sections - but as far as I can tell, there's no way of putting useful or accurate information into the latter. There's also the slight problem that the data output directives used within those sections differ from the ones used everywhere else in ptx code.The following patch adds a variant of dwarf2 debugging that supports just line numbers. I'll need to update the nvptx-as from my tools package, since ptxas is picky and does not allow .file directives within functions, so some more reordering of the assembly output is required. How does this look? Testing currently in progress. An alternative would be to make a PTX_DEBUGGING_OUTPUT macro and a corresponding file cut down from dwarf2out. Bernd ptx-debug.diff * config/nvptx/nvptx.c (nvptx_option_override): Don't override debug options. * config/nvptx/nvptx.h (DWARF2_LINENO_DEBUGGING_INFO): Define. * config/nvptx/nvptx.h (DWARF2_DEBUGGING_INFO): Don't define. * debug.h (dwarf2_lineno_debug_hooks): Declare. * toplev.c (process_options): Add a case for it. * dwarf2out.c (dwarf2_lineno_debug_hooks): New variable. (dwarf2out_init): Skip most initializations if DWARF2_LINENO_DEBUGGING_INFO, but set cur_line_info_table in that case. * defaults.h (PREFERRED_DEBUGGING_TYPE): Also use DWARF2_DEBUG if DWARF2_LINENO_DEBUGGING_INFO. * opts.c (set_debug_level): Likewise.
I'll resist the temptation to bikeshed on the name :-) OK. jeff
