From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id B0294383D03C for ; Mon, 24 May 2021 14:22:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0294383D03C Received: by mail-qt1-x831.google.com with SMTP id c10so20696139qtx.10 for ; Mon, 24 May 2021 07:22:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1uyxJI/lil0g/VZWRLmrW4Jiket18lT2xP7+HxFMJLg=; b=d/CaldIX/n5qwZIFEXnmwhhj3Cctw+EVx/Kp1c9n9GezUlh/vWPLkj+WpvYr4lqmW8 neBHcuZOs0AzMjgEFzM5hOVzHk8c2G9/aNd+J9d7S5+WxNC9wpqVa9WFTOlp2RD5hCDo cm2C5yDBSzKd+bdcLaR3YiYtSegV9OvD9IZqJDLw60mDQ0JN56B3Pxfx3OX3gOT+6InS Sg5zKp2e+Xb6UhYkdycKgZE+9T1e2VSH/3m1M0KCO7MKF/RUSouRuS1zdgQEt61s6zyy eK65tUSdd7Gse66JJXUy7nMqD7LbR1/C7chcDNIGVYtgYDs/PMUxfN0/PJdmQ/VMatRW WQQg== X-Gm-Message-State: AOAM532O2Gv3f96oau5OCjMcq0TZOWpmRWe3nX4etVJub03uYTZvQkXf fagjA+TBjyq8TCOwJ9YMY+7bHw== X-Google-Smtp-Source: ABdhPJyPFil2JyJCdR1OhSvLKtYE541cbIH9XFcFACB7pUeNxIKFJHeaK2lxBPLhPbgb34BLtW692w== X-Received: by 2002:a05:622a:309:: with SMTP id q9mr25629281qtw.320.1621866171229; Mon, 24 May 2021 07:22:51 -0700 (PDT) Received: from ?IPv6:2804:7f0:4841:5c9d:b127:8b5d:e87f:5e7d? ([2804:7f0:4841:5c9d:b127:8b5d:e87f:5e7d]) by smtp.gmail.com with ESMTPSA id b13sm10703254qkl.16.2021.05.24.07.22.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 07:22:50 -0700 (PDT) Subject: Re: GDB shared library tracking with stap probes x _dl_debug_state From: Luis Machado To: Florian Weimer , systemtap Cc: Sergio Durigan Junior , Luis Machado via Gdb , Luis Machado via Libc-alpha , doko@debian.org, "Maciej W. Rozycki" , Ulrich Weigand References: <878s4qb7fj.fsf@oldenburg.str.redhat.com> <07b03137-a083-dada-68da-965779cd41ff@linaro.org> <87bl9mi4xi.fsf@paluero> <87tunda403.fsf@oldenburg.str.redhat.com> <22cab26b-8931-ffc0-5324-bff640773924@linaro.org> Message-ID: Date: Mon, 24 May 2021 11:22:47 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <22cab26b-8931-ffc0-5324-bff640773924@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 14:22:53 -0000 Maciej, Do you have any feedback on this for MIPS? On 5/10/21 11:16 AM, Luis Machado wrote: > cc-ing Maciej and Ulrich for feedback about MIPS / rs6000. I see both > architectures rely on marking some symbols as special, for different > purposes. > > On 5/8/21 7:55 AM, Florian Weimer wrote: >> * Sergio Durigan Junior: >> >>> On Friday, May 07 2021, Luis Machado via Gdb wrote: >>> >>>> On 5/7/21 5:44 PM, Florian Weimer wrote: >>>>> * Luis Machado via Libc-alpha: >>>>> >>>>>> That's all fine, but there is one small detail that doesn't work for >>>>>> armhf, and that is discovering if we're dealing with a PC that is arm >>>>>> mode or thumb mode. >>>>> Is it possible to recognize Arm mode vs thumb mode based on the NOP >>>>> encoding at the probe address? >>>>> >>>> >>>> If we know the instruction is a NOP, it might be possible. >>> >>> I think it's guaranteed that the instruction is always going to be a >>> NOP. > > That's good, but ... > >> >> Maybe we can add a comment to that effect to the Systemtap sources? >> >> Start of the thread is here: >> >>    >> >> I think there are four distinct two-byte patterns at the probe >> addressing, depending on endianess and thumb/non-thumb mode.  Looking at >> the instruction has the clear advantage that it works with today's >> binaries. > ... the way the breakpoint selection works doesn't take into account > additional input like this. It would be a non-trivial change. Not too > complex, but still not trivial. > > If this is to be implemented, it would be nice to make sure there are > other architectures affected by this problem and that this sort of > solution also works for them. > > Maciej, do you think MIPS will run into the same issue? If so, is this > an acceptable solution? > > I still think having the symbol information is a cleaner solution.