GDB shared library tracking with stap probes x _dl_debug_state

Florian Weimer
Sat May 8 10:55:56 GMT 2021

* 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


More information about the Gdb mailing list