Comments (4)
How does still having the #line directives break the debugging ?
- For the templates in helper packages (like "class" and iassoc") it should be trivial to have them drop the directive from the output based on the state of 'config lines' (Have to check if this config can be queried outside of the critcl core).
- You are correct that generated before setting the config will not capture the proper setting, like in
Initialize
(Have to check what that code is). It might be possible to remove the directives after the fact, just before compilation. - Not sure about the SHOW_LINES ... Have to check if that actually works, and also if using this would require changing the line numbers.
Will investigate.
from critcl.
All lines below the #line
get mapped to the file indicated in the directive. For example, the following program:
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 #line
directives:
/* 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 "critcl.tcl"
is not found. By the way: it would be best to have critcl
output the full path to the file in the #line
directive, both for critcl.tcl
and for the tcl files, so that one does not need to configure the source path on the debugger.
Regarding the SHOW_LINES
you can ignore it, it was intended as a simplest-thing-that-could-work suggestion.
Thank you very much for having a look at this.
Best regards,
Adrián Medraño Calvo.
from critcl.
Fixed with four commits. Unfortunately tagged as 'Issue 50', so github will have linked them there.
The relevant commits are
This looks to be done.
from critcl.
Wonderful! Thank you very much!
from critcl.
Related Issues (20)
- Request: Win64 gcc compile target HOT 6
- critcl 3.1.18 fails to build queue example HOT 5
- critcl 3.1.18 uninstall fails (Ubuntu) HOT 4
- Unable to checkout repository in Windows because of > in file name HOT 1
- Critcl compilation of tcllib-1.20 on tcl8.7a3 -> hanging with 100% cpu usage in TclBN_mp_copy etc HOT 7
- Unable to build an RPM for the installation of critcl HOT 6
- Loading critcl package slows all Tcl script execution HOT 2
- Ubuntu installation of critcl is broken HOT 21
- Need full working examples in the documentation HOT 35
- Better validation of cproc arguments
- Minor: app-critcl version number mismatch HOT 1
- clibraries limited to compile search path. Not used at runtime HOT 2
- Failure at `critcl` compile stage should stop the tcl script execution HOT 3
- Unable to build an RPM for the installation of critcl (again) HOT 4
- critcl_installer.html error in the example HOT 1
- ::critcl::ScanCore in critcl.tcl error at comment lines HOT 5
- Documentation of passing String Arguments HOT 1
- Documentation How To Tcl Runtime Version HOT 1
- Documentation Additional Tcl Code HOT 1
- Critcl 3.1.8 available from "apt install critcl tcllib-critcl", when 3.1.10?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from critcl.