Re: DEFAULT_CALLER_SAVES doesn't work on the mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I see, so even writing a plugin to alter the instruction stream wouldn't help? is it possible to have a flag for gcc to store registers around mcount calls - through a patch or something, right now apple implementation for mcount doesn't store registers - except for ebx, esi , and edi, which technically render the -pg switch broken when profiling fast call functions, where arguments are passed in ecx and edx
any help regarding this issue is REALLY appreciated.
Thanks


--------------------------------------------------
From: "Ian Lance Taylor" <iant@xxxxxxxxxx>
Sent: Tuesday, December 22, 2009 1:46 PM
To: "Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx>
Cc: <gcc-help@xxxxxxxxxxx>
Subject: Re: DEFAULT_CALLER_SAVES doesn't work on the mac

"Muhammed Fawzy" <mfawzymkh@xxxxxxxxxxx> writes:

However, I think I wasn't clear in my question, please let me try to
explain.
the problem I am trying to solve  is that I want to save  ecx, edx
registers around a specific function call, In my case I want to save
them around mcount call ( when you compile with -pg switch, mcount is
inserted after the prolog of each function ).

the problem is that mcount and moncount implementation on the MAC
trashes the value of ecx register, and gcc doesn't emit code to save
registers around mcount calls..  I was hoping to find a gcc code gen
option to force gcc to save and restore register values around mcount
call.

I see.  The mcount function is a special part of the function prologue
and is not handled as a regular function call.  I don't think there is
any way to do this without modifying gcc itself.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux