From patchwork Mon Dec 19 13:53:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maurizio Papini X-Patchwork-Id: 34553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2399376wrn; Mon, 19 Dec 2022 05:54:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXt4eyuPLu5ozwqPPWtrXUR90zyGHl8UhefdKV8ElaxP1Vi09dLHBtFaQfRp0hLQc9nQGZ+L X-Received: by 2002:a05:6402:298d:b0:465:f6a9:cb7b with SMTP id eq13-20020a056402298d00b00465f6a9cb7bmr13519237edb.12.1671458047495; Mon, 19 Dec 2022 05:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671458047; cv=none; d=google.com; s=arc-20160816; b=rO7x6iHoBMB7TdLACKjXRnde3Ue57Z6YitiyCAJIe+hpdQyY3MrSPh18DQW9ri+/xh bYGZl7/8tl/Gd7+nQ2N/RR1GGs+QL/aQLggZQGA/5ycF1Hks3XxAV1IsbjwVQP1JmRV5 /n3HFVsBPfDnhBijj0W6oQ8BTsTfC5BvKpSeLw4qpjHxKnALEgJz1qowtBVKZ5CDZB/X XI5/zNearPRoB5BnyyToB/FVUMQqTAjDFUeRTUhdpw/LLbuHIDRIEpcwsbK5sJmpYHX7 QoUK8BIzF/0cCPdXO+qWyDid57fLl0g5112k35/QsGalb69TR3avjVGeHSqIen5bmpKs Hj7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=542C2g1tOZD+my6b/TAWGt17HlB0F0QIRC5bzLq9e7Y=; b=tJm8AepDQTHl4qrnvsHKGnmBGtnaIq3b+4ixy2uS42P0yLj8p4KXGDtXbTV7OnNGvN L072KWH3M3kSrM4J4SieZ/wFmlYmaczEw1AOTPyZX+mwQaAEGzkJjbexN4G1evIBajNM V8FPQMDYOJUDS+92B0rLlzFMGXq/emdQUhucvIjZM2rqSb6qtXVGK4AyZeRk5boPMAo5 mMX/6sM1liMCpTVLmwr8YBmb2/ksu/cFDPGeVfglbshPxYkMkQgzb7SLpXmRfaFQP+VY AnPtBEzaQvwA1YYHhb76b1dHAmBLYTTJAT3c/eFiyYauA/itE1qAOXM190gQc143I7KT 2CRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=DwRWpLKR; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h8-20020a056402094800b0046125ddf5easi4524580edz.185.2022.12.19.05.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 05:54:07 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=DwRWpLKR; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FBC43858C83 for ; Mon, 19 Dec 2022 13:54:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FBC43858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671458042; bh=542C2g1tOZD+my6b/TAWGt17HlB0F0QIRC5bzLq9e7Y=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DwRWpLKRq2bZpy1rXc9XfpEZTfCDqIImCKlcdomkwrNxhE6e+aKrmpxf3+2ojZD+Z uEgUSfsJck9+QOCwxBiNoUgnVZtFr7Jq0FLQRHNa58GYT26fXub12N7VG/FvSWGZgt vbF/3fv5Dca5ClOgEI/a6eHNxbAfBIBCTqfDrUEA= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 57A443858D39 for ; Mon, 19 Dec 2022 13:53:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57A443858D39 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-502-kf1_-JNIOtin30M9DhtSdQ-1; Mon, 19 Dec 2022 08:53:51 -0500 X-MC-Unique: kf1_-JNIOtin30M9DhtSdQ-1 Received: by mail-ed1-f69.google.com with SMTP id y20-20020a056402271400b0046c9a6ec30fso6581030edd.14 for ; Mon, 19 Dec 2022 05:53:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=542C2g1tOZD+my6b/TAWGt17HlB0F0QIRC5bzLq9e7Y=; b=WC9m5XsIFGsd6zf8wHeoFvJucXlqtOz4B4p7+rLDpfEcmF7IgTrybdbPYQGHx+mqOx HCc+3/t1kZNerf09rbv6EOYamRMwj2isp240K4Zt5NCkaxmMTuB9VfkGlHO2n+nXm4BG ROWtnQa09XX3tFmJqJSqfJ6NY4Sj0bu4CHguVvlLE0qC8fVfuSjurTPZ0RoD8qxaN0il XJQxxpgnpOlCiZibv/SCuyO5I5H08dDhr1iSN/8ey3SaGwAVNjkccqMx/00k+xlkI9sl 0InhYxBvUPRRjPG/XNhNfRNAtd1MPjIvc5y1mbXTrjp9XWVD8JLqp6WAaojf4ZhHC0b4 gulQ== X-Gm-Message-State: ANoB5pkaIzjprJT/nploY2OMEP/KeHl9ks6MpQIQ2yLDLJpLMfL4CZW8 Tpt9rTeuBERC3Wl3ITOcXcfd1mmmnv/D9y72BDTqUHmGMsk3Z/M9Vm1IHStybM8d1YZwxWyr8P/ 6RyPFmkIQGCrQunbtZ7SIwmeucDXL/nAZGlwRoHdyx56gQwSJCcjBqZVqbjIOUtISybfr X-Received: by 2002:a17:906:1c0c:b0:7c1:e7a:62e6 with SMTP id k12-20020a1709061c0c00b007c10e7a62e6mr35502065ejg.71.1671458030231; Mon, 19 Dec 2022 05:53:50 -0800 (PST) X-Received: by 2002:a17:906:1c0c:b0:7c1:e7a:62e6 with SMTP id k12-20020a1709061c0c00b007c10e7a62e6mr35502048ejg.71.1671458029928; Mon, 19 Dec 2022 05:53:49 -0800 (PST) Received: from ulissedini.. ([81.56.11.23]) by smtp.gmail.com with ESMTPSA id t21-20020a056402021500b00463bc1ddc76sm4377476edv.28.2022.12.19.05.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 05:53:49 -0800 (PST) To: binutils@sourceware.org Cc: Maurizio Papini Subject: [PATCH 1/2] addr2line: new option -n to add a newline at the end Date: Mon, 19 Dec 2022 14:53:02 +0100 Message-Id: <20221219135303.116222-2-mpapini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219135303.116222-1-mpapini@redhat.com> References: <20221219135303.116222-1-mpapini@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Maurizio Papini via Binutils From: Maurizio Papini Reply-To: Maurizio Papini Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752650781337057996?= X-GMAIL-MSGID: =?utf-8?q?1752650793132109677?= --- binutils/addr2line.c | 11 +++++++++-- binutils/doc/binutils.texi | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/binutils/addr2line.c b/binutils/addr2line.c index baf16716182..d9338e9f1ea 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -45,7 +45,7 @@ static bool with_functions; /* -f, show function names. */ static bool do_demangle; /* -C, demangle names. */ static bool pretty_print; /* -p, print on one line. */ static bool base_names; /* -s, strip directory names. */ - +static bool add_newline; /* -n, add a newline at the end. */ /* Flags passed to the name demangler. */ static int demangle_flags = DMGL_PARAMS | DMGL_ANSI; @@ -70,6 +70,7 @@ static struct option long_options[] = {"no-recursion-limit", no_argument, NULL, 'r'}, {"section", required_argument, NULL, 'j'}, {"target", required_argument, NULL, 'b'}, + {"add-newline", no_argument, NULL, 'n'}, {"help", no_argument, NULL, 'H'}, {"version", no_argument, NULL, 'V'}, {0, no_argument, 0, 0} @@ -102,6 +103,7 @@ usage (FILE *stream, int status) -C --demangle[=style] Demangle function names\n\ -R --recurse-limit Enable a limit on recursion whilst demangling. [Default]\n\ -r --no-recurse-limit Disable a limit on recursion whilst demangling\n\ + -n --add-newline Add a newline at the end of the output\n\ -h --help Display this information\n\ -v --version Display the program's version\n\ \n")); @@ -417,6 +419,8 @@ translate_addresses (bfd *abfd, asection *section) } } + if(add_newline) + printf("\n"); /* fflush() is essential for using this command as a server child process that reads addresses from a pipe and responds with line number information, processing one address at a @@ -505,7 +509,7 @@ main (int argc, char **argv) file_name = NULL; section_name = NULL; target = NULL; - while ((c = getopt_long (argc, argv, "ab:Ce:rRsfHhij:pVv", long_options, (int *) 0)) + while ((c = getopt_long (argc, argv, "ab:Ce:rRsfnHhij:pVv", long_options, (int *) 0)) != EOF) { switch (c) @@ -564,6 +568,9 @@ main (int argc, char **argv) case 'j': section_name = optarg; break; + case 'n': + add_newline = true; + break; default: usage (stderr, 1); break; diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index c9d52d7c92f..0940708d77e 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -3976,6 +3976,7 @@ addr2line [@option{-a}|@option{--addresses}] [@option{-f}|@option{--functions}] [@option{-s}|@option{--basename}] [@option{-i}|@option{--inlines}] [@option{-p}|@option{--pretty-print}] + [@option{-n}|@option{--add-newline}] [@option{-j}|@option{--section=}@var{name}] [@option{-H}|@option{--help}] [@option{-V}|@option{--version}] [addr addr @dots{}] @@ -4102,6 +4103,10 @@ Make the output more human friendly: each location are printed on one line. If option @option{-i} is specified, lines for all enclosing scopes are prefixed with @samp{(inlined by)}. +@item -n +@itemx --add-newline +Add a newline at the end of the output. + @item -r @itemx -R @itemx --recurse-limit From patchwork Mon Dec 19 13:53:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maurizio Papini X-Patchwork-Id: 34554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2400010wrn; Mon, 19 Dec 2022 05:55:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cqOMI0x/UgpCMstjsvrtr94izBi2gr9VAbTcmTQl2CRJ5yTKCK4Roj6ckLBVjiC7knzGi X-Received: by 2002:aa7:d54a:0:b0:461:b93c:47d2 with SMTP id u10-20020aa7d54a000000b00461b93c47d2mr53265092edr.27.1671458119216; Mon, 19 Dec 2022 05:55:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671458119; cv=none; d=google.com; s=arc-20160816; b=NQysE7xwH2tLpFAxgIPS9GMiZ+TS/ngPZ5c381ZN1wkmImiV/GcsOxUOPHufKCx9LE Qubq1wKWOJb0kCHCtLYAnHpu8Cj3IZ/8u2E3egMr7QnkFLbI6Pq8+6e05/QDezNGkObE jTP4yU0074aW4cib78y82PqsxoLEpcslbpIN3ZgNXKzHwZh/zOzyLDwO+oDxAu3+EDi1 7HLe4FdvtYx91KOD+7OuQPiuHtBX2oyTmpYn3xWyyi0qaoWtcatuCN3mrvYGNgTZLln/ FLn6D795yOVOrvi/U0W7vuOROzKHm8NUVQ4I5tVwSQbxXqSJG6FXIT48E2FMvxv4leJC HZaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=EwJv5lfRo2co2JlD5RBcqC2eu3pUtMyk+SNLIS9lONE=; b=iu+8MaN1aJBlWEJyT/k5bq833tQ2Gno3rx7+HGF0RqClZJVBx4ErXh056CYZvRz5RO W5NFDJ6GHhfEBfF7etaHnQWVpy9YfhpXSFSC+JOMmC0UoTf3XeHGA8MNdtYCaGEiovlo X9nT7umTj++TFFqFfHa7Y9folkYw558ZpnA39DOpmhHJTKWUZ1itJtMJERe1PpAds5j1 69dpUIWKmkeWG21NCbBvKPYv+ugP0deWKyI77LVxXMLEni6rAMZe0cUz9exFV8vu7R7S cftf+j8G9jUsvMVxa4mWgDjJz8oJHVODHs2y3dQMokoqN/7VrSPAs19egXHOcTln8JeD rRoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="E8t/w0EY"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s9-20020a508dc9000000b00469e7011949si7972024edh.508.2022.12.19.05.55.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 05:55:19 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="E8t/w0EY"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 14E383858039 for ; Mon, 19 Dec 2022 13:55:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14E383858039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671458108; bh=EwJv5lfRo2co2JlD5RBcqC2eu3pUtMyk+SNLIS9lONE=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=E8t/w0EY9dxaQiSCV7ypsKrJ4qAMh0OHNOeAjynMzx0KxxjIiuAVkPS75hAyE1mTG PpP4Mr/+UvEwS3irccWr+2mh4pbhSwBx843m3wAZ86lViM1GE2Ur5yReRQcxnbsjtA PVLVcftmXTS2ks3+LWX+prC/w6v3j87hqfV2+nA4= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8E9313858C1F for ; Mon, 19 Dec 2022 13:53:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8E9313858C1F Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-619-R8paYlmQMJ-QHKucajHj4g-1; Mon, 19 Dec 2022 08:53:54 -0500 X-MC-Unique: R8paYlmQMJ-QHKucajHj4g-1 Received: by mail-ed1-f69.google.com with SMTP id t17-20020a056402525100b00478b85eecedso3090874edd.18 for ; Mon, 19 Dec 2022 05:53:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EwJv5lfRo2co2JlD5RBcqC2eu3pUtMyk+SNLIS9lONE=; b=F/ojaXur41UoVVk5oUSZnxXGhJ2/ndgMuFj95pu3FHJzST+Jq8AzhnIpAJGZKcRmCq bPfJqvEn6P7nQeyi6g4F5N/dHpbUYHpsbp9DPMLTx5yEYcWC9aR4NeJWGFdRueW/Y8eM BMnMGFMTYi6vmCAuP2/Ir9tmt+MqPOY86vrKoEiYO0j1FyhljqaW981hNONrRBVgq5GX 4eKhllB8cMEogBMXVODIoEg/WLVkl7w5MR5ZaPOWo0JDviitu+tDPkM2sA/hMiXJSIi9 4LWLx01Ct5a+A3ZS47u/5AlhaLo6rfey9xUcvQznlFXiMV7kyTfxUtDXkj4MPytvcCbG 3zjw== X-Gm-Message-State: ANoB5pm38shWtLbl92zF0L4UZ6JSwsFwTuHSw/wgeHRyLOdjSQAY5+2V ce9CKcwuWjdFTOZPE+3qUsedw/d+5XWyu7rbx5WqGTVoWkydp3mFW8oQCtt8N0SHdTo5ZpU2D0v Gxq/NgRfs45H+MpJ2tj5uIQaFddb9y2XiRU4OyDgNX0br/SQNxhnAEa4tg5ejjxmqiAv4 X-Received: by 2002:a17:906:5655:b0:7c1:5464:3360 with SMTP id v21-20020a170906565500b007c154643360mr44269065ejr.65.1671458032935; Mon, 19 Dec 2022 05:53:52 -0800 (PST) X-Received: by 2002:a17:906:5655:b0:7c1:5464:3360 with SMTP id v21-20020a170906565500b007c154643360mr44269041ejr.65.1671458032666; Mon, 19 Dec 2022 05:53:52 -0800 (PST) Received: from ulissedini.. ([81.56.11.23]) by smtp.gmail.com with ESMTPSA id t21-20020a056402021500b00463bc1ddc76sm4377476edv.28.2022.12.19.05.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 05:53:52 -0800 (PST) To: binutils@sourceware.org Cc: Maurizio Papini Subject: [PATCH 2/2] addr2line: test to check -n option Date: Mon, 19 Dec 2022 14:53:03 +0100 Message-Id: <20221219135303.116222-3-mpapini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219135303.116222-1-mpapini@redhat.com> References: <20221219135303.116222-1-mpapini@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Maurizio Papini via Binutils From: Maurizio Papini Reply-To: Maurizio Papini Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752650869250257029?= X-GMAIL-MSGID: =?utf-8?q?1752650869250257029?= --- binutils/testsuite/binutils-all/addr2line.exp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/binutils/testsuite/binutils-all/addr2line.exp b/binutils/testsuite/binutils-all/addr2line.exp index 957ae55df33..59c0924412c 100644 --- a/binutils/testsuite/binutils-all/addr2line.exp +++ b/binutils/testsuite/binutils-all/addr2line.exp @@ -61,6 +61,16 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +\[Tt\] ${dot}fn" $output contents] then { pass "$testname -f option" } +#testcase for -n option: check the extra newline +#Using the same fn function address used in -f option. + set got [binutils_run $ADDR2LINE "-n -f -e tmpdir/testprog$exe [lindex $list 0]"] + set want "fn\n$srcdir/$subdir/testprog.c:\[0-9\]+\n\n" + if ![regexp $want $got] then { + fail "$testname -fn option $got\n" + } else { + pass "$testname -fn option" + } + #testcase for -s option. #Using the same fn function address used in -f option. set got [binutils_run $ADDR2LINE "-s -e tmpdir/testprog$exe [lindex $list 0]"]