C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Interceptor Function (preserve stack and all registers)

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Mon, 29 Jul 2024 19:17:02 +0200
I think Thiago was referring to storing thread-local variables for reentrant intercepted function calls.   -----Ursprüngliche Nachricht----- Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Mo 29.07.2024 18:18 Betreff:Re: [std-proposals] Interceptor Function (preserve stack and all registers) An:std-proposals_at_[hidden]; CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>; On Monday, July 29, 2024, Thiago Macieira wrote: I was hasty in my reply, because you need to store at least one thing to make it work: the return address you replaced with yours. You can't keep it r10 because it's a volatile register. You can't use the stack because you have none available. You have to use a thread-local variable and to make that reentrant, you'd need to have a linked list of return addresses allocated using the heap. So it's possible... just terribly cumbersome.    I don't know where you're going with your linked list. If you look at the GodBolt I gave you, you'll see I have it working on x86_32 with one simple thread-local variable.  Ain't no linked lists round these parts.

Received on 2024-07-29 17:17:04