RML setting and debugging crashcourse Adrian Pop

advertisement
RML
setting and debugging
crashcourse
Adrian Pop
PELAB/IDA/LiU
adrpo@ida.liu.se
Assumptions
ƒ Things you should already know a bit of
ƒ Unix-like environments
ƒ Makefile writing
ƒ Emacs
2
rml-mode for Emacs
ƒ rml = your rml directory
ƒ rml/elisp/rml-mode.el
ƒ /home/you/.emacs
ƒ add these in .emacs
(setq load-path (cons “rml/elisp/” load-path))
(setq auto-mode-alist
(cons ‘(“\\.rml$” . rml-mode)
auto-mode-alist))
(global-font-lock-mode)
(autoload ‘rml-mode “rml-mode” “RML editing mode.” t)
3
loading rml debugger mode in Emacs
ƒ rml = your rml directory
ƒ rml/elisp/rml-db.el
ƒ /home/you/.emacs
ƒ add this in .emacs
(load-file “rml/elisp/rml-db.el”)
4
building your rml project in debug mode
ƒ use rmlc flags: -g when compiling .rml files
ƒ link with:
ƒ flags –lrml_g instead of –lrml
ƒ you may need also –lfl and -lreadline
ƒ if you use rmlc to compile/link the C files
then you don’t need to bother about linking
because it does it automatically
ƒ the program you build in debug mode has
the debugger included in it.
5
using Emacs to debug your program
ƒ write a small wrapper for your program and
name it run-program.sh
#!/bin/sh
./your_program its_parameters
#-- end here
ƒ don’t forget to make it executable:
chmod +x run-program.sh
ƒ then run emacs in that directory:
ƒ emacs ./your_rml_file.rml
ƒ in Emacs: M=ALT or M=Esc then x
ƒ M-x rmldb <ENTER>
6
using RMLDataTree browser
ƒ the browser resides in rml/RMLDataTree
ƒ run it with:
java –cp . RMLDataTree path_to_rml_files
7
Information
ƒ Short documentation rml/doc/DEBUG.txt
ƒ Small Website with RML info:
ƒ http://www.ida.liu.se/~adrpo/teaching/sstpl/
ƒ you can find also this presentation there
ƒ Contact, if you get stuck:
ƒ Adrian Pop, adrpo@ida.liu.se
8
Download