From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 856C93858025 for ; Thu, 3 Aug 2023 13:50:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 856C93858025 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691070633; h=from:from:reply-to:subject:subject: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=/rwahFOFNorCShyWDnAEWjBUPMigw+euUBV3O/qB7hk=; b=HtQMVyfNZNZ2ZsN6kh81y0pEwHNKaE+QoL1UybW21DQxNHsO7LCaZaz0cFqpwbFXu0WcWt E4oDo3B6wWUyrD5CckKxgBp2mKDFggfoRf6aSgEoOPdxRwYlIVNrPMDc6bekhPRYNA0aD2 DEysVyXUUtd7USdh5KTyhhPB1tfokDA= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-QtH1JYO4N1ivdGEDTYdL8g-1; Thu, 03 Aug 2023 09:50:30 -0400 X-MC-Unique: QtH1JYO4N1ivdGEDTYdL8g-1 Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2684179be07so512622a91.2 for ; Thu, 03 Aug 2023 06:50:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691070629; x=1691675429; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/rwahFOFNorCShyWDnAEWjBUPMigw+euUBV3O/qB7hk=; b=Wt0oTB5R5fZc6pIdP3GvWAxYhx7w0BKcNys9l8pHG+QbBo8T8VWqwsCQ6zUg/s/5Vo ov1iivr/LMExAMI6P1gsorropbtxGtW5e2ewhwt9pv1VEF+Uhftfq8oBmkZ9okWwHpKx Tda1IpucYLX42tuIZzGtYu0h2Fgaxp9oY4jTHztKw0hJgZZ+8/kmF1nPzU4yrhXPYJoP 7fzKI8YPwR3CGi6/GJOqOM9/uT+b10SAWqRUDEMG/2ILIAWn35Dmi+jq6YoKIjpCUl9H mhX/+/HhzhsF0vijoXqzb75zPqQrYiHgilb8WcbyQH4k4M+XjUSJlrcSqxUuciCzSmFz CTmQ== X-Gm-Message-State: ABy/qLYE/PBTuUnFct1m7cVpnUZ9JRZvP26cMKA7rmz11D1dMDrPu7jQ 3BMmrqJPyYYSs/RPT/jMKnX9CJKcmaJN9VYJTM6VDPYCZ+xrlpboSz+rCXUUnjfemOWlGLqGeYX K9/SgD57Yo/gDSn6f3UKO9UIy+eHx+dpeqsgqWQ== X-Received: by 2002:a17:90a:9112:b0:263:856:fcdf with SMTP id k18-20020a17090a911200b002630856fcdfmr16269738pjo.12.1691070629032; Thu, 03 Aug 2023 06:50:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGOSkap1cNuJ44modg8/vljbUuvZqzcQ2pdypWhyBsOu22hjYmXKHJNy0NIxXlVFHV5CIQiI7adMYgznyTBymQ= X-Received: by 2002:a17:90a:9112:b0:263:856:fcdf with SMTP id k18-20020a17090a911200b002630856fcdfmr16269723pjo.12.1691070628665; Thu, 03 Aug 2023 06:50:28 -0700 (PDT) MIME-Version: 1.0 References: <20230801200627.2901739-1-tromey@adacore.com> In-Reply-To: <20230801200627.2901739-1-tromey@adacore.com> From: Alexandra Petlanova Hajkova Date: Thu, 3 Aug 2023 15:50:17 +0200 Message-ID: Subject: Re: [PATCH] Use frame.name() in FrameDecorator To: Tom Tromey Cc: gdb-patches@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000001cae470602051048" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 List-Id: --0000000000001cae470602051048 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 1, 2023 at 10:07=E2=80=AFPM Tom Tromey via Gdb-patches < gdb-patches@sourceware.org> wrote: > A co-worker pointed out that gdb's DAP implementation might return an > integer for the name of a stack frame, like: > > {"id": 1, "name": 93824992310799, ...} > > This can be seen currently in the logs of the bt-nodebug.exp test > case. > > What is happening is that FrameDecorator falls back on returning the > PC when the frame's function symbol cannot be found, relying on the > gdb core to look up the minsym and print its name. > > This can actually yield the wrong answer sometimes, because it falls > into the get_frame_pc / get_frame_address_in_block problem -- if the > frame is at a call to a noreturn function, the PC in this case might > appear to be in the next function in memory. For more on this, see: > > https://sourceware.org/bugzilla/show_bug.cgi?id=3D8416 > > and related bugs. > > However, there's a different approach we can take: the code here can > simply use Frame.name. This handles the PC problem correctly, and > gets us the information we need. > --- > > I tested this for Fedora-Rawhide on ppc64le. I can confirm this causes no regressions and I can see {"id": 1, "name": "no_debug_info", is outputted instead of {"id": 1, "name": 268501652. --0000000000001cae470602051048--