Posted to tcl by thommey at Fri Nov 05 23:46:02 GMT 2010view raw
- /*
- test.c:
-
- #include <tcl.h>
- #include <stdio.h>
-
- int main(int argc, char **argv)
- {
- const char * name;
- /* Tcl_FindExecutable((char*) argv[0]); */
- name = Tcl_GetNameOfExecutable();
- fprintf(stdout, "Hello World\n");
- if (name != NULL) {
- fprintf(stdout, "The tcl executable is %s\n", name);
- } else {
- fprintf(stdout, "The tcl executable is null\n");
- }
- return 0;
- }
- compiled with gcc -W -Wall -ggdb -o test test.c -ltcl8.5
- */
-
- (gdb) bt full
- #0 0x00000000 in ?? ()
- No symbol table info available.
- #1 0xb7f83f84 in ThreadStorageGetHashTable (id=0xb7d178d0) at /usr/src/tcl8.5.8/unix/../generic/tclThreadStorage.c:212
- index = 38
- hPtr = 0xbffff698
- isNew = -1209838851
- hashTablePtr = 0x0
- #2 0xb7f840d4 in TclpThreadDataKeyGet (keyPtr=0xb7fc4e18) at /usr/src/tcl8.5.8/unix/../generic/tclThreadStorage.c:336
- hashTablePtr = 0x1
- hPtr = 0x0
- #3 0xb7f824f1 in Tcl_GetThreadData (keyPtr=0xb7fc4e18, size=4) at /usr/src/tcl8.5.8/unix/../generic/tclThread.c:87
- result = 0xb7f824d4
- #4 0xb7f8e544 in GetThreadHash (keyPtr=0xb7fc4e18) at /usr/src/tcl8.5.8/unix/../generic/tclUtil.c:2888
- tablePtrPtr = 0x0
- #5 0xb7f8e902 in TclGetProcessGlobalValue (pgvPtr=0xb7fc4e00) at /usr/src/tcl8.5.8/unix/../generic/tclUtil.c:3065
- value = 0x0
- cacheMap = 0x1
- hPtr = 0xb7ea9fb0
- epoch = 0
- #6 0xb7f8ea77 in TclGetObjNameOfExecutable () at /usr/src/tcl8.5.8/unix/../generic/tclUtil.c:3156
- No locals.
- #7 0xb7f8ea94 in Tcl_GetNameOfExecutable () at /usr/src/tcl8.5.8/unix/../generic/tclUtil.c:3185
- numBytes = 1
- bytes = 0xb7f8ea7d "U\211\345S\203\354$\350.\237\362\377\201\303s\335\002"
- #8 0x08048562 in main (argc=1, argv=0xbffffa34) at test.c:8
- name = 0xb7e9eff4 "|-\024"
-