[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] x86: improve .debug_line contents for assembly sources


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 14 Apr 2022 14:52:47 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7KWP01lNvpF59J6Of1jzl/vhPMK3P3XrLhG0Ma26yVg=; b=HyWu41S3zmzKObbk0alSZ+iVmVE5aC2X+iXFQ4dvL8V5Glu5WL2m8NlXAJz+KhIoBFHPdfCQyUrwZrEu87rWpypr8u11rl1g5nydrv5iYZGEFMQNB6sSWKMgOXq0PP9IiVkBynHgFhQ1oPdLI9c/SxAAAEmTsUTQ1n4OwWYK7jfynTRF55wOtgqQVufwH3gTmxmx7FwqZzqIIRPH1I6aWsMG/axSBQgTwCsyoRO5RyhZyUJnV8s4sw//YFTh5WAv9sMFit2Nxui6jSyqIWGmxBLN57PdrVnOO6OMBDfdANXwDBluQ1wPalF00VzPQJnrUeAwhNEfuzcFfLbECuT7Cw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HSY2dA9wasFULBg6SnzcXh/XpEWm7/4XEClfpppvrA5tEkNBwkayCNNXXC030lMZ9hIFJEAIb1JINj7sbJvDBpzvJbXfoj6CS70e0uoYPqOI5wMnGuFcIdQ+om7NqL8cNQP+d6byH/bYPqLiqITnmXKW/7uDigBm/VX1YL6xKE/Ya7FFzBChqhW21xM079nsK6qbsiD8iRPJd0u0Y+RkS2KjqN1r/HibdUhB9moznwQFUF+BS1ZXoGLh/HbHtfCTQBO7vGIXGmjIq34bskOkGkphB+6GTsG807wR6mBCthyIaaNFZ0gpJL9oAu2lu788GtqRQA5uOOKlQFPEQWh3Eg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 14 Apr 2022 12:52:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.04.2022 14:40, Roger Pau Monné wrote:
> On Tue, Apr 12, 2022 at 12:27:34PM +0200, Jan Beulich wrote:
>> While future gas versions will allow line number information to be
>> generated for all instances of .irp and alike [1][2], the same isn't
>> true (nor immediately intended) for .macro [3]. Hence macros, when they
>> do more than just invoke another macro or issue an individual insn, want
>> to have .line directives (in header files also .file ones) in place.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> [1] 
>> https://sourceware.org/git?p=binutils-gdb.git;a=commitdiff;h=7992631e8c0b0e711fbaba991348ef6f6e583725
>> [2] 
>> https://sourceware.org/git?p=binutils-gdb.git;a=commitdiff;h=2ee1792bec225ea19c71095cee5a3a9ae6df7c59
>> [3] 
>> https://sourceware.org/git?p=binutils-gdb.git;a=commitdiff;h=6d1ace6861e999361b30d1bc27459ab8094e0d4a
>> ---
>> Using .file has the perhaps undesirable side effect of generating a fair
>> amount of (all identical) STT_FILE entries in the symbol table. We also
>> can't use the supposedly assembler-internal (and hence undocumented)
>> .appfile anymore, as it was removed [4]. Note that .linefile (also
>> internal/undocumented) as well as the "# <line> <file>" constructs the
>> compiler emits, leading to .linefile insertion by the assembler, aren't
>> of use anyway as these are processed and purged when processing .macro
>> [3].
>>
>> [4] 
>> https://sourceware.org/git?p=binutils-gdb.git;a=commitdiff;h=c39e89c3aaa3a6790f85e80f2da5022bc4bce38b
>>
>> --- a/xen/arch/x86/include/asm/spec_ctrl_asm.h
>> +++ b/xen/arch/x86/include/asm/spec_ctrl_asm.h
>> @@ -24,6 +24,8 @@
>>  #include <asm/msr-index.h>
>>  #include <asm/spec_ctrl.h>
>>  
>> +#define FILE_AND_LINE .file __FILE__; .line __LINE__
> 
> Seeing as this seems to get added to all macros below, I guess you did
> consider (and discarded) introducing a preprocessor macro do to the
> asm macro definitons:
> 
> #define DECLARE_MACRO(n, ...) \
> .macro n __VA_ARGS__ \
>     .file __FILE__; .line __LINE__

No, I didn't even consider that. I view such as too obfuscating - there's
then e.g. no visual match with the .endm. Furthermore, as outlined in the
description, I don't think this wants applying uniformly. There are
macros which better don't have this added. Yet I also would prefer to not
end up with a mix of .macro and DECLARE_MACRO().

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.