using the humec tools 20 th march 2006 robert pointon

6
Using the humec Tools 20 th March 2006 Robert Pointon

Upload: erica-williams

Post on 18-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using the humec Tools 20 th March 2006 Robert Pointon

Using the humec Tools

20th March 2006

Robert Pointon

Page 2: Using the humec Tools 20 th March 2006 Robert Pointon

Directory Structure

/hume/humec/- ‘humec’ driver program. <-- use this!

/ham2c/- macro expansion of ham to c.- ‘ham2c’ program.

/rts/- minimal runtime system.- ‘rts.ar’ library.

/dbham/- debugging.- ‘hamdb.Main’ java program <-- use this!- ‘dbham’ program (‘DBham’ java equivalent)

Page 3: Using the humec Tools 20 th March 2006 Robert Pointon

Compiling to C

Humec pump (Also: humec pump.hume, pump.ham, pump.c …)

- produces a ‘pump’ executable.

- Other options:- ‘-lotsapace’ - overides space/heap comping from

phamc.- ‘-g’ - enable debug support in executable.- ‘-dbham’ - dumps the intermediate shuffled ham

code.

Page 4: Using the humec Tools 20 th March 2006 Robert Pointon

Problems

• Heap/StackOverflow Exception– Recompile with ‘-lotsaspace’– Fix ham file– Edit C file (#define STACK/HEAP SIZE)

• WireOverflow Exception– Fix ham file.

• InternalError Exception– Fix your Hume!– Email Robert…

Page 5: Using the humec Tools 20 th March 2006 Robert Pointon

Problems

• “<partial write>”/“<data show overflow>”– Edit C file

char buff[51];int len = textValue(buff, 50, ptr);

– Increase the ‘51’ and ‘50’…

• Soft Stack/Heap Overflow– Just a warning the program will run ok:

phamc got the bounds wrong... Can fix ham file if you wish.

Page 6: Using the humec Tools 20 th March 2006 Robert Pointon

Debugging

• Start the debugger:java hamdb.Main 5406

– Only need to do this once, the debugger can debug multiple programs.

• Compile:humec -g pump

• Start your program:pump -g5406

– The debugger will display a window.