Hey,
I have been having a strange problem for the last couple of days. I create code with a native code compiler (the code should be valid checked it a couple of times) and then I want to execute that Code. I am using a PowerPC microcontroller with some kind of linux OS. So I am running a C program where I have a Byte array containing the native Code. Then I do the usual trick where I create a function pointer to that array and call that function. When I debug/start this program I have the following behaviour:
1. Debug with Breakpoint at native code call and single stepping:
I start at the function call and step through my native Code operatior for operation. My crated native code is executed perfectly everything is fine.
2. Debug without Breakpoint
Program halts at the first instruction (depending on native code, sometimes a later instructions but always another instruction i.e. not alway LD or ST or whatever) with the error SIGILL (Illegal Instruction)
3. Executing of binary file
Program terminates with SIGILL
I am using GDBServer for remote debugging. Additionally at the second case, I checked the instruction I checked the registers and I checked the memory everything seems to be ok. I can not figure out why my program works with single stepping but not when I execute it normally...
Help would be very much appreciated =D
I have been having a strange problem for the last couple of days. I create code with a native code compiler (the code should be valid checked it a couple of times) and then I want to execute that Code. I am using a PowerPC microcontroller with some kind of linux OS. So I am running a C program where I have a Byte array containing the native Code. Then I do the usual trick where I create a function pointer to that array and call that function. When I debug/start this program I have the following behaviour:
1. Debug with Breakpoint at native code call and single stepping:
I start at the function call and step through my native Code operatior for operation. My crated native code is executed perfectly everything is fine.
2. Debug without Breakpoint
Program halts at the first instruction (depending on native code, sometimes a later instructions but always another instruction i.e. not alway LD or ST or whatever) with the error SIGILL (Illegal Instruction)
3. Executing of binary file
Program terminates with SIGILL
I am using GDBServer for remote debugging. Additionally at the second case, I checked the instruction I checked the registers and I checked the memory everything seems to be ok. I can not figure out why my program works with single stepping but not when I execute it normally...
Help would be very much appreciated =D