Coming into this really late, and I'm still behind in reading this and
related threads, but I want to throw this idea out, and it's getting
late.
On Mon, 2006-09-18 at 13:28 -0700, Vara Prasad wrote:
Alan Cox wrote:
This still doesn't solve the problem of compiler optimizing such that a
variable i would like to read in my probe not being available at the
probe point.
Then what we really need by the sound of it is enough gcc smarts to do
something of the form
.section "debugbits"
.asciiz 'hook_sched'
.dword l1 # Address to probe
.word 1 # Argument count
.dword gcc_magic_whatregister("next"); [ reg num or memory ]
.dword gcc_magic_whataddress("next"); [ address if exists]
Can gcc do any of that for us today ?
No, gcc doesn't do that today.
---- cut here ----
#include <stdio.h>
#define MARK(label, var) \
asm ("debug_" #label ":\n" \
".section .data\n" \
#label "_" #var ": xor %0,%0\n" \
".previous" : : "r"(var))