Post on 19-Mar-2016
description
Building and debugging Electric
1
Building and debugging Building and debugging GNU Electric version 8.08GNU Electric version 8.08
by Java SDK & Eclipse by Java SDK & Eclipse (Ganymede)(Ganymede)
by Kazzz (a Japanese engineer) May 11th, 2009 (created the original) May 30th, 2009 (modified for posting to ) June 2nd, 2009 (added information on Java 3D environment)
Building and debugging Electric
2
Objectives① To build GNU Electric 8.08 from its source code by using
Java SDK and Eclipse 3.4.2 (Ganymede)
② To use the source code debugger to survey different causes of exceptions thrown by Electric while processing a user-defined Technology File
Building and debugging Electric
3
Some icons used throughout this document
Micro-steps to be followed sequentially
# 02 Set the default workspace
# 03 Uncheck “Build Automatically” flag
Options/points to be carefully checked
Building and debugging Electric
4
References
You should refer to :
[1]
[2] http://java.com/en/ for Java
[3] http://www.eclipse.org/ for Eclipse
[4] http://www.staticfreesoft.com/productsFree.html for GNU Electric
✔
Not available yet!
Building and debugging Electric
5
IndexIndex
Part-IPart-I Setting up Software Development EnvironmentSetting up Software Development Environment
Part-IIPart-II Creating a New ProjectCreating a New Project
Part-IIIPart-III Building the New ProjectBuilding the New Project
Part-IVPart-IV Debugging GNU ElectricDebugging GNU Electric
Building and debugging Electric
6
Building and debugging Electric
7
01. Java Runtime and SDK The tools listed below are assumed as Java development environment
Tool Version Install location
OSWindows XP SP3
JapaneseC:\Windows this may look like
Java RuntimeJava 6
Update 13C:\Program Files\Java\jre6\
Java 3D 1.5.2 C:\Program Files\Java\Java3D\1.5.2\
Java SDKJava SED Kit 6
Update 13C:\Program Files\Java\jdk1.6.0_13\
The images were captured on Japanese Windows throughout this document. Therefore, wherever you see a Yen mark in a file path, please understand that it corresponds to a “back slash” character in the non-Japanese world.
Building and debugging Electric
8
Customization of Java environment made for my convenience
Manually copied --- for some reasons; cannot remember ;-(
The modified “build.xml” file embedded in slide #26 reflects this organization as shown below.
Building and debugging Electric
9
02. Eclipse The tools checked below are assumed as Eclipse environment
✔
✔
Visit http://www.eclipse.org/downloads/
✔
Building and debugging Electric
10
Author’s Eclipse environment used in this document
※ C/C++ and Qt tools are not required for building/debugging GNU Electric.
Building and debugging Electric
11
Author’s batch file used to start Eclipse
rem ----- Batch file for invoking Eclipse with Qt plug-in -----
rem ----- Qt-related environment variablesset QTDIR=D:\Qt\2009.01\qt\set QMAKESPEC=win32-g++set MINGWDIR=D:\Qt\2009.01\mingw\
rem ----- Java SDK-related environment variableset JDKDIR=c:\Program Files\Java\jdk1.6.0_13\
rem ----- Set path to all the toolsset Path=%JDKDIR%\bin;%MINGWDIR%\bin;%QTDIR%\bin;%Path%
rem ----- Invoke Eclipsecall eclipse.exe
exit
This shortcut calls the batch file.
Building and debugging Electric
12
03. Default workspace for Eclipse
# 01 Invoke Eclipse
# 02 Set the default workspace
Building and debugging Electric
13
# 03 Uncheck “Build Automatically” flag
This option is useful for incremental building.As I’m going to build everything from scratch, let’s suppress this feature for the time being. Otherwise, compilation will automatically start while importing a Jar file to a new Java project.
Building and debugging Electric
14
Building and debugging Electric
15
01. Create a new project for GNU Electric
# 01
Create a new Java project
Building and debugging Electric
16
# 02 Import the JAR file of GNU Electric 8.08
Building and debugging Electric
17
# 03 Select the JAR file of GNU Electric 8.08
Not “electricBinary-8.08.jar”
Building and debugging Electric
18
# 04 Configure Build Path
Building and debugging Electric
19
# 05 Check the build path (1)
Building and debugging Electric
20
# 06 Check the build path (2)
Building and debugging Electric
21
# 07 Check the build path (3)
Building and debugging Electric
22
# 08 Check the build path (4), then press [OK]
Building and debugging Electric
23
# 09 Confirm that these packages have been created
Building and debugging Electric
24
# 01
Go through “README.txt” file
02. Information on how-to-build
# 02
Read “Building from Sources” section carefully
Building and debugging Electric
25
03. Edit “build.xml” file for Ant tool
# 01
Copy then paste “build.xml” to backup the original one
Building and debugging Electric
26
# 02
Edit “build.xml” according to the information described in “README.txt” file. For example, Macintosh-related descriptions are to be removed.
Original Modified
::
::
Unpack and compare these two
files for detailsCopy of
build.xml.zipbuild.xml.zip
The above tool isSlide #8
Building and debugging Electric
27
# 03
Delete “MacOSXInterface.java” file, which is not necessary for Windows
Building and debugging Electric
28
# 04
Optionally edit a file to modify the splash image
OriginalModified
Building and debugging Electric
29
Building and debugging Electric
30
01. Build by Ant tool
# 01
To clean, follow clean Run As Ant Build
Building and debugging Electric
31
# 02
To build, follow compile Run As Ant Build
Successfully built with 91 warnings
Building and debugging Electric
32
# 03
To run, follow runMain Run As Ant Build
Building and debugging Electric
33
# 04
Check that the tool has started successfully; watch the console
“Added Technologies” is being loaded…
Building and debugging Electric
34
02. Quickly check that the tool works
# 01
Load a library and open a layout cell
Looks OK!
Building and debugging Electric
35
# 02
Run NCC
Looks OK!
Building and debugging Electric
36
# 03
Run DRC
Exception has been caught!
Building and debugging Electric
37
# 04
Check the console of Eclipse workbench
The same exception has also been caught by Eclipse
# 05
Click a hyperlink and confirm that the source code can be loaded to the editor view
Building and debugging Electric
38
# 06
The location has been correctly identified in the editor view
Building and debugging Electric
39
Building and debugging Electric
40
01. Configuring the debug setup
# 01
Start Debug Configurations …
Building and debugging Electric
41
# 02
Setup configuration
Building and debugging Electric
42
# 03
Set break point(s) as needed
Building and debugging Electric
43
# 01
Change the perspective to Debug and start the debugger02. Start the debugger
Building and debugging Electric
44
# 02
Confirm that GNU Electric has started in a debug mode
Building and debugging Electric
45
# 03
Load the same library and open the same layout cell as before
Looks OK!
Building and debugging Electric
46
# 04
Run NCC
Looks OK!
Building and debugging Electric
47
# 05
Run DRC
Exception has been caught
and the program has
stopped at the break point.
Building and debugging Electric
48
# 06
Inspect variable(s)
This is what the author wanted to do!
Building and debugging Electric
49
# 07
Resume the execution
Exception has been caught!
Building and debugging Electric
50
The same exception has also been caught by Eclipse
# 08
Check the console of Eclipse debug perspective
Building and debugging Electric
51
Summary① GNU Electric version 8.08 was built from its source code
by using Java SDK and Eclipse 3.4.2 (Ganymede).
② The newly built GNU Electric was source-code-debugged on the Eclipse workbench.
③ Such capability of debugging will help us debug a user-defined Technology File.
[The End of File]