-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resetting the lines option to 0 still outputs #line directives #51
Comments
How does still having the #line directives break the debugging ?
Will investigate. |
All lines below the package require critcl 3.1.12;
::critcl::tcl 8.6;
::critcl::config force 1; # Recompile.
::critcl::config keepsrc 1; # Keep sources.
::critcl::config lines 0; # Lines reference generated source.
::critcl::cproc ::twice {int i} int {
return i * 2;
}
::critcl::load; Has the following /* Generated by critcl on Thu Feb 12 08:07:32 CET 2015
* source: /tmp/critclline.tcl
* binary: /tmp/_cache/v3112_324a96ccbd71d1afcc6a66e991bec9c2_pic.o
*/
#include "tcl.h"
/* ---------------------------------------------------------------------- */
#define ns__twice2 "::twice"
static int c__twice2(int i)
{
return i * 2;
}
static int
tcl__twice2(ClientData cd, Tcl_Interp *interp, int oc, Tcl_Obj *CONST ov[])
{
int _i;
int rv;
if (oc != 2) {
Tcl_WrongNumArgs(interp, 1, ov, "i");
return TCL_ERROR;
}
/* (int i) - - -- --- ----- -------- */
{
#line 4700 "critcl.tcl"
if (Tcl_GetIntFromObj(interp, ov[1], &_i) != TCL_OK) return TCL_ERROR; }
/* Call - - -- --- ----- -------- */
rv = c__twice2(_i);
#line 4794 "critcl.tcl"
Tcl_SetObjResult(interp, Tcl_NewIntObj(rv));
return TCL_OK;
}
/* ---------------------------------------------------------------------- */
# line 1 "MyInitTclStubs"
#if USE_TCL_STUBS
const TclStubs *tclStubsPtr;
const TclPlatStubs *tclPlatStubsPtr;
const struct TclIntStubs *tclIntStubsPtr;
const struct TclIntPlatStubs *tclIntPlatStubsPtr;
static int
MyInitTclStubs (Tcl_Interp *ip)
{
typedef struct {
char *result;
Tcl_FreeProc *freeProc;
int errorLine;
TclStubs *stubTable;
} HeadOfInterp;
HeadOfInterp *hoi = (HeadOfInterp*) ip;
if (hoi->stubTable == NULL || hoi->stubTable->magic != TCL_STUB_MAGIC) {
hoi->result = "This extension requires stubs-support.";
hoi->freeProc = TCL_STATIC;
return 0;
}
tclStubsPtr = hoi->stubTable;
if (Tcl_PkgRequire(ip, "Tcl", "8.6", 0) == NULL) {
tclStubsPtr = NULL;
return 0;
}
if (tclStubsPtr->hooks != NULL) {
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
}
return 1;
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
DLLEXPORT int
Critclline_Init(Tcl_Interp *ip)
{
#if USE_TCL_STUBS
if (!MyInitTclStubs(ip)) return TCL_ERROR;
#endif
Tcl_CreateObjCommand(ip, ns__twice2, tcl__twice2, NULL, 0);
return TCL_OK;
}
#ifdef __cplusplus
}
#endif When debugging it with GDB, no source ever comes up for some parts, as Regarding the Thank you very much for having a look at this. Best regards, |
Wonderful! Thank you very much! |
For debugging, it is helpful turning the off the source line linking (
::critcl::config lines 0
), and instead look at the generated C file. See http://wiki.tcl.tk/13214.When turning this option off,
critcl
still generates some of the#line
pragmas, making the result unusable. The sources of#line
pragmas are at least the following:Templates including the pragmas:
Code generated upon
Initialize
. This procedure is invoked when requiring the package, so the configuration option has not had a chance of been reset before it runs.One option would be guarding the
#line
directives by#if SHOW_LINES
, and defining it to whatever the user has configured when compiling. What do you think?The text was updated successfully, but these errors were encountered: