Hi,
I dumped the whirl tree of the instrumented program. I got
confused on the number of the parameters of __profile_call_entry
and __profile_call_exit.
The prototype of __profile_call_exit is
void __profile_call_entry(void *pu_handle, int call_id);
but in the dumped whirl tree, it seems to me that it get three parameters:
BLOCK
U8U8LDID 264 <1,5,.preg_U8> T<9,.predef_U8,8> # pu_instrument_handle
U8PARM 2 T<9,.predef_U8,8> # by_value
I4INTCONST 0 (0x0)
I4PARM 2 T<4,.predef_I4,4> # by_value
U8LDA 0 <1,26,(7_bytes)_"printf\000"> T<34,anon_ptr.,8>
U8PARM 2 T<9,.predef_U8,8> # by_value
VCALL 126 <1,27,__profile_call_entry> # flags 0x7e
LOC 1 10 {
LOC 1 11 printf("hi, i > 100\n");
U8LDA 0 <1,22,(13_bytes)_"hi,_i_>_100\n\000"> T<32,anon_ptr.,8>
U8PARM 2 T<28,anon_ptr.,8> # by_value
VCALL 126 <1,21,printf> # flags 0x7e
U8U8LDID 264 <1,5,.preg_U8> T<9,.predef_U8,8> # pu_instrument_handle
U8PARM 2 T<9,.predef_U8,8> # by_value
I4INTCONST 0 (0x0)
I4PARM 2 T<4,.predef_I4,4> # by_value
U8LDA 0 <1,26,(7_bytes)_"printf\000"> T<34,anon_ptr.,8>
U8PARM 2 T<9,.predef_U8,8> # by_value
VCALL 126 <1,28,__profile_call_exit> # flags 0x7e
END_BLOCK
What happens? It seems to me that Instrument_Call calls the wrong
Gen_Call (or Gen_Call_Shell).
The source program is very simple and enclosed.
Thanks for your help.
Peng
test.c
Description: Text document
|