Posted to tcl by Emiliano at Thu Oct 11 18:38:44 GMT 2007view raw

  1. emiliano@maq033:~/tcl_sources$ gdb wish8.5
  2. GNU gdb 6.5
  3. Copyright (C) 2006 Free Software Foundation, Inc.
  4. GDB is free software, covered by the GNU General Public License, and you are
  5. welcome to change it and/or distribute copies of it under certain conditions.
  6. Type "show copying" to see the conditions.
  7. There is absolutely no warranty for GDB. Type "show warranty" for details.
  8. This GDB was configured as "i386--netbsdelf"...
  9. (gdb) run fuentes.tcl
  10. Starting program: /home/emiliano/programas/bin/wish8.5 fuentes.tcl
  11.  
  12. Program received signal SIGSEGV, Segmentation fault.
  13. 0xbbbac044 in InitFont (tkwin=0x8246500, pattern=0x824f720, fontPtr=0x81a0300)
  14. at /home/emiliano/tcl_sources/tk/unix/../unix/tkUnixRFont.c:177
  15. 177 if (XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0,
  16. (gdb) bt full
  17. #0 0xbbbac044 in InitFont (tkwin=0x8246500, pattern=0x824f720, fontPtr=0x81a0300)
  18. at /home/emiliano/tcl_sources/tk/unix/../unix/tkUnixRFont.c:177
  19. faPtr = (TkFontAttributes *) 0x0
  20. fmPtr = (TkFontMetrics *) 0xbb861418
  21. family = 0xbbaacaa0 "\030\211\020"
  22. familyPtr = (char **) 0xbfbfde54
  23. weight = 135129280
  24. slant = -1148907700
  25. spacing = -1077944728
  26. i = 38
  27. size = 3.7114161395201585e-314
  28. set = (FcFontSet *) 0x81a8280
  29. charset = (FcCharSet *) 0x8243d08
  30. result = FcResultNoMatch
  31. ftFont = (XftFont *) 0x0
  32. #1 0xbbbac52d in TkpGetFontFromAttributes (tkFontPtr=0x0, tkwin=0x8246500, faPtr=0xbfbfdee0)
  33. at /home/emiliano/tcl_sources/tk/unix/../unix/tkUnixRFont.c:360
  34. pattern = (XftPattern *) 0x824f720
  35. weight = 100
  36. slant = 0
  37. fontPtr = (UnixFtFont *) 0x0
  38. #2 0xbbae313a in Tk_AllocFontFromObj (interp=0x804f800, tkwin=0x8246500, objPtr=0x8266900)
  39. at /home/emiliano/tcl_sources/tk/unix/../generic/tkFont.c:1188
  40. fa = {family = 0x82633d0 "Helvetica", size = 13, weight = 0, slant = 0, underline = 0,
  41. overstrike = 0}
  42. dupObjPtr = (Tcl_Obj *) 0x82668e8
  43. fiPtr = (TkFontInfo *) 0x8052d80
  44. cacheHashPtr = (Tcl_HashEntry *) 0x80de8a0
  45. namedHashPtr = (Tcl_HashEntry *) 0x0
  46. fontPtr = (TkFont *) 0x0
  47. firstFontPtr = (TkFont *) 0x0
  48. oldFontPtr = (TkFont *) 0x0
  49. isNew = 1
  50. descent = 134745680
  51. nfPtr = (NamedFont *) 0xbfbfe018
  52. #3 0xbbadae91 in DoObjConfig (interp=0x804f800, recordPtr=0x8246600 "", optionPtr=0x82478e8,
  53. valuePtr=0x8266900, tkwin=0x8246500, savedOptionPtr=0x0)
  54. at /home/emiliano/tcl_sources/tk/unix/../generic/tkConfig.c:773
  55. newFont = (Tk_Font) 0x824f710
  56. slotPtrPtr = (Tcl_Obj **) 0x0
  57. oldPtr = (Tcl_Obj *) 0x0
  58. internalPtr = 0x8246648 ""
  59. oldInternalPtr = 0xbfbfdfc4 " ʪ»øß¿¿"
  60. internal = {optionPtr = 0xbb9c4e08, valuePtr = 0x824f710,
  61. internalForm = -0.12451128560750613}
  62. specPtr = (const Tk_OptionSpec *) 0xbbbdada8
  63. nullOK = 0
  64. #4 0xbbada91c in Tk_InitOptions (interp=0x804f800, recordPtr=0x8246600 "", optionTable=0x8247800,
  65. tkwin=0x8246500) at /home/emiliano/tcl_sources/tk/unix/../generic/tkConfig.c:553
  66. tablePtr = (OptionTable *) 0x8247800
  67. optionPtr = (Option *) 0x82478e8
  68. count = 18
  69. value = 0x815c870 "Helvetica 13"
  70. valuePtr = (Tcl_Obj *) 0x8266900
  71. source = OPTION_DATABASE
  72. #5 0xbbb117c1 in Tk_ListboxObjCmd (clientData=0x0, interp=0x804f800, objc=6, objv=0x80541c0)
  73. at /home/emiliano/tcl_sources/tk/unix/../generic/tkListbox.c:560
  74. listPtr = (Listbox *) 0x8246600
  75. tkwin = (Tk_Window) 0x8246500
  76. optionTables = (ListboxOptionTables *) 0x81a87f0
  77. #6 0xbb9c8e6b in TclEvalObjvInternal (interp=0x804f800, objc=6, objv=0x80541c0,
  78. command=0x816dd93 "listbox .lb -listvariable fuentes -yscrollcommand {.sb set}\nlabel .show -bg white -font $fuente -text [lindex $fuentes 0]\npack .sup .inf -expand 1 -fill both\npack propagate .inf 0\npack .sb -side right"..., length=60, flags=0)
  79. at /home/emiliano/tcl_sources/tcl/unix/../generic/tclBasic.c:3613
  80. cmdPtr = (Command *) 0x8090e40
  81. iPtr = (Interp *) 0x804f800
  82. newObjv = (Tcl_Obj **) 0x816ddcf
  83. i = -1146758808
  84. savedVarFramePtr = (CallFrame *) 0x0
  85. varFramePtr = (CallFrame *) 0x8051240
  86. code = 0
  87. traceCode = 0
  88. checkTraces = 1
  89. traced = 0
  90. savedNsPtr = (Namespace *) 0x0
  91. lookupNsPtr = (Namespace *) 0x0
  92. commandPtr = (Tcl_Obj *) 0x0
  93. #7 0xbb9c9dd8 in TclEvalEx (interp=0x804f800,
  94. script=0x816dc00 "tk_setPalette seashell\noption add *Listbox.background white\noption add *Listbox.selectBackground darkblue\noption add *Listbox.selectForeground white\noption add *borderWidth 1\noption add *font {Helveti"..., numBytes=871, flags=0, line=13)
  95. at /home/emiliano/tcl_sources/tcl/unix/../generic/tclBasic.c:4262
  96. wordLine = 13
  97. wordStart = 0x816ddc5 "{.sb set}\nlabel .show -bg white -font $fuente -text [lindex $fuentes 0]\npack .sup .inf -expand 1 -fill both\npack propagate .inf 0\npack .sb -side right -fill y -in .sup\npack .lb -side left -expand 1 -f"...
  98. objectsNeeded = 6
  99. numWords = 6
  100. iPtr = (Interp *) 0x804f800
  101. p = 0x816dd93 "listbox .lb -listvariable fuentes -yscrollcommand {.sb set}\nlabel .show -bg white -font $fuente -text [lindex $fuentes 0]\npack .sup .inf -expand 1 -fill both\npack propagate .inf 0\npack .sb -side right"...
  102. next = 0x816dd93 "listbox .lb -listvariable fuentes -yscrollcommand {.sb set}\nlabel .show -bg white -font $fuente -text [lindex $fuentes 0]\npack .sup .inf -expand 1 -fill both\npack propagate .inf 0\npack .sb -side right"...
  103. minObjs = 20
  104. objv = (Tcl_Obj **) 0x80541c0
  105. objvSpace = (Tcl_Obj **) 0x80541c0
  106. expand = (int *) 0x8054214
  107. lines = (int *) 0x8054268
  108. lineSpace = (int *) 0x8054268
  109. tokenPtr = (Tcl_Token *) 0x8054110
  110. commandLength = 0
  111. bytesLeft = 468
  112. expandRequested = 0
  113. code = 0
  114. savedVarFramePtr = (CallFrame *) 0x8051240
  115. allowExceptions = 0
  116. gotParse = 1
  117. i = 6
  118. objectsUsed = 6
  119. parsePtr = (Tcl_Parse *) 0x8054018
  120. eeFramePtr = (CmdFrame *) 0x8054194
  121. stackObjArray = (Tcl_Obj **) 0x80541c0
  122. expandStack = (int *) 0x8054214
  123. linesStack = (int *) 0x8054268
  124. #8 0xbb9c9565 in Tcl_EvalEx (interp=0x804f800,
  125. script=0x816dc00 "tk_setPalette seashell\noption add *Listbox.background white\noption add *Listbox.selectBackground darkblue\noption add *Listbox.selectForeground white\noption add *borderWidth 1\noption add *font {Helveti"..., numBytes=871, flags=0)
  126. at /home/emiliano/tcl_sources/tcl/unix/../generic/tclBasic.c:3965
  127. No locals.
  128. #9 0xbba46001 in Tcl_FSEvalFileEx (interp=0x804f800, pathPtr=0x805b018, encodingName=0x0)
  129. at /home/emiliano/tcl_sources/tcl/unix/../generic/tclIOUtil.c:1826
  130. result = 1
  131. length = 871
  132. statBuf = {st_dev = 0, st_mode = 33188, st_ino = 1633514, st_nlink = 1, st_uid = 1000,
  133. st_gid = 100, st_rdev = 6762071, st_atimespec = {tv_sec = 1192127374, tv_nsec = 478794375},
  134. st_mtimespec = {tv_sec = 1158687047, tv_nsec = 89275000}, st_ctimespec = {tv_sec = 1158687047,
  135. tv_nsec = 89275000}, st_birthtimespec = {tv_sec = 0, tv_nsec = 0}, st_size = 871,
  136. st_blocks = 2, st_blksize = 8192, st_flags = 0, st_gen = 0, st_spare = {3243953126, 0}}
  137. oldScriptFile = (Tcl_Obj *) 0x0
  138. iPtr = (Interp *) 0x804f800
  139. string = 0x816dc00 "tk_setPalette seashell\noption add *Listbox.background white\noption add *Listbox.selectBackground darkblue\noption add *Listbox.selectForeground white\noption add *borderWidth 1\noption add *font {Helveti"...
  140. chan = (Tcl_Channel) 0x80bc820
  141. objPtr = (Tcl_Obj *) 0x80a8300
  142. #10 0xbbaf1535 in Tk_MainEx (argc=-1, argv=0xbfbfe704, appInitProc=0x80489d7 <Tcl_AppInit>,
  143. interp=0x804f800) at /home/emiliano/tcl_sources/tk/unix/../generic/tkMain.c:272
  144. path = (Tcl_Obj *) 0x805b018
  145. argvPtr = (Tcl_Obj *) 0x805e8d0
  146. encodingName = 0x0
  147. code = -1077942608
  148. nullStdin = 0
  149. inChannel = (Tcl_Channel) 0xbbbf5501
  150. outChannel = (Tcl_Channel) 0xbbbec200
  151. tsdPtr = (ThreadSpecificData *) 0x805c200
  152. appName = {string = 0xbfbfe56c "", length = 0, spaceAvl = 200,
  153. staticSpace = "\000uentes.tcl\000½r¿»\004\204\004\bع7\004¨ì¿»´å¿¿\001\000\000\000p\020\006\b,\225ª»tr¿»\201)¼»´å¿¿\224\202½\001D³©»\000\000\000\000\200\020\006\b\000ľ»|ì¿»h\202\004\b\034\000\000\000\004\204\004\b&u¿»\004\204\004\bع7\004\000¾»\004æ¿¿\001\000\000\000\000\000\000\000 ʪ»Ät¿»\177\\\234»\000ø\004\bD³©\001\001\000\000\000@ÿª» \000\000\000\000ľ»|ì¿»t\234\004\b\000\000\000\000\230æ¿¿\206V¿»\005\000\000\000\000¾»8æ¿¿\001\000\000\000\000\000\000\000\000¾»"}
  154. #11 0x080489c4 in main (argc=2, argv=0xbfbfe6fc)
  155. at /home/emiliano/tcl_sources/tk/unix/../unix/tkAppInit.c:68
  156. No locals.
  157. (gdb)
  158.  
  159.  
  160. This is the script:
  161.  
  162.  
  163. emiliano@maq033:~/tcl_sources$ cat fuentes.tcl
  164. tk_setPalette seashell
  165. option add *Listbox.background white
  166. option add *Listbox.selectBackground darkblue
  167. option add *Listbox.selectForeground white
  168. option add *borderWidth 1
  169. option add *font {Helvetica 13}
  170.  
  171. set fuentes [lsort [font families]]
  172. set fuente [font create -family [lindex $fuentes 0] -size 12]
  173. frame .sup
  174. frame .inf -width 300 -height 100
  175. scrollbar .sb -orient vertical -command {.lb yview}
  176. listbox .lb -listvariable fuentes -yscrollcommand {.sb set}
  177. label .show -bg white -font $fuente -text [lindex $fuentes 0]
  178. pack .sup .inf -expand 1 -fill both
  179. pack propagate .inf 0
  180. pack .sb -side right -fill y -in .sup
  181. pack .lb -side left -expand 1 -fill both -in .sup
  182. pack .show -expand 1 -fill both -in .inf
  183. focus .lb
  184.  
  185. bind .lb <<ListboxSelect>> {
  186. set tmp [lindex $fuentes [.lb curselection]]
  187. font configure $fuente -family $tmp
  188. .show configure -text $tmp
  189. }
  190.