This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC]: MD_FALLBACK_FRAME_STATE_FOR macro for darwin PPC



On 20/01/2004, at 2:21 PM, Andreas Tobler wrote:


Geoffrey Keating wrote:

On 20/01/2004, at 12:37 PM, Andreas Tobler wrote:
So, the question is, how do I check inside darwin.h which OS version I have?
You check with code like this:
+    if (*(unsigned int *) (pc_ + 0) != 0x2e1e0032)            \
+      break;                                \
+    if (*(unsigned int *) (pc_ + 4) == 0x40be0050            \
+    || *(unsigned int *) (pc_ + 4) == 0x41920010)            \
You should make enough tests to make sure that you don't falsely identify any darwin version (past or future), by checking every instruction that would have been executed on a return from a signal handler.

Hm!


future?

Well, I have limited resources here, one powerbook, which is three years old and is also my production machine.

I see what I can do. It will certainly take a longer time.

Also I have first to find out about all different versions and how to get them. ( I hope I understood you right)

You don't actually need every version (I do not know how you would try to acquire every future version of darwin, it seems like you'd need a time machine). You just have to check the entire instruction sequence.


Andreas*

*wondering why this macro has not already been implemented before..... seems so easy.

I haven't done it because it's a lot of work.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]