FAQs about Software Tools JEMBuilder and Charade

Discussion regarding tools such as JEMBuilder/Charade/JDEBUG etc.

Postby admin » Sun Nov 05, 2006 7:32 am

How do I set a breakpoint on an instance of a class?

instances of objects don't contain code. So you can not set code breakpoints on specific object instances.
However you can set data breakpoints on the object. Charade will then halt the program when the data is fetched.
To do so use the process stack & objectViewer to locate the specific instance of the object you are concerned with. Locate the field of interest in the object viewer. Then use the address of the field in the breakpoint command. For example: "br 0x12345 pc"
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:32 am

Why don't I get text output to the screen in Charade(that is the default, isn't it) ?

By default System.out is directed to the Charade window. However, you need to turn the Charade Text I/O mode on in order to see it. This can be done by selecting Setup | Configuration in the drop down menu at the top of the Charade window and checking the Text I/O enabled box. Click on OK and you are ready to go.
If you do not check the Charade Text I/O box, the program will still run - only you will not see any output generated via System.out.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:32 am

When I try to run a program, it crashes in com/ajile/jem/RTS_Exception.trapExtendHeap(II)V

Your program is running out of heap memory. Try increasing the heap size in JemBuilder and rebuild the application.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:33 am

If I watch the Heap Meter I see my heap size increase to 100% and the CPU goes idle.

You may have turned of garbage collector in the JEMBuilder with the system property gc=off and your program is running out of memory.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:33 am

What would be the reason to turn off garbage collector?

There are embedded applications and many real-time applications that want to manage their own memory usage. Turning off garbage collector also release CPU resource to be use for real-time event handling.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:34 am

When running JemBuilder, I'm getting a number of messages indicating **(W) native method xxx() will halt.

The order in which the runtime libraries are provided in the class path is important.
It is necessary to specify the RuntimePC104 or Runtime_cldc libraries before the jdk1.1.8 and J2ME libraries in the class path.

* 1. If you are specifying the classpath as shown in the user manual, please ensure that the RuntimePC104 or Runtime_cldc library path comes before (to the left) of the jdk1.1.8 or J2ME library path.
* 2. If you are selecting the libraries from the Libraries window of JVM0->ClassPath, please ensure that RuntimePC104 library appears above jdk1.1.8 library.

The "will halt" error messages should no longer appear during the build.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:35 am

Can you explain how to use Assembly window and Breakpoint Control window for debugging?

The simplest way to set breakpoints is a combination of user-inserted software breakpoints in the program, and setting/removing temporary breakpoints during execution.

Here is a quick tutorial on how to do this:

1. To insert a breakpoint in the user code, you can do the following:

(a) Add the line:

import com.ajile.jem.rawJEM;

to the source file in which the software breakpoint will be inserted.

(b) At the point in your code where you wish to insert a breakpoint,
type the statement:

rawJEM.breakPoint(0xabcd);

You may use any hex number in place of "0xabcd". The idea is that this hex number will be on top of the execution stack when you encounter
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:35 am

When I stop the program I am in RTS_Thread.idleMain() what is going on?

All of the threads in your program have blocked. To see the state of the threads use the "Show thread" command in Charade. Having all your threads block is not always an error, most embedded programs will spend at least a portion of their execution in the idle thread. To check your program you can examine the elapsedTime field reported by the "show threads" this is the total amount of time that the thread has been executed. The user threads may have generated errors, if this is the case the "show thread" command will list the error in the status field.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:36 am

I am using the serial port, why am i not getting any data out?

The most common reason is that the serial interrupt is not enabled. To enable the serial interrupt, go to the JemBuilder project|configuration page and assign the Uart driver to your VM. Remember that a hardware resource like the serial port can only be assigned to a single VM.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:36 am

Charade does not come up

* When I run Charade, I get the following message: "Cannot Initialize Drivers: DRV_JTAG_NOT_RESPONDING". The most common reason for this is that the port address specified in the c:\ajile\Charade\charade.cfg file is incorrect. Often if you reinstall a new runtime, the charade directory is replaced. Thus, deleting your existing charade.cfg file.
* When I run Charade I get the following message: "cannot initialize drivers: DRV_JTAG_NO_PWR_DETECTER" What kind of system are you using? This error message is reported when the CharadeDrv driver is not installed correctly on Windows NT or Win2k. On windows NT or Win2K Charade requires a driver to be installed to communicate with the parallel port. The readme.txt file outlines this procedure. The key point being that you have to be logged in as administrator to get the driver installed.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:37 am

Why do I get two "unknown symbol" messages after I run a load.sod file?

The default setup macro invoked by load.sod tries to set two breakpoints. In the exception handling mechanism. If Charade fails to load the symbolic program information. When it tries to set the breakpoints it will report the "Unknown symbol" message.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:37 am

Charade is locked up, how do I get control back with out killing Charade?

If Charade is not responding, it is probably talking to the board in a loop. If you press and hold the reset button on the eval board, Charade will time out and report that it has lost communication with the board. You can then do a "reset" and a "halt" to restore control of Charade.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:38 am

How do I find the absolute address for a method?

You can use the list files to determine the address. However the fastest way is to load the program into Charade and use the "show map" command. Show map with no parameter will list all the fields and methods. Show map class.method will list all classes/methods that partially match the class and method listed
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:38 am

Why can't I scroll to the end of the method in Charade's Byte Code View?

Charade only dis-assembles up to the next 250 lines of a method in the byte code view. When you reach the end of the dis-assembled code Charade will load and parse the next section of code.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

Postby admin » Sun Nov 05, 2006 7:38 am

Charade says I have an object "foo" on the stack but I don't!

The object names Charade provides in the stack window are based in Charade "guessing" if the value is an object ref. The algorthim used is:

* Verify that the value is in the current heap space
* Read the data a the location specified.

The the value read is the address of a csa, Charade assumes the value on the stack is an objRef for that type of class.
admin
Site Admin
 
Posts: 80
Joined: Sat Oct 28, 2006 6:14 am

PreviousNext

Return to Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron