From 6488583941b234e65b8d44aa1436fd871d6e16f2 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 7 Apr 2025 13:51:59 -0400 Subject: gdb/testsuite/dwarf: add support to generate DWARF 5 split compile units Add support to the DWARF assembler to generate DWARF 5 split compile units. The assembler knows how to generate DWARF < 5 split compile units (fission), DWARF 5 compile units, but not DWARF 5 split compile units. What's missing is: - using the right unit type in the header: skeleton for the unit in the main file and split_compile for the unit in the DWO file - have a way for the caller to specify the DWO ID that will end up in the unit header Add a dwo_id parameter to the cu proc. In addition to specifying the DWO ID, the presence of this parameter tells the assembler to use the skeleton or split_compile unit type. This is used in a subsequent patch. Change-Id: I05d9b189a0843ea6c2771b1d5e5a91762426dea9 Approved-By: Tom Tromey --- gdb/testsuite/lib/dwarf.exp | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'gdb/testsuite/lib') diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 943b80c..0a657f6 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -1441,6 +1441,17 @@ namespace eval Dwarf { # default = default # fission 0|1 - boolean indicating if generating Fission debug info # default = 0 + # dwo_id - The value to use as the dwo_id field of skeleton and + # split_compile unit headers. May only be used with DWARF + # version 5. + # + # If a dwo_id value is specified (is non-zero), this unit is + # assumed to be part of a skeleton/split_unit pair. The unit + # type will be chosen according to the `fission` value. + # + # When using DWARF version 5 and fission is non-zero, it is + # mandatory to provide a non-zero dwo_id value. + # default = 0 # label