SMOK
and Cebollita
. (See the Files section of
the main assignment page.)
$ cebsim --version UI version: 2.5 (Build 49)
Warning: You actually need V7.2.2 of SMOK.
hw5.tar.gz
.
OSComponents.sln
. Visual Studio
starts. Select the Build menu, then Build Solution. Stuff happens.
When it's over you should see (in a pane near the bottom, with high likelihood):
---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped
You've just compiled and linked the code for a degenerate version of an
exception detecting component.
You should find file ExceptionComponent.smokdll
.
That's the executable version of your code.
(It cannot be run on its own, however, only from SMOK
.)
SMOK
. Select the Edit menu, then Edit Smok Env Vars.
The directory of the .smokdll
file must be in one of the entries.
Instructions for how to do this depend on details of your setup, of which
there are too many for me to try to guess. But, in general, I think having
'.' (a single period) in your path should be enough. If not, try inserting
the full path to the folder.
Use a
semi-colon to separate this new path element from what was there already.
Here's a picture that shows you the general ideas. The names you use will
be different, of course.
This setting will be remembered, so you won't have to do it again for a particular kind of machine (i.e., lab or home).
SMOK
and restart it. Select the View menu, then
Package Information, then ExceptionComponent. (The image here is representative
only.)
Shut down
SMOK
.
Note: If you attempt to build your code while running
a SMOK
process, you will get an error like this:
Linking...
LINK : fatal error LNK1168: cannot open Executables/ExceptionComponent.smokdll for writing
Build log was saved at "file://c:\cse378\hw5\Debug\BuildLog.htm"
OSComponents - 1 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
This is because Visual Studio is unable to overwrite the output executable
file while it is in use.
Don't shut down Visual Studio yet.
SMOK
(again, this image is
only representative):
A (purple) component is created.
SMOK
by selecting the Debug menu, then Processes... Find the SMOK
process in the list and hit Attach. Make sure Native is selected, then
hit OK, then Close.
SMOK
and type ctrl-f (step).
Visual Studio asserts itself. The yellow arrow shows you that you've
reached a breakpoint. The bottom left pane shows the values of variables
used in that statement; the bottom right the call stack.
I've annotated some of the toolbar buttons near the upper right in red.
We reached this breakpoint because the
ComputeOutput
method
is called at each clock up.