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 ESMTP id 6096C385781A for ; Sat, 8 May 2021 10:55:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6096C385781A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-z1nc2VcxM4ScV0rrbtuYvQ-1; Sat, 08 May 2021 06:55:37 -0400 X-MC-Unique: z1nc2VcxM4ScV0rrbtuYvQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57CBD8014D8; Sat, 8 May 2021 10:55:36 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F12C1037F23; Sat, 8 May 2021 10:55:33 +0000 (UTC) From: Florian Weimer To: systemtap Cc: Sergio Durigan Junior , Luis Machado via Gdb , Luis Machado via Libc-alpha , Luis Machado , doko@debian.org Subject: Re: GDB shared library tracking with stap probes x _dl_debug_state References: <878s4qb7fj.fsf@oldenburg.str.redhat.com> <07b03137-a083-dada-68da-965779cd41ff@linaro.org> <87bl9mi4xi.fsf@paluero> Date: Sat, 08 May 2021 12:55:56 +0200 In-Reply-To: <87bl9mi4xi.fsf@paluero> (Sergio Durigan Junior's message of "Fri, 07 May 2021 17:56:25 -0400") Message-ID: <87tunda403.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable 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: Sat, 08 May 2021 10:55:42 -0000 * 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. 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. Thanks, Florian