From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id BF0E63857806 for ; Wed, 11 Oct 2023 08:42:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF0E63857806 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 1DD9A21880; Wed, 11 Oct 2023 08:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697013757; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=twV5aY2C/aXIpiMLvA2OcCyJy8gfTVH8/aFgl61JgQU=; b=Mnnvz5nd+R8rpe5WdOgrvBQsbK/lKQwaoRXZiypnOskvwkoJ0SEt5XBDcIdLjgIeVVdvLw sAYKtOOJp+B/em4p2M2nfLIofTo+hPkypYucOyc+OGqwas1lQyGZhm+3QP56GKhahbnqYH HzWGPAPH8Ejc81ue6dNnv9AZS+9LNG0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697013757; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=twV5aY2C/aXIpiMLvA2OcCyJy8gfTVH8/aFgl61JgQU=; b=RGndPB4SCKOgG2HHOxEIjPXE9n5HUuYzOY2rN6YnOCLf/a9ZWWRVUGskNIWQvaioodS/Av XhtOx3QeNC/psXBw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id DC7E12C64B; Wed, 11 Oct 2023 08:42:36 +0000 (UTC) Date: Wed, 11 Oct 2023 08:42:36 +0000 (UTC) From: Richard Biener To: Rishi Raj cc: Martin Jambor , Jan Hubicka , gcc@gcc.gnu.org Subject: Re: Clarification regarding various classes DIE's attribute value class In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 10 Oct 2023, Rishi Raj wrote: > Hello, > I am working on a project to produce the LTO object file from the compiler > directly. So far, we have > correctly outputted .symtab along with various .debug sections. The only > thing remaining is to > correctly output attribute values and their corresponding values in the > .debug_info section. This is done by the output_die function in > dwarf2out.cc based on the value's class. However, the same > function is used in dwarf2out_finish as well as dwarf2out_early_finish, so > I suspect that not every value class is being used in dwarfout_early_finish > (mainly I am interested in -flto mode). As there is little documentation on > the same, I experimented by commenting out the various cases of value class > in output die. I found that the classes such as dw_val_class_addr, > dw_val_class_high_pc, and dw_val_class_vms_delta aren't being used during > the early_finish of LTO mode. I might be wrong, as my observation is based > on commenting out and testing a few pieces of code that might need to be > completed. So, can anyone please tell out of these 30 classes that are > relevant to dwarf2out_early_finish in LTO mode or at least point out some > documentation if it exists? There's no documentation. The constraint is that early debug should not have relocations to .text, thus it doesn't have location lists for example. I believe you should be able to mostly hook into the dwarf2asm hooks that perform the output (but those also add labels and label references). If leaving out support for some value classes makes your live easier I suggest to handle them with a gcc_unreachable () handler so you'll get ICEs whenever one turns out to be required. > enum dw_val_class > { > dw_val_class_none, > dw_val_class_addr, > dw_val_class_offset, > dw_val_class_loc, > dw_val_class_loc_list, > dw_val_class_range_list, > dw_val_class_const, > dw_val_class_unsigned_const, > dw_val_class_const_double, > dw_val_class_wide_int, > dw_val_class_vec, > dw_val_class_flag, > dw_val_class_die_ref, > dw_val_class_fde_ref, > dw_val_class_lbl_id, > dw_val_class_lineptr, > dw_val_class_str, > dw_val_class_macptr, > dw_val_class_loclistsptr, > dw_val_class_file, > dw_val_class_data8, > dw_val_class_decl_ref, > dw_val_class_vms_delta, > dw_val_class_high_pc, > dw_val_class_discr_value, > dw_val_class_discr_list, > dw_val_class_const_implicit, > dw_val_class_unsigned_const_implicit, > dw_val_class_file_implicit, > dw_val_class_view_list, > dw_val_class_symview > }; > > -- > Rishi > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)