[M3devel] m3gdb start command and calls on runtime procedures

Rodney M. Bates rodney.bates at wichita.edu
Thu Oct 11 17:41:02 CEST 2007


The revised 'start' command of m3gdb, that I recently checked in,
stops too early, before all the runtime data is initialized, for
CM3-compiled code only.  If, when stopped at this point, you try to
type a call in m3gdb, on anything that allocates heap objects, it
will probably fail with runtime errors such as value range errors.

Instead, put a breakpoint on the first line of the main module body.
At that point, such calls will work.  If instead, you put your breakpoint
on 'Main.1" (the module body of Main), it will stop there twice, and
only after the second stop are things properly initialized.

In PM3, things are already initialized when the 'start' command stops.

Also, in both CM3 and PM3, there are things in libm3core that are always
initialized by the compiler, and some that are only initialized if they
appear in the import closure of the program.  RTutils is an example of
the latter.  If your program doesn't import it and you try to call inside
it from m3gdb, that will fail also.

-- 
-------------------------------------------------------------
Rodney M. Bates, retired assistant professor
Dept. of Computer Science, Wichita State University
Wichita, KS 67260-0083
316-978-3922
rodney.bates at wichita.edu



More information about the M3devel mailing list