From 1f129e5e2b74c20a757f2809792af229b551b09b Mon Sep 17 00:00:00 2001 From: Mark Harmstone Date: Sat, 11 May 2024 08:19:53 -0600 Subject: [PATCH v2 3/4] Output line numbers in CodeView section Outputs the DEBUG_S_LINES block in the CodeView .debug$S section, which maps between line numbers and addresses. You'll need a fairly recent version of GAS for the .secidx directive to be recognized. gcc/ * dwarf2codeview.cc (DEBUG_S_LINES, LINE_LABEL): Define. (END_FUNC_LABEL): Likewise. (struct codeview_line, codeview_line_block): New structures. (codeview_function): Likewise. (line_label_num, func_label_num, funcs, last_func): New variables. (last_filename, last_file_id): Likewise. (codeview_source_line, write_line_numbers): New functions. (codeview_switch_text_section, codeview_end_epilogue): Likewise. (codeview_debug_finish): Call write_line_numbers. * dwarf2codeview.h (codeview_source_line): Prototype. (codeview_switch_text_secction, codeview_end_epilogue): Likewise. * dwarf2out.cc (dwarf2_end_epilogue): Add codeview support. (dwarf2out_switch_text_section): Likewise. (dwarf2out_source_line): Likewise. * opts.cc (finish_options): Handle codeview debugging symbols. --- gcc/dwarf2codeview.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/dwarf2codeview.h') diff --git a/gcc/dwarf2codeview.h b/gcc/dwarf2codeview.h index e2d732b..b6421b6 100644 --- a/gcc/dwarf2codeview.h +++ b/gcc/dwarf2codeview.h @@ -26,6 +26,9 @@ along with GCC; see the file COPYING3. If not see /* Debug Format Interface. Used in dwarf2out.cc. */ extern void codeview_debug_finish (void); +extern void codeview_source_line (unsigned int, const char *); extern void codeview_start_source_file (const char *); +extern void codeview_switch_text_section (); +extern void codeview_end_epilogue (void); #endif /* GCC_DWARF2CODEVIEW_H */ -- cgit v1.1