External ELF Debugging and Virtual Memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

External ELF Debugging and Virtual Memory

764 Views
GianlucaM
Contributor I

Hello everybody,

my name is Gianluca Magnani and this is my first post in the forum.

 

I would like to ask your help in order to solve a little problem that I've encountered once I started to debug external ELF files: I have developed a simple application that read and launches threads starting from ELF files. The application works with MMU enabled and so each thread has its own Virtual Memory. I found a very useful manual that explains how to debug an external ELF: basically, this is done performing the following steps:

 

1. Load the main application (my application)

2. Drag and drop the external ELF file into the project. This will result in the creation of a new project containing the source of the ELF. I set up the project in order to be suitable for the target.

3. Add the ELF file to "Other executables" list in the project settings.

4. Start a debug session (so, I start to debug my main application)

5. Load the ELF file into the memory (Load/Save Memory)
6. Load Symbolic window (this will show two executables, my application and the external ELF)

7. Start to debug.

 

If I perform these steps with Virtual Memory disabled, there is no problem at all. Once the application starts the external ELF, the debug shows the code and I can perform a normal debug (I also see the variables values and I can change them). If i perform these steps with Virtual Memory enabled, I succeed (sometimes) in entering into the external ELF code once the control passed to it, but I'm not able to:

1. see variables values
2. change them (if I try to change a value of a variable, an entire portion of memory is changed!! It is really weird)

 

I cannot figure how I can debug my external ELF file with Virtual Memory enabled. I even tried to use a Memory Configuration file, but It seems not to work: the External ELF file has its entry point at 0x10000094, and starts at 0x10000000; I observed that the first physical address for the mapping that my MMU gives to the application is 0x00119000, so I set the memory configuration file as following:

 

translate 0x10000000 0x001190000 0x1000000

 

But it seems that nothing changed.

Someone have experience in external ELF debugging and Virtual Memory? Maybe I missed something in the set up phase?

 

Thank you for your help.

Gianluca

Labels (1)
0 Kudos
3 Replies

470 Views
J2MEJediMaster
Specialist I

Target processor? (Sounds like Power Architecture or StarCore.)

Version of CodeWarrior being used? (Sounds like a classic version, but can't be sure.)

 

---Tom

0 Kudos

470 Views
GianlucaM
Contributor I

You are right, the platform is the mpc8315e and the Codewarrior version is 8.8 for Power Architecture.

 

Thank you for your reply.

Gianluca

0 Kudos

470 Views
J2MEJediMaster
Specialist I

Sorry, I cannot help you out on a virtual memory problem. I suggest that you file an on-line service request for this problem. Click here to go to the on-line service request page. Be sure to provide them with the CodeWarrior version and target processor, and be prepared to provide some sample code.

 

---Tom

 

0 Kudos