====== Logging and Error Reporting ====== ===== Logging ===== The class //StdStreams// in the package //org.deepjava.host// defines three output streams. * log: is used for normal logging (e.g. successful compilation) * vrb: for debugging purposes * err: for errors ==== Assertions ==== For development assertions should be extensively used. Make sure that they are enabled in eclipse with //-ea// as argument for the VM. ==== Debug Output ==== Debug output is very convenient during the development process. For efficiency reasons we use the following scheme: Every class has a constant //debug// of type boolean. If //debug == true// the compiler inserts write statements to //StdStreams.vrb//. To enable debug output you have to edit the source code (switch on debug). In the productive code their is no runtime penalty. ===== Error Reporting ===== The class ''org.deepjava.host.ErrorReporter'' is used for reporting errors. Each error increments //nofErrors//. The launcher checks this variable and stops if necessary. The ''ErrorReporter'' needs the file //ErrorMsg.txt// in the folder //rsc//. This text file contains error numbers, descriptions and possible solution. The methods //error(int errNr)// and //error(int errNr, String additonalInfo)// access //ErrorMsg.txt//. Further, there is a method //error(String errMsg)//. It allows for outputting a message without error number. ==== Stopping after Error ==== The launcher checks if no error occured before starting the next step. However, what happens if there is an error within a step (e.g. while allocating registers) and it's not possible to complete this step? We do not want to check for //nofErrors// within each step. \\ Every method should call the error reporter in case of an error and at the same time it should return a useable value (e.g. register 0 or node 0). If necessary special objects should be created for this purpose. \\ Use assertions whenever possible. They will be switched of in the productive code but can be enabled during the development process. \\ ---- ===== Error Numbers ===== === General: 000 - 099 === ^ErrorNr ^Description ^Solution ^ |10|feature not yet implemented| | |11|file not found| | === Launcher: 100 - 199 === ^ErrorNr ^Description ^Solution ^ |100|no target connection (build project first)| | === Configuration: 200 - 299 === ^ErrorNr ^Description ^Solution ^ |200|wrong number format| | |201|missing right parenthesis| | |202|missing right brace| | |203|missing right bracket| | |204|missing quotation mark| | |205|IO-Exception| | |206|Unexpected Symbol| | |207|missing left brace| | |208|missing left bracket| | |209|missing semicolon| | |210|missing assignment sign| | |220|no such device| | |221|no devices|create device before adding segments| |222|syntax error| | |223|inconsistent attributes| | |224|invalid type| | |225|invalid parameter| | |226|overwrite protected| | |227|undefined constant| | |228|max number of reached| | |229|missing tag| | |230|no such register| | |231|no default segment defined| | |232|no system table segment defined| | |233|to set an init value is not supported| | |234|fix addresses for methods are only in exception methods supported| | |235|no such segment| | === Class File Reader++: 300 - 399 === ^ErrorNr ^Description ^Solution ^ |300|class file not found| | |301|systemmethod not found| | |302|id for Systemmethod out of range| | |303|changing parent dirs of class files| | |304|illegal parent dir of class files| | === CFG: 400 - 499 === ^ErrorNr ^Description ^Solution ^ |400|cfgNode not found| | === SSA: 500 - 599 === ^ErrorNr ^Description ^Solution ^ |500|generation of the linenumber table failed| | |510|translation of finally block in exceptions failed, use Java6 or later| | === Code Generator: 600 - 699 === ^ErrorNr ^Description ^Solution ^ |600|no code generated| | |601|method has too many parameters| | |602|fixup out of range| | |603|not enough GPR's for locals| | |604|not enough FPR's for locals| | |610|result of SSA instruction has wrong type| | |611|operand of SSA instruction has wrong type| | |612|operand of SSA new instruction has wrong type| | |620|SSA return instruction not implemented| | |621|SSA branch instruction not implemented| | |623|sCcompl or sCcompg is not followed by branch instruction| | |625|SSA instruction not implemented| | |630|initialization failed, unsafe class not found| | |631|initialization failed, method in unsafe class not found| | |632|initialization failed, low level class not found| | |633|initialization failed, method in low level class not found| | |634|class not found| | === Linker: 700 - 799 === ^ErrorNr ^Description ^Solution ^ |701|Class not loaded| | |710|Segment not found| | |711|Segment size error| | |720|Address not set| | |721|Offset not set| | |722|Index not set| | |723|ID not set| | |724|Base address not set| | |790|Runtime System error| | === Downloader/Programmer: 800 - 899 === ^ErrorNr ^Description ^Solution ^ |800|target not found!(USB connection failed)| | |801|a error occurs while downloading!(Try to reopen)| | |802|no target image to load| | |803|connection to target lost| | |804|reopen failed| | |805|starting of Device failed| | |806|bdi is not in Debug mode| | |807|memmory writer is not implemented| | |808|bypass is not unlocked| | |809|programming failed| | |810|programmer not found| | |811|class to connect to programmer not found| | |812|plugin not found| | |813|BDI packet wrong, try to reset BDI| | |814|ready bit not set, try to reset BDI| | === Debugger: 900 - 999 === ^ErrorNr ^Description ^Solution ^ |900|connection lost| |