Debugging Multiflow
To debug Multiflow on a particular file (e.g., test.c):
- Preprocess the source file you will be using as input to
Multiflow. For example:
scc -v <mydir> -I/projects/trace1/mflow/usr/vssad/release/osf/usr/usr_include_alpha <flags> -E test.c > test.i
- Generate the full list of arguments to ccom. For
example:
scc -v <mydir> <flags> -c test.c -dbx
This creates the ccomargs.in and dbx.in files.
- Grab the latest gdb macros by performing cvs update
bin/gdb-macros in your DyC directory.
- Edit ccomargs.in so that the first argument is your
preprocessed C file (e.g., test.i)
- Move dbx.in to the directory containing your
ccom executable, and edit it so that the file name
ccomargs.in is preceded by its full path name. I also
include commands to read in the macros, set the source path, change
the default directory to the one containing my test program, and set
breakpoints in the error routines:
source /afs/cs/project/dyncomp/<mydir>/DyC/bin/gdb-macros
dir /afs/cs/project/dyncomp/<mydir>/DyC/mflow/
cd /afs/cs/project/dyncomp/<mydir>/Test/
b ERR_AssertFailed
b ERR_Error
b DYC_assert
run -mmain_arg_file=/afs/cs/project/dyncomp/<mydir>/Test/ccomargs.in
- Run gdb (preferably in emacs using M-x gdb) on
your ccom executable. For example:
gdb /afs/cs/project/dyncomp/<mydir>/DyC/mflow/ccom/ccom
- Set any other breakpoints you would like to set.
If you find that gdb is not stopping at your breakpoints set
to stop at the beginning of functions, try to use the TAB key to
expand function names to their full names. For example:
b LUR_Get_Unroll_Amounts__FP12QLOOP_NODE_SiiiiiiiiiiiPiN312_
If that doesn't work, you can try is to set the breakpoint at a particular
line number in the function:
b p2lur/analyze.C:195
In some files, gdb has line-number information that is out of
sync with the original source file. This is due to Multiflow's huge
macros being expanded into multiple lines and the loop-processing
program removing the line-number directives that are supposed to reset
to the correct line number. We have a hack to solve this problem.
Where you want the line numbers to be correct, you may insert
DYC_LND; on a line by itself, and the line numbers will be
resynchronized at that point.
- Run the program by typing source dbx.in.
Initial tips came from Jack. Thanks, Jack!