Building and Debugging GNU Electric by Java SDK & Eclipse

Download Report

Transcript Building and Debugging GNU Electric by Java SDK & Eclipse

Building and debugging Electric
Building and debugging
GNU Electric version 8.08
by Java SDK & Eclipse (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)
)
1
Objectives
Building and debugging Electric
① 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 userdefined Technology File
2
Some icons used throughout this document
Building and debugging Electric
 Set the default workspace
# 02
 Uncheck “Build Automatically” flag
Micro-steps to be followed sequentially
# 03
Options/points to be carefully checked
3
References
Building and debugging Electric
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
✔
4
Building and debugging Electric
Index
Part-I
Setting up Software Development Environment
Part-II
Creating a New Project
Part-III
Building the New Project
Part-IV
Debugging GNU Electric
5
Building and debugging Electric
6
01. Java Runtime and SDK
Building and debugging Electric
 The tools listed below are assumed as Java development environment
Tool
Version
Install location
OS
Windows XP SP3
Japanese
Java Runtime
Java 6
Update 13
Java 3D
1.5.2
C:\Program Files\Java\Java3D\1.5.2\
Java SDK
Java SED Kit 6
Update 13
C:\Program Files\Java\jdk1.6.0_13\
C:\Windows
 this may look like
C:\Program Files\Java\jre6\
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.
7
 Customization of Java environment made for my convenience
Building and debugging Electric
Manually copied
--- for some reasons; cannot remember ;-(
The modified “build.xml” file embedded in slide #26
this organization as shown below.
reflects
8
02. Eclipse
✔
Building and debugging Electric
 The tools checked below are assumed as Eclipse environment
✔
Visit http://www.eclipse.org/downloads/
✔
9
 Author’s Eclipse environment used in this document
Building and debugging Electric
※ C/C++ and Qt tools are not required for building/debugging GNU Electric.
10
 Author’s batch file used to start Eclipse
Building and debugging Electric
rem ----- Batch file for invoking Eclipse with Qt plug-in ----rem ----- Qt-related environment variables
set QTDIR=D:\Qt\2009.01\qt\
set QMAKESPEC=win32-g++
set MINGWDIR=D:\Qt\2009.01\mingw\
This shortcut calls
the batch file.
rem ----- Java SDK-related environment variable
set JDKDIR=c:\Program Files\Java\jdk1.6.0_13\
rem ----- Set path to all the tools
set Path=%JDKDIR%\bin;%MINGWDIR%\bin;%QTDIR%\bin;%Path%
rem ----- Invoke Eclipse
call eclipse.exe
exit
11
03. Default workspace for Eclipse
Building and debugging Electric
 Invoke Eclipse
# 01
 Set the default workspace
# 02
12
Building and debugging Electric
 Uncheck “Build Automatically” flag
# 03
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.
13
Building and debugging Electric
14
01. Create a new project for GNU Electric
Building and debugging Electric
 Create a new Java project
# 01
15
 Import the JAR file of GNU Electric 8.08
Building and debugging Electric
# 02
16
 Select the JAR file of GNU Electric 8.08
Building and debugging Electric
# 03
Not “electricBinary-8.08.jar”
17
 Configure Build Path
Building and debugging Electric
# 04
18
 Check the build path (1)
Building and debugging Electric
# 05
19
 Check the build path (2)
Building and debugging Electric
# 06
20
 Check the build path (3)
Building and debugging Electric
# 07
21
 Check the build path (4), then press [OK]
Building and debugging Electric
# 08
22
 Confirm that these packages have been created
Building and debugging Electric
# 09
23
02. Information on how-to-build
Building and debugging Electric
 Go through “README.txt” file
# 01
 Read “Building from Sources” section carefully
# 02
24
03. Edit “build.xml” file for Ant tool
Building and debugging Electric
 Copy then paste “build.xml” to backup the original one
# 01
25
Building and debugging Electric
 Edit “build.xml” according to the information described in “README.txt” file.
 For example, Macintosh-related descriptions are to be removed.
# 02
Modified
Original
:
:
:
:
Unpack and
compare these two
files for details
Slide #8
The above tool is
26
Building and debugging Electric
 Delete “MacOSXInterface.java” file, which is not necessary for Windows
# 03
27
Building and debugging Electric
 Optionally edit a file to modify the splash image
# 04
Modified
Original
28
Building and debugging Electric
29
01. Build by Ant tool
Building and debugging Electric
 To clean, follow clean  Run As  Ant Build
# 01
30
Building and debugging Electric
 To build, follow compile  Run As  Ant Build
# 02
Successfully built with 91 warnings
31
Building and debugging Electric
 To run, follow runMain  Run As  Ant Build
# 03
32
 Check that the tool has started successfully; watch the console
Building and debugging Electric
# 04
“Added Technologies” is
being loaded…
33
02. Quickly check that the tool works
Building and debugging Electric
 Load a library and open a layout cell
# 01
Looks OK!
34
Building and debugging Electric
 Run NCC
# 02
Looks OK!
35
 Run DRC
Building and debugging Electric
# 03
Exception has
been caught!
36
 Check the console of Eclipse workbench
Building and debugging Electric
# 04
The same exception has also been caught by Eclipse
 Click a hyperlink and confirm that the source code can be loaded to the editor view
# 05
37
 The location has been correctly identified in the editor view
Building and debugging Electric
# 06
38
Building and debugging Electric
39
01. Configuring the debug setup
Building and debugging Electric
 Start Debug Configurations …
# 01
40
Building and debugging Electric
 Setup configuration
# 02
41
Building and debugging Electric
 Set break point(s) as needed
# 03
42
02. Start the debugger
Building and debugging Electric
 Change the perspective to Debug and start the debugger
# 01
43
Building and debugging Electric
 Confirm that GNU Electric has started in a debug mode
# 02
44
Building and debugging Electric
 Load the same library and open the same layout cell as before
# 03
Looks OK!
45
Building and debugging Electric
 Run NCC
# 04
Looks OK!
46
 Run DRC
Building and debugging Electric
# 05
Exception has
been caught
and the
program has
stopped at the
break point.
47
 Inspect variable(s)
Building and debugging Electric
# 06
This is what the author wanted to do!
48
 Resume the execution
Building and debugging Electric
# 07
Exception has
been caught!
49
 Check the console of Eclipse debug perspective
Building and debugging Electric
# 08
The same exception has also been caught by Eclipse
50
 Summary
Building and debugging Electric
① 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 userdefined Technology File.
[The End of File]
51