From patchwork Wed Apr 26 12:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 68301 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC2923858C62 for ; Wed, 26 Apr 2023 12:20:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC2923858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682511634; bh=GmHzBOCoc3IuqQeJ4FDBBC7fJeb4cIUgjjVAEzsQtNc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=vlmrfCklLqBGH2kgzImpMuWZZ5G9rz5Xv8erJCSuVuAmKhY44lT04r56ikb7JCmT7 8mmbzgs2DWsl3LF9MJc2pWVN1IsQts/j/0BVHGyP30KFQahpkm3dccqW+kz80M7KLt Iwttvs0qh/B+MnfPwjGVPfmCCDVH/PYVx/Jw3NWY= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@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 D3FD03858CDA for ; Wed, 26 Apr 2023 12:20:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3FD03858CDA Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-QFpqJOL1OGWvQdf1T_eCXQ-1; Wed, 26 Apr 2023 08:20:22 -0400 X-MC-Unique: QFpqJOL1OGWvQdf1T_eCXQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-5ef81bca65aso100913986d6.2 for ; Wed, 26 Apr 2023 05:20:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682511621; x=1685103621; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GmHzBOCoc3IuqQeJ4FDBBC7fJeb4cIUgjjVAEzsQtNc=; b=Kp7VT8fiejbso6h0z8UO5ue6m1GnoHYVzbssynLjowd6yExUMNwyzRoj+r3a+iPXu9 nmzHrblQeuwh5vxe+X06Ljm0ZtbzGsZZvBCXZtkO2YZDSzZpFmDyD4cifuCojXFRCJ/X GDBqNiEsVYtKX3Ht5rdg/MDcP2HxxY81iWQlPiWuHVUniHb4qCKy/q7qz2q76/Aub9DK gt39I2wj0vPQj6TBL2aFhnAcLMcV9a4zHAVAj3nI+3fY9uM/p9B3wWHjFoQ/0smMYydA lVZvDjJvXV4rQMVVO9qiN0zAjmQ5XeZXFub6bon7sqBgzf7tyaWThf6oPqopUdunCE9q DNNg== X-Gm-Message-State: AAQBX9d7+6LLfVKb9qaMi6bNGg0HIHMJRe1XvsFLslioO+/3LoHkRi71 3gSC4fgxJCQzeyfoVkBpCNgDwMA4GlfmZdQqas4mmbjdMuhINemEqCqEDdooNgWahoqxVkKuk0F wihxPqw7clViCrTJDSa1giBJJ9nbdy6o7wa2w6cL3QWuYhO29Rl107KsLzcAaUY0hZCv0ENn2Ru ct X-Received: by 2002:a05:6214:d4e:b0:5fa:8692:3882 with SMTP id 14-20020a0562140d4e00b005fa86923882mr38508552qvr.16.1682511619905; Wed, 26 Apr 2023 05:20:19 -0700 (PDT) X-Google-Smtp-Source: AKy350Z0V+HOERJyE27r0kzS9gp0Jz+3wIjzrH2hkk58mWtwHsp2FWFnd+PBeJB9RKVYhNZxWvnnSQ== X-Received: by 2002:a05:6214:d4e:b0:5fa:8692:3882 with SMTP id 14-20020a0562140d4e00b005fa86923882mr38508313qvr.16.1682511617611; Wed, 26 Apr 2023 05:20:17 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id bj11-20020a05620a190b00b0074e21c3bc8asm5065732qkb.126.2023.04.26.05.20.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 05:20:17 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 9B44FB5078; Wed, 26 Apr 2023 14:20:14 +0200 (CEST) To: libabigail@sourceware.org Subject: [PATCH, applied] writer: Annotate pointer representation Organization: Red Hat / France X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Wed, 26 Apr 2023 14:20:14 +0200 Message-ID: <875y9i96o1.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 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, T_SCC_BODY_TEXT_LINE 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: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, When starring at abixml I noticed that abixml --annotate would not annotate pointer-type-def XML elements. This patch fixes that and makes the code of write_pointer_type_def easier to debug. * src/abg-writer.cc (write_pointer_type_def): Invoke annotate. Add a temporary for the output of write_context::get_id_for_type. It makes it easier to inspect in the debugger. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-annotate/test1.abi: Adjust. * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-annotate/test21-pr19092.so.abi: Adjust. * tests/data/test-annotate/test5.o.abi: Adjust. Signed-off-by: Dodji Seketeli --- src/abg-writer.cc | 16 ++-- tests/data/test-annotate/libtest23.so.abi | 1 + .../test-annotate/libtest24-drop-fns-2.so.abi | 2 + .../test-annotate/libtest24-drop-fns.so.abi | 2 + tests/data/test-annotate/test1.abi | 1 + .../data/test-annotate/test13-pr18894.so.abi | 11 +++ .../data/test-annotate/test14-pr18893.so.abi | 33 ++++++++ .../data/test-annotate/test15-pr18892.so.abi | 84 +++++++++++++++++++ .../data/test-annotate/test17-pr19027.so.abi | 25 ++++++ ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 19 +++++ ...19-pr19023-libtcmalloc_and_profiler.so.abi | 48 +++++++++++ ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 23 +++++ .../data/test-annotate/test21-pr19092.so.abi | 55 ++++++++++++ tests/data/test-annotate/test5.o.abi | 1 + 14 files changed, 315 insertions(+), 6 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index d6cd78d1..850c8759 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -2741,15 +2741,19 @@ write_pointer_type_def(const pointer_type_def_sptr& decl, ostream& o = ctxt.get_ostream(); + annotate(decl, ctxt, indent); + + do_indent(o, indent); + + string i; + + o << "get_pointed_to_type(); - annotate(decl->get_canonical_type(), ctxt, indent); + i = ctxt.get_id_for_type(pointed_to_type); - do_indent(o, indent); - o << "get_translation_unit()->get_address_size()), 0); - string i = id; + i = id; if (i.empty()) i = ctxt.get_id_for_type(decl); diff --git a/tests/data/test-annotate/libtest23.so.abi b/tests/data/test-annotate/libtest23.so.abi index 2eb9eac2..d8745ff3 100644 --- a/tests/data/test-annotate/libtest23.so.abi +++ b/tests/data/test-annotate/libtest23.so.abi @@ -474,6 +474,7 @@ + diff --git a/tests/data/test-annotate/libtest24-drop-fns-2.so.abi b/tests/data/test-annotate/libtest24-drop-fns-2.so.abi index bd43c4d8..b8ce810c 100644 --- a/tests/data/test-annotate/libtest24-drop-fns-2.so.abi +++ b/tests/data/test-annotate/libtest24-drop-fns-2.so.abi @@ -528,7 +528,9 @@ + + diff --git a/tests/data/test-annotate/libtest24-drop-fns.so.abi b/tests/data/test-annotate/libtest24-drop-fns.so.abi index bd43c4d8..b8ce810c 100644 --- a/tests/data/test-annotate/libtest24-drop-fns.so.abi +++ b/tests/data/test-annotate/libtest24-drop-fns.so.abi @@ -528,7 +528,9 @@ + + diff --git a/tests/data/test-annotate/test1.abi b/tests/data/test-annotate/test1.abi index 7eb74bd5..b8b8c468 100644 --- a/tests/data/test-annotate/test1.abi +++ b/tests/data/test-annotate/test1.abi @@ -184,6 +184,7 @@ + diff --git a/tests/data/test-annotate/test13-pr18894.so.abi b/tests/data/test-annotate/test13-pr18894.so.abi index 02690a9d..e43ea84d 100644 --- a/tests/data/test-annotate/test13-pr18894.so.abi +++ b/tests/data/test-annotate/test13-pr18894.so.abi @@ -609,7 +609,9 @@ + + @@ -1605,6 +1607,7 @@ + @@ -2397,6 +2400,7 @@ + @@ -2530,7 +2534,9 @@ + + @@ -3243,6 +3249,7 @@ + @@ -3475,6 +3482,7 @@ + @@ -3670,6 +3678,7 @@ + @@ -4078,6 +4087,7 @@ + @@ -4196,6 +4206,7 @@ + diff --git a/tests/data/test-annotate/test14-pr18893.so.abi b/tests/data/test-annotate/test14-pr18893.so.abi index ff278045..d504e9d1 100644 --- a/tests/data/test-annotate/test14-pr18893.so.abi +++ b/tests/data/test-annotate/test14-pr18893.so.abi @@ -850,6 +850,7 @@ + @@ -1901,6 +1902,7 @@ + @@ -2741,6 +2743,7 @@ + @@ -4313,6 +4316,7 @@ + @@ -6789,6 +6793,7 @@ + @@ -10219,6 +10224,7 @@ + @@ -10251,6 +10257,7 @@ + @@ -11906,6 +11913,7 @@ + @@ -12870,7 +12878,9 @@ + + @@ -13721,6 +13731,7 @@ + @@ -14156,6 +14167,7 @@ + @@ -14236,6 +14248,7 @@ + @@ -14396,6 +14409,7 @@ + @@ -14596,6 +14610,7 @@ + @@ -14603,6 +14618,7 @@ + @@ -15497,6 +15513,7 @@ + @@ -15628,6 +15645,7 @@ + @@ -15897,7 +15915,9 @@ + + @@ -16858,6 +16878,7 @@ + @@ -17786,9 +17807,11 @@ + + @@ -18360,9 +18383,11 @@ + + @@ -19851,7 +19876,9 @@ + + @@ -19951,6 +19978,7 @@ + @@ -19958,9 +19986,11 @@ + + @@ -22800,6 +22830,7 @@ + @@ -23045,7 +23076,9 @@ + + diff --git a/tests/data/test-annotate/test15-pr18892.so.abi b/tests/data/test-annotate/test15-pr18892.so.abi index 2f561b92..17b85867 100644 --- a/tests/data/test-annotate/test15-pr18892.so.abi +++ b/tests/data/test-annotate/test15-pr18892.so.abi @@ -3036,6 +3036,7 @@ + @@ -3155,7 +3156,9 @@ + + @@ -3401,7 +3404,9 @@ + + @@ -3464,6 +3469,7 @@ + @@ -3508,7 +3514,9 @@ + + @@ -3593,7 +3601,9 @@ + + @@ -3629,6 +3639,7 @@ + @@ -3659,10 +3670,13 @@ + + + @@ -4116,7 +4130,9 @@ + + @@ -4343,7 +4359,9 @@ + + @@ -4360,7 +4378,9 @@ + + @@ -4645,7 +4665,9 @@ + + @@ -5412,7 +5434,9 @@ + + @@ -5671,7 +5695,9 @@ + + @@ -5680,7 +5706,9 @@ + + @@ -6200,7 +6228,9 @@ + + @@ -6832,7 +6862,9 @@ + + @@ -8043,7 +8075,9 @@ + + @@ -8092,6 +8126,7 @@ + @@ -8172,6 +8207,7 @@ + @@ -8229,7 +8265,9 @@ + + @@ -8621,6 +8659,7 @@ + @@ -8662,7 +8701,9 @@ + + @@ -8894,7 +8935,9 @@ + + @@ -9008,7 +9051,9 @@ + + @@ -9111,7 +9156,9 @@ + + @@ -9886,6 +9933,7 @@ + @@ -9943,7 +9991,9 @@ + + @@ -10536,6 +10586,7 @@ + @@ -10673,6 +10724,7 @@ + @@ -12373,14 +12425,18 @@ + + + + @@ -27292,6 +27348,7 @@ + @@ -27440,7 +27497,9 @@ + + @@ -28599,8 +28658,11 @@ + + + @@ -35351,6 +35413,7 @@ + @@ -35582,7 +35645,9 @@ + + @@ -35698,7 +35763,9 @@ + + @@ -36956,6 +37023,7 @@ + @@ -37058,6 +37126,7 @@ + @@ -37604,6 +37673,7 @@ + @@ -39165,7 +39235,9 @@ + + @@ -40494,6 +40566,7 @@ + @@ -40627,7 +40700,9 @@ + + @@ -40993,7 +41068,9 @@ + + @@ -42877,6 +42954,7 @@ + @@ -43043,7 +43121,9 @@ + + @@ -43426,7 +43506,9 @@ + + @@ -43474,7 +43556,9 @@ + + diff --git a/tests/data/test-annotate/test17-pr19027.so.abi b/tests/data/test-annotate/test17-pr19027.so.abi index b7bb3774..b028ce86 100644 --- a/tests/data/test-annotate/test17-pr19027.so.abi +++ b/tests/data/test-annotate/test17-pr19027.so.abi @@ -1089,6 +1089,7 @@ + @@ -3030,6 +3031,7 @@ + @@ -3325,6 +3327,7 @@ + @@ -3754,6 +3757,7 @@ + @@ -5109,7 +5113,9 @@ + + @@ -9067,11 +9073,13 @@ + + @@ -10418,6 +10426,7 @@ + @@ -10642,6 +10651,7 @@ + @@ -11085,7 +11095,9 @@ + + @@ -15903,7 +15915,9 @@ + + @@ -30329,7 +30343,9 @@ + + @@ -30576,6 +30592,7 @@ + @@ -30766,6 +30783,7 @@ + @@ -30777,6 +30795,7 @@ + @@ -30800,6 +30819,7 @@ + @@ -31100,7 +31120,9 @@ + + @@ -31548,6 +31570,7 @@ + @@ -31771,6 +31794,7 @@ + @@ -31930,6 +31954,7 @@ + diff --git a/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi b/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi index b93b6c8c..d0bb7764 100644 --- a/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi +++ b/tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi @@ -7505,6 +7505,7 @@ + @@ -10290,7 +10291,9 @@ + + @@ -12418,7 +12421,9 @@ + + @@ -16783,7 +16788,9 @@ + + @@ -17160,7 +17167,9 @@ + + @@ -18226,7 +18235,9 @@ + + @@ -20177,7 +20188,9 @@ + + @@ -22509,7 +22522,9 @@ + + @@ -27232,7 +27247,9 @@ + + @@ -27605,7 +27622,9 @@ + + diff --git a/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi b/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi index 63e2f543..f180e3c6 100644 --- a/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi +++ b/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi @@ -2371,6 +2371,7 @@ + @@ -2743,6 +2744,7 @@ + @@ -2834,6 +2836,7 @@ + @@ -2953,6 +2956,7 @@ + @@ -3421,6 +3425,7 @@ + @@ -3678,7 +3683,9 @@ + + @@ -4055,7 +4062,9 @@ + + @@ -14014,7 +14023,9 @@ + + @@ -17193,7 +17204,9 @@ + + @@ -17464,7 +17477,9 @@ + + @@ -17614,6 +17629,7 @@ + @@ -18161,7 +18177,9 @@ + + @@ -18430,7 +18448,9 @@ + + @@ -19231,6 +19251,7 @@ + @@ -19361,7 +19382,9 @@ + + @@ -20372,7 +20395,9 @@ + + @@ -20440,7 +20465,9 @@ + + @@ -21315,7 +21342,9 @@ + + @@ -21545,6 +21574,7 @@ + @@ -22248,7 +22278,9 @@ + + @@ -22458,7 +22490,9 @@ + + @@ -22488,6 +22522,7 @@ + @@ -22566,7 +22601,9 @@ + + @@ -22768,7 +22805,9 @@ + + @@ -22839,6 +22878,7 @@ + @@ -24150,6 +24190,7 @@ + @@ -24528,7 +24569,9 @@ + + @@ -27587,6 +27630,7 @@ + @@ -29641,7 +29685,9 @@ + + @@ -33756,7 +33802,9 @@ + + diff --git a/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi b/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi index 455bf7b2..a11602fa 100644 --- a/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi +++ b/tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi @@ -4570,6 +4570,7 @@ + @@ -8592,7 +8593,9 @@ + + @@ -10256,7 +10259,9 @@ + + @@ -11278,7 +11283,9 @@ + + @@ -11743,7 +11750,9 @@ + + @@ -19046,7 +19055,9 @@ + + @@ -23575,7 +23586,9 @@ + + @@ -23993,6 +24006,7 @@ + @@ -24411,7 +24425,9 @@ + + @@ -28632,7 +28648,9 @@ + + @@ -29326,6 +29344,7 @@ + @@ -29636,7 +29655,9 @@ + + @@ -30607,7 +30628,9 @@ + + diff --git a/tests/data/test-annotate/test21-pr19092.so.abi b/tests/data/test-annotate/test21-pr19092.so.abi index a69d558f..0b7e8bfa 100644 --- a/tests/data/test-annotate/test21-pr19092.so.abi +++ b/tests/data/test-annotate/test21-pr19092.so.abi @@ -890,6 +890,7 @@ + @@ -1835,6 +1836,7 @@ + @@ -1950,7 +1952,9 @@ + + @@ -2698,7 +2702,9 @@ + + @@ -3757,7 +3763,9 @@ + + @@ -3862,6 +3870,7 @@ + @@ -3891,7 +3900,9 @@ + + @@ -4002,7 +4013,9 @@ + + @@ -4446,7 +4459,9 @@ + + @@ -4599,7 +4614,9 @@ + + @@ -4796,6 +4813,7 @@ + @@ -5057,7 +5075,9 @@ + + @@ -5677,6 +5697,7 @@ + @@ -5908,7 +5929,9 @@ + + @@ -6337,7 +6360,9 @@ + + @@ -6411,6 +6436,7 @@ + @@ -6571,7 +6597,9 @@ + + @@ -8768,7 +8796,9 @@ + + @@ -9170,7 +9200,9 @@ + + @@ -9264,7 +9296,9 @@ + + @@ -9367,7 +9401,9 @@ + + @@ -9413,7 +9449,9 @@ + + @@ -9531,6 +9569,7 @@ + @@ -9984,7 +10023,9 @@ + + @@ -10202,7 +10243,9 @@ + + @@ -10320,6 +10363,7 @@ + @@ -10334,7 +10378,9 @@ + + @@ -10529,6 +10575,7 @@ + @@ -10592,7 +10639,9 @@ + + @@ -10806,6 +10855,7 @@ + @@ -11116,6 +11166,7 @@ + @@ -11269,6 +11320,7 @@ + @@ -11295,10 +11347,13 @@ + + + diff --git a/tests/data/test-annotate/test5.o.abi b/tests/data/test-annotate/test5.o.abi index 9c661f3b..c8be4cfa 100644 --- a/tests/data/test-annotate/test5.o.abi +++ b/tests/data/test-annotate/test5.o.abi @@ -6,6 +6,7 @@ +