Building and debugging GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

51
Building and debugging Elect 1 Building and debugging Building and debugging GNU Electric version 8.08 GNU Electric version 8.08 by Java SDK & Eclipse by Java SDK & Eclipse (Ganymede) (Ganymede) by Kazzz (a Japanese engineer) May 11 th , 2009 (created the original) May 30 th , 2009 (modified for posting to ) June 2 nd , 2009 (added information on Java 3D environment)

description

by Kazzz (a Japanese engineer) May 11 th , 2009 (created the original) May 30 th , 2009 (modified for posting to ) June 2 nd , 2009 (added information on Java 3D environment). - PowerPoint PPT Presentation

Transcript of Building and debugging GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Page 1: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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)

Page 2: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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

Page 3: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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

Page 4: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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!

Page 5: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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

Page 6: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

6

Page 7: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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.

Page 8: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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.

Page 9: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

9

02. Eclipse The tools checked below are assumed as Eclipse environment

Visit http://www.eclipse.org/downloads/

Page 10: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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.

Page 11: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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.

Page 12: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

12

03. Default workspace for Eclipse

# 01 Invoke Eclipse

# 02 Set the default workspace

Page 13: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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.

Page 14: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

14

Page 15: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

15

01. Create a new project for GNU Electric

# 01

Create a new Java project

Page 16: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

16

# 02 Import the JAR file of GNU Electric 8.08

Page 17: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

17

# 03 Select the JAR file of GNU Electric 8.08

Not “electricBinary-8.08.jar”

Page 18: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

18

# 04 Configure Build Path

Page 19: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

19

# 05 Check the build path (1)

Page 20: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

20

# 06 Check the build path (2)

Page 21: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

21

# 07 Check the build path (3)

Page 22: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

22

# 08 Check the build path (4), then press [OK]

Page 23: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

23

# 09 Confirm that these packages have been created

Page 24: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

24

# 01

Go through “README.txt” file

02. Information on how-to-build

# 02

Read “Building from Sources” section carefully

Page 25: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

25

03. Edit “build.xml” file for Ant tool

# 01

Copy then paste “build.xml” to backup the original one

Page 26: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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

Page 27: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

27

# 03

Delete “MacOSXInterface.java” file, which is not necessary for Windows

Page 28: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

28

# 04

Optionally edit a file to modify the splash image

OriginalModified

Page 29: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

29

Page 30: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

30

01. Build by Ant tool

# 01

To clean, follow clean Run As Ant Build

Page 31: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

31

# 02

To build, follow compile Run As Ant Build

Successfully built with 91 warnings

Page 32: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

32

# 03

To run, follow runMain Run As Ant Build

Page 33: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

33

# 04

Check that the tool has started successfully; watch the console

“Added Technologies” is being loaded…

Page 34: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

34

02. Quickly check that the tool works

# 01

Load a library and open a layout cell

Looks OK!

Page 35: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

35

# 02

Run NCC

Looks OK!

Page 36: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

36

# 03

Run DRC

Exception has been caught!

Page 37: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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

Page 38: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

38

# 06

The location has been correctly identified in the editor view

Page 39: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

39

Page 40: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

40

01. Configuring the debug setup

# 01

Start Debug Configurations …

Page 41: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

41

# 02

Setup configuration

Page 42: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

42

# 03

Set break point(s) as needed

Page 43: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

43

# 01

Change the perspective to Debug and start the debugger02. Start the debugger

Page 44: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

44

# 02

Confirm that GNU Electric has started in a debug mode

Page 45: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

45

# 03

Load the same library and open the same layout cell as before

Looks OK!

Page 46: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

46

# 04

Run NCC

Looks OK!

Page 47: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

47

# 05

Run DRC

Exception has been caught

and the program has

stopped at the break point.

Page 48: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

48

# 06

Inspect variable(s)

This is what the author wanted to do!

Page 49: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

49

# 07

Resume the execution

Exception has been caught!

Page 50: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

Building and debugging Electric

50

The same exception has also been caught by Eclipse

# 08

Check the console of Eclipse debug perspective

Page 51: Building and debugging  GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede)

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]