public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: GDB shared library tracking with stap probes x _dl_debug_state
       [not found]     ` <87bl9mi4xi.fsf@paluero>
@ 2021-05-08 10:55       ` Florian Weimer
  2021-05-10 14:16         ` Luis Machado
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2021-05-08 10:55 UTC (permalink / raw)
  To: systemtap
  Cc: Sergio Durigan Junior, Luis Machado via Gdb,
	Luis Machado via Libc-alpha, Luis Machado, doko

* 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:

  <https://sourceware.org/pipermail/gdb/2021-May/049421.html>

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDB shared library tracking with stap probes x _dl_debug_state
  2021-05-08 10:55       ` GDB shared library tracking with stap probes x _dl_debug_state Florian Weimer
@ 2021-05-10 14:16         ` Luis Machado
  2021-05-11  8:00           ` Ulrich Weigand
  2021-05-24 14:22           ` Luis Machado
  0 siblings, 2 replies; 4+ messages in thread
From: Luis Machado @ 2021-05-10 14:16 UTC (permalink / raw)
  To: Florian Weimer, systemtap
  Cc: Sergio Durigan Junior, Luis Machado via Gdb,
	Luis Machado via Libc-alpha, doko, Maciej W. Rozycki,
	Ulrich Weigand

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:
> 
>    <https://sourceware.org/pipermail/gdb/2021-May/049421.html>
> 
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDB shared library tracking with stap probes x _dl_debug_state
  2021-05-10 14:16         ` Luis Machado
@ 2021-05-11  8:00           ` Ulrich Weigand
  2021-05-24 14:22           ` Luis Machado
  1 sibling, 0 replies; 4+ messages in thread
From: Ulrich Weigand @ 2021-05-11  8:00 UTC (permalink / raw)
  To: Luis Machado; +Cc: fweimer, systemtap, sergiodj, doko, libc-alpha, macro

On Mon, May 10, 2021 at 11:16:46AM -0300, 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 POWER we use the special symbol marker to identify symbols with
a local entrypoint offset.  This is to make sure, when setting a
breakpoint on the symbol, that we can set it at the local entrypoint
instead of the global entrypoint.

For stap probes, this is irrelevant, since there we are directly
told the address where to set the breakpoint.  So there should
be no problem for this architecture.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDB shared library tracking with stap probes x _dl_debug_state
  2021-05-10 14:16         ` Luis Machado
  2021-05-11  8:00           ` Ulrich Weigand
@ 2021-05-24 14:22           ` Luis Machado
  1 sibling, 0 replies; 4+ messages in thread
From: Luis Machado @ 2021-05-24 14:22 UTC (permalink / raw)
  To: Florian Weimer, systemtap
  Cc: Sergio Durigan Junior, Luis Machado via Gdb,
	Luis Machado via Libc-alpha, doko, Maciej W. Rozycki,
	Ulrich Weigand

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:
>>
>>    <https://sourceware.org/pipermail/gdb/2021-May/049421.html>
>>
>> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-24 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <b0b35028-2463-dd00-14af-22be2e7b6ff6@linaro.org>
     [not found] ` <878s4qb7fj.fsf@oldenburg.str.redhat.com>
     [not found]   ` <07b03137-a083-dada-68da-965779cd41ff@linaro.org>
     [not found]     ` <87bl9mi4xi.fsf@paluero>
2021-05-08 10:55       ` GDB shared library tracking with stap probes x _dl_debug_state Florian Weimer
2021-05-10 14:16         ` Luis Machado
2021-05-11  8:00           ` Ulrich Weigand
2021-05-24 14:22           ` Luis Machado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).