Wednesday, January 03, 2007

 
Using InnerLoop as the editor in Specview

There are many places in specview that allow uses to edit the e source files that are loaded into specman. The modules window and the sys browser are just 2 examples. I often use the modules window to look at the loaded code and set initial breakpoints before I start running.

Today, during some routine debugging I was looking at some code and was confused because I saw some stuff I thought I had deleted. Unfortunately, after the long Christmas holiday last year seemed like a long time ago and I couldn't remember much. I was frustrated with the black-and-white file viewer that is part of specview so I thought if I did "Edit File" at least vim would come up and I could get some color coding. When I tried to edit the file I just got an xterm with an error message about couldn't exec something, who knows. Then I decided what I really needed was InnerLoop, even thought when I started out I figured this session was so easy I shouldn't really even need InnerLoop.

Looking into the Specman docs I found I could control the editor that is opened by specview using the environment variables SPECMAN_EDITOR or even just EDITOR. I also saw the default was to open /usr/ucb/vi which doesn't even exist on Linux (probably the cause of the error).

After some trial and error I figured out how to get il to open as the editor and load the file and put the cursor on the correct line number as specified by specman. Now I can get a real editor that is built for e instead of a black-and-white file viewer or an error in an xterm.

Here is the setting I used to set SPECMAN_EDITOR

setenv SPECMAN_EDITOR 'il +new $f -#"goto-line $l"'

I like to have a new instance of il so I don't disturb the others I have running. The $f is the filename set by specman and the $l is the line number set by specman.

After this I realized the strange code was actually commented out using code markers (<' and '>).

Give it a try and start using il as the editor with specview.

My next trick is going to be to extract all the e files that are loaded and automatically create an InnerLoop project with these files and load them into InnerLoop directly from specview. For various reasons this is easier than creating the project in other ways to make sure all the correct files are being used.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?