Skip to main content

Is it possible to debug phoneME using microsoft Visual C++ (dsw, dsp) ?

10 replies [Last post]
psharma_123
Offline
Joined: 2007-10-22
Points: 0

Hi,

Is it possible to debug phoneME C,C++ code using visual studio IDE ? I suppose we will have to create dsw, dsp files for that.
did any one try debugging using visual studio?

Regards,

psharma

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
javamobi
Offline
Joined: 2007-09-25
Points: 0

Hi Danila,

For CLDC, I think It does, but we can not create a dsw/dsp for whole phoneME JTWI.
By the way, CLDC will generate several projects, likes loopgen, romgen, etc,.
In fact, for debugging purpose, we only need project for CLDC VM.
Does phoneMe have any plan to do this? I mean a JTWI dsw.

Best Regards,
javamobi

danila
Offline
Joined: 2006-09-25
Points: 0

Hi javamobi,

no, this is not in the near plans.
Sometimes loopgen and romgen need to be debugged, that's why these projects are generated.

Danila

psharma_123
Offline
Joined: 2007-10-22
Points: 0

Hi Lada & Terrence,

Thanks for your help.I was able to debug PhoneME using Visual C++ 2005 Express edition.

Regards,

psharma

terrencebarr
Offline
Joined: 2004-03-04
Points: 0

I've used debug builds of phoneME Feature (USE_DEBUG=true, etc.) and debugged parts of the phoneME VM and MIDP implementation code with Visual C++ Express. It basically just worked. I didn't try anything fancy and I noticed that stack traces often produced unreliable results but single stepping, breakpoints and local and global variables were available.

-- Terrence

lada
Offline
Joined: 2007-10-31
Points: 0

Hi psharma,

I am not familiar with phoneME, but I am debugging my native projects in VS 2005 without dsw or dsp files. VS debugger needs just pdb files in build directories (you should build with debug info). Then you can connect to your device, attach Debugger to native process, load source files and set breakpoints (or use OutputDebugString for tracing)

Good luck
Lada

psharma_123
Offline
Joined: 2007-10-22
Points: 0

Hi Lada,

I have Visual C++ 6.0. I am not sure if I can make it work with it. I build phoneME in debug mode(USE_DEBUG=true). It creates run_Midlet_g.exe. I was able to attach VC debugger using Build->Start debug ->Attach to process.
Some pdb file which were created are runMidlet_g.pdb,cldc_vm_g.pdb,cldc_vm_r.pdb,vc60.pdb.
I couldn't understand how can I open these pdb files and source code.

Regards,

psharma

lada
Offline
Joined: 2007-10-31
Points: 0

I have VS 2005 Standard Edition and I debug on my PDA (WM 5.0 / ARM). Here are my steps:

Tools -> Attach to Process
Transport: Smart Device
Qualifier -> Browse -> select your target environment (e.g. Windows Mobile 5.0 Pocket PC Device) and click Connect
After connection you should see your native process between Available Processes - double click it
Check Modules and Output windows (verify Symbol Status...)
Use File -> Open -> File for loading sources and set breakpoints anywhere you like
Or add OutputDebugString calls to your code and watch the traces in the Output window of Visual Studio

It is also possible to debug on emulator.
Stepping through Arm assembler doesn't work, this is a known issue.

hope it helps,
Lada

javamobi
Offline
Joined: 2007-09-25
Points: 0

Hello psharma,

I think the answer is YES, but phoneME does not have any tools to create a whole dsw/dsp for you.
First, you need to collect all files you need from phoneME codebase. You can observe makefiles what they did.
Second, you try to make natvieFunctionTable.cpp, RomImage.cpp by yourself if you have to modify the java source code. (of course, you can get them from the build of phoneME).
Final, You should generate the right assembly file, like Interpreter_i386.asm

Best Regards,

danila
Offline
Joined: 2006-09-25
Points: 0

Hello psharma, javamobi,

> I think the answer is YES, but phoneME does not have any tools to create a whole dsw/dsp for you.

in fact it does. Check build/win32_i386_ide config.
Let me know if it works for you.

psharma_123
Offline
Joined: 2007-10-22
Points: 0

Hello danila,

Yes it works ! Thanks !
I suppose we can debug VM using this workspace. (cldc_vm.exe).
Is it possible to create dsw where we can debug running midlet? I mean dsp which runs PhoneME emulator.

Regards,