1. phix and debugging question

hi, i have rather large and complex program now. when i run it, it seems it will go off in a loop at some point, which i can not pinpoint. i tried with profile and with trace, but trace does not work at all. a control c does not go to the source on stopping.

how does one best debug this situation with phix?

any pointers very welcome

richard

new topic     » topic index » view message » categorize

2. Re: phix and debugging question

I assume you have read http://phix.x10.mx/docs/html/debugging.htm

The "DEV (ctrace.out not yet supported)" comment should have been deleted some time ago.

with profile[_time] won't do anything until the program terminates successfully.
with trace by itself won't do anything; you need a trace(1) to start an interactive trace or trace(3) to start writing ctrace.out.

From the sound of things I'd recommend the latter, after <ctrl c> to kill the runaway app you should be able to inspect ctrace.out
to figure out what it was up to. You can also do things like this:

without trace 
include pGUI.e 
include builtins\VM\pcfunc.e 
with trace 

so that lines from those files are omitted from the ctrace.out file. Repeat that sort of thing (for any code, not just includes) a few times until you get a clear picture of where it is going loopy.

Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: phix and debugging question

thanks for the advice. i tried that. i used

with trace 
trace(3) 

i get

Reading h:/Euphoriaprog/Microexp/discount1.kb 
 
................................................................................................... 
Parsing done! 
 
 
pDiagN.e line 3041: oops, rtn[=9134] out of range[1..2739] 
H:\Euphoriaprog\Microexp\myinferer_4.ew:-1 (era=#007399B7, from_addr=#0261FD32, ret_addr=#0261FD3E) in procedure init_infer() 
subscript is not an atom 
... called from H:\Euphoriaprog\Microexp\testmicroexp.ew:11 
 
Global & Local Variables 
 
--> see H:\Euphoriaprog\Microexp\ex.err 
Press Enter... 

it's an expert system that constructs a lot of lists. is it possible to change [1..2739] to something larger in pDiagN.e?

richard

sorry i forget. the

public procedure init_infer() 
  done      = false 
  goal_list = {} 
  how_list  = {} 
  context   = {} 
  line_count = 0 
  active_rule = repeat(true, biggest_rule) 
  clear_screen() 
end procedure 

where biggest_rule = 13. i am using the 64 bit phix.

new topic     » goto parent     » topic index » view message » categorize

4. Re: phix and debugging question

begin said...

i get

pDiagN.e line 3041: oops, rtn[=9134] out of range[1..2739] 
H:\Euphoriaprog\Microexp\myinferer_4.ew:-1 (era=#007399B7, from_addr=#0261FD32, ret_addr=#0261FD3E) in procedure init_infer() 
subscript is not an atom  

Hmm. That routine does not seem to be doing any subscripting.
Try p -d testmicroexp.ew, then run the resulting .exe, then see if you can find the (new, +/-1) era/from/ret addresses in the list.asm, and post those snippets here

[EDIT]: DOH - it is probably trace(3) going wrong, and that may not help at all...

begin said...

is it possible to change [1..2739] to something larger in pDiagN.e?

That refers to symtab being only 2739 entries long, but it has encountered a routine[-id] of 9134, so not really.
There is a mapping as the table is compacted, and there is a (sadly) now broken mapsymtab flag in pEmit2.e that
used to disable that compacting/mapping. I guess you could edit that flag, try "p p testmicroexp.ew", and edit it
back after seeing what happens (I wouldn't bother trying to recompile phix though)....

You might also try setting showmapsymtab (also in pEmit2.e) to 9134, and possibly retry if/while that changes the error,
again using the "p p xxx" method rather than bothering to rebuild phix, and undo that edit asap.

begin said...

i am using the 64 bit phix.

It may be worth giving it a spin on 32 bit, see if that offers any better clues.
(Obviously I fix whatever I can, but 32 bit is simply much more thoroughly tested.)

Pete

new topic     » goto parent     » topic index » view message » categorize

5. Re: phix and debugging question

i renamed my old phix folder and installed anew with a setup from your website and left it as 32bit.

the test source i compile is:

include memory.ew 
include reader.ew 
include myinferer_4.ew 
 
integer err = Parse() 
with trace 
trace(3) 
 
init_infer() 
infer() 

Reading h:/Euphoriaprog/Microexp/discount1.kb 
 
................................................................................................... 
Parsing done! 
 
 
pDiagN.e line 3300: symtab[220] bad S_NTyp[1] 
"sleep(5)..." 
pDiagN.e line 3041: oops, rtn[=8841] out of range[1..2625] 
pDiagN.e line 3041: oops, rtn[=9133] out of range[1..2625] 
H:\Euphoriaprog\Microexp\testmicroexp.ew:-1 (era=#00600DDC, from_addr=#0, ret_addr=#0) 
type check failure, ???(varno=8738[or_ecx=#00002222]) is ??? 
 
Global & Local Variables 
 
--> see H:\Euphoriaprog\Microexp\ex.err 
Press Enter... 

is displayed. ex.err (shortened):

pDiagN.e line 3300: symtab[220] bad S_NTyp[1] 
H:\Euphoriaprog\Microexp\testmicroexp.ew:-1 (era=#00600DDC, from_addr=#0, ret_addr=#0) 
type check failure, ???(varno=8738[or_ecx=#00002222]) is ??? 
 
Global & Local Variables 
 
 H:\Euphoriaprog\Microexp\memory.ew: 
    attr_list[1] = {"Acme done",99'c',0,-1,"",{},"","the Acme order has /not/ been completed",-1} 
    attr_list[2] = {"XYZ done",99'c',0,-1,"",{},"","the XYZ Company order has /not/ been completed",-1} 
	.... 
 
 
 
 H:\Euphoriaprog\Microexp\reader.ew: 
    token = {3} 
    line = "" 
    rule_name = "h:/Euphoriaprog/Microexp/discount1.kb" 
    cf = "" 
    attr = "OK done" 
    pred = "IS" 
    val = "yes" 
    parm_word = "58" 
    error = 0 
    defaultcf = 90'Z' 
    rule_file = 3 
    error_in_line = 0 
    rule_no = 13 
    kind = 3 
    currcon = 1000 
    lastcon = 1000 
    confidence = 0 
    func_list = {} 
 
 H:\Euphoriaprog\Microexp\myinferer_4.ew: 
    goal_list = {} 
    how_list = {} 
    context = {} 
    main_list = {} 
    why_ptr = {} 
    prmpt_ptr = {} 
    proc_item = {} 
    true_rules = {} 
    answer_list = {} 
    mark_context = {} 
    done = 0 
    line_count = 0 
    p_pos = 0 
    main_goal = "" 
 
 H:\Euphoriaprog\Microexp\testmicroexp.ew: 
    err = 1 
 
 h:\Phix\builtins\get.e: 
    input_file = <novalue> 
    input_string = <novalue> 
    string_next = 0 
    ch = 0 
    get_line_no = 0 
 
 h:\Phix\builtins\VM\pprntfN.e: 
    init2 = 1 
    inf = inf 
    nan = nan 
    hexchar = "0123456789ABCDEFabcdef" 
    bases = {10,16,8,2} 
 
 h:\Phix\builtins\scanf.e: 
    baseset = <novalue> 
    binit = 0 
    ch = 56'8' 

no trace file is created.

without the trace the program executes and runs into maybe some loop.

new topic     » goto parent     » topic index » view message » categorize

6. Re: phix and debugging question

begin said...

type check failure, ???(varno=8738[or_ecx=#00002222]) is ??? 

Can you have a look in the list.asm and see what symtab[8738] is (plus 10 either either side) for me.

Also, you may want to try both "p -d xxx" and "p -d! xxx".

One other thing you can try is trace(1), hit F6 (animate) and let it run for half an hour, see if that manages to reach the loopy bit.

new topic     » goto parent     » topic index » view message » categorize

7. Re: phix and debugging question

petelomax said...
begin said...

type check failure, ???(varno=8738[or_ecx=#00002222]) is ??? 

Can you have a look in the list.asm and see what symtab[8738] is (plus 10 either either side) for me.

Also, you may want to try both "p -d xxx" and "p -d! xxx".

p -d! xxx :

symtab[1]:{integer,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',1},0,1,0,#0000003A} 
symtab[2]:{T_N,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[3]:{atom,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',3},0,1,0,#0000003B} 
symtab[4]:{T_Dsq,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[5]:{0b0101,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[6]:{0b0110,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[7]:{0b0111,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[8]:{string,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',8},0,1,0,#0000003D} 
symtab[9]:{0b1001,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[10]:{0b1010,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[11]:{0b1011,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[12]:{sequence,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',12},0,1,0,#0000003C} 
symtab[13]:{0b1101,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[14]:{0b1110,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#FFFFFFFF} 
symtab[15]:{object,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',15},0,1,0,#0000003E} 
symtab[16=filepaths][1]:"h:\\Phix\\builtins\\" 
                    [2]:"h:\\Phix\\builtins\\VM\\" 
                    [3]:"h:\\Phix\\" 
                    [4]:"H:\\Euphoriaprog\\Microexp\\" 
symtab[17=filenames][1]:{4, "testmicroexp.ew"} 
                    [2]:{4, "memory.ew"} 
                    [3]:{4, "reader.ew"} 
                    [4]:{4, "myinferer_4.ew"} 
                    [5]:{2, "pFind.e"} 
                    [6]:{2, "pMatch.e"} 
                    [7]:{1, "to_int.e"} 
                    [8]:{1, "pmaths.e"} 
                    [9]:{1, "get.e"} 
                    [10]:{1, "to_str.e"} 
                    [11]:{2, "pprntfN.e"} 
                    [12]:{1, "matchrepl.e"} 
                    [13]:{1, "pseqc.e"} 
                    [14]:{1, "sort.e"} 
                    [15]:{1, "pcase.e"} 
                    [16]:{1, "scanf.e"} 
                    [17]:{1, "ptrim.e"} 
                    [18]:{1, "utfconv.e"} 
                    [19]:{1, "panykey.e"} 
                    [20]:{1, "pCrashN.e"} 
                    [21]:{2, "psprintN.e"} 
symtab[18]:866 (T_nslink) 
symtab[19]:0 (T_cmdlnflg) 
symtab[20=optable][1]:#00611C52 (:%puts1) 
                  [2]:#00611C5B (:%puts1ediesi) 
                  [3]:#00611C75 (:%puthex32a) 
                  [4]:#00611C8F (:%puthex32) 
                  [5]:#00611CD6 (:%puthex64) 
                  [6]:#00611D25 (:%putsint) 
                  [7]:#00611D8C (:%getc0) 
                  [8]:#00611E9C (:%pCrashMsg) 
                  [9]:#00611ECB (:%pCrashFile) 
                  [10]:#00611EFA (:%pCrashRtn) 
                  [11]:#00611F1A (:%pThrow) 
                  [12]:#00611F56 (:!SetBatchMode) 
                  [13]:#00611F65 (:!fatalN) 
                  [14]:#00611F75 (:!iDiag) 
                  [15]:#0061205D (:!fehDiag) 
                  [16]:#00600D79 (:%opTrace) 
                  [17]:#00600DA4 (:%opLnt) 
                  [18]:#00600DE2 (:%opClrDbg) 
                  [19]:#005F97E6 (:%opProfout) 
                  [20]:#005F97FD (:%opProfile) 
                  [21]:#005F9820 (:%opLnp) 
                  [22]:#005F9849 (:%opLnpt) 
                  [23]:#00610F97 (:%pGetTCB) 
                  [24]:#00610FD6 (:%pGetpGtcb) 
                  [25]:#00610FDC (:%pNewGtcbChain) 
                  [26]:#00610FE8 (:%pRestoreGtcbChain) 
                  [27]:#00610FC2 (:%pSetSaveEBP) 
                  [28]:#006116DB (:%pAllocStr) 
                  [29]:#00611725 (:%pAllocSeq) 
                  [30]:#00611761 (:%pLoadFlt) 
                  [31]:#00611771 (:%pStoreFlt) 
                  [32]:#0061185D (:%pStoreMint) 
                  [33]:#00611823 (:%pLoadMint) 
                  [34]:#0061188D (:%pDealloc) 
                  [35]:#00611890 (:%pDealloc0) 
                  [36]:#00611251 (:%pGetPool) 
                  [37]:#0061161F (:%pFreePool) 
                  [38]:#006119C1 (:%pAlloc) 
                  [39]:#006119E3 (:%pFree) 
                  [40]:#00611A1D (:%pInitCS) 
                  [41]:#00611A49 (:%pDeleteCS) 
                  [42]:#00611A65 (:%pEnterCS) 
                  [43]:#00611A9F (:%pTryCS) 
                  [44]:#00611AB3 (:%pLeaveCS) 
                  [45]:#00610A83 (:%pGetSymPtr) 
                  [46]:#00610A8A (:%pSetSymPtr) 
                  [47]:#00610A91 (:!opGetST) 
                  [48]:#00610A94 (:%opGetST) 
                  [49]:#00610AFD (:%pNewStack) 
                  [50]:#00610B2C (:>initStack) 
                  [51]:#00610BAA (:%opGetArgELF) 
                  [52]:#00610BAB (:%opFrame) 
                  [53]:#00610BF9 (:%opCallOnce) 
                  [54]:#00610C38 (:%opRetf) 
                  [55]:#00610C78 (:%pFreeStack) 
                  [56]:#00610D07 (:%opTchk) 
                  [57]:#00610D36 (:%opTcFail) 
                  [58]:#00610D43 (:%SetCCleanup) 
                  [59]:#00610D49 (:%RunCleanup) 
                  [60]:#00610DEC (:%opAbort) 
                  [61]:#00609F1D (:%cbhandler) 
                  [62]:#00609F8D (:!cb_ret) 
                  [63]:#00610F17 (:%opDelRtn) 
                  [64]:#00610F4B (:%opDelete) 
                  [65]:#00610E57 (:%opCallFunc) 
                  [66]:#00610EB7 (:%opCallProc) 
                  [67]:#00610E9E (:!cf_ret) 
                  [68]:#0060DC6F (:%opInt) 
                  [69]:#0060DCA6 (:%opAtom) 
                  [70]:#0060DCD0 (:%opStr) 
                  [71]:#0060DCE0 (:%opSq) 
                  [72]:#0060DCF0 (:%opObj) 
                  [73]:#0061038B (:%down53) 
                  [74]:#00610392 (:%up53) 
                  [75]:#00610399 (:%near53) 
                  [76]:#006103A0 (:%trunc53) 
                  [77]:#006103A7 (:%down64) 
                  [78]:#006103AE (:%up64) 
                  [79]:#006103B5 (:%near64) 
                  [80]:#006103BC (:%trunc64) 
                  [81]:#00610914 (:>initFEH) 
                  [82]:#00611DBF (:%pUnassigned) 
                  [83]:#00611DD1 (:%pBadRetf) 
                  [84]:#00611DDF (:%e01tcfAddiii) 
                  [85]:#00611DF8 (:%e01tcfediDiv) 
                  [86]:#00611E27 (:%pRTErn) 
                  [87]:#00611E31 (:%pDiv0) 
                  [88]:#00611E31 (:%e02atdb0) 
                  [89]:#00611E3D (:%e01tcfDivi2) 
                  [90]:#00611E54 (:%e01tcfediMul) 
                  [91]:#00611E6E (:!opCallOnceYeNot) 
                  [92]:#0060D895 (:%opAdd) 
                  [93]:#0060D8AE (:%opAddi) 
                  [94]:#0060D8CD (:%opSub) 
                  [95]:#0060D8E6 (:%opSubi) 
                  [96]:#0060D951 (:%opDiv) 
                  [97]:#0060D96A (:%opDivi) 
                  [98]:#0060D9CE (:%opDivf) 
                  [99]:#0060D9DD (:%opDiv2) 
                  [100]:#0060DA46 (:%opMul) 
                  [101]:#0060DA5F (:%opMuli) 
                  [102]:#0060DA92 (:%opAndBits) 
                  [103]:#0060DAC5 (:%opOrBits) 
                  [104]:#0060DAF8 (:%opXorBits) 
                  [105]:#0060D620 (:%opLen) 
                  [106]:#0060F392 (:%fixupIndex) 
                  [107]:#0060F3E8 (:%fixupSliceStart) 
                  [108]:#0060F43E (:%fixupSliceEnd) 
                  [109]:#0060F4A8 (:%pSubse) 
                  [110]:#0060F565 (:%pSubse1) 
                  [111]:#0060F5CD (:%pSubse1i) 
                  [112]:#0060F60B (:%pSubse1ip) 
                  [113]:#0060F624 (:%pSubse1is) 
                  [114]:#0060EFCC (:%pSubss) 
                  [115]:#0060F230 (:%pSubsss) 
                  [116]:#0060DED6 (:%opJcc) 
                  [117]:#0060DF45 (:%opJccE) 
                  [118]:#0060DF72 (:%opJif) 
                  [119]:#0060DF8B (:%opScmp) 
                  [120]:#0060DFB6 (:%opInt0) 
                  [121]:#0060DFC6 (:%opAtom0) 
                  [122]:#0060DFDA (:%opStr0) 
                  [123]:#0060DFEE (:%opSq0) 
                  [124]:#0060A1B9 (:%opJnotx) 
                  [125]:#0060D672 (:%opXor) 
                  [126]:#00611ADF (:%opPow) 
                  [127]:#0060D595 (:%opRmdr) 
                  [128]:#0060EC33 (:%pRepe) 
                  [129]:#0060ED86 (:%pRepe1) 
                  [130]:#0060EEFA (:%pRepe1ip) 
                  [131]:#0060EF59 (:%pRepe1is) 
                  [132]:#0060E77E (:%pReps) 
                  [133]:#0060A129 (:%opRepCh) 
                  [134]:#0060A13D (:%opRepeat) 
                  [135]:#0060DB45 (:%opUminus) 
                  [136]:#0060DB87 (:%opNot) 
                  [137]:#0060DBBA (:%opNotBits) 
                  [138]:#0060DC04 (:%opFloor) 
                  [139]:#0060E00D (:%opApnd) 
                  [140]:#0060E36E (:%opConcat) 
                  [141]:#0060E530 (:%opCatsi) 
                  [142]:#0060E585 (:%opConcatN) 
                  [143]:#0060CF4C (:%opPeeki) 
                  [144]:#0060CF79 (:%opPeekNx) 
                  [145]:#0060D2A5 (:%opPokeN) 
                  [146]:#0060D44F (:%opMemCopy) 
                  [147]:#0060D4DF (:%opMemSet) 
                  [148]:#0060E723 (:%pMkSq) 
                  [149]:#00601359 (:%opCos) 
                  [150]:#00601365 (:%opSin) 
                  [151]:#00601371 (:%opTan) 
                  [152]:#0060137F (:%opArcTan) 
                  [153]:#0060138D (:%opLog) 
                  [154]:#0060139F (:%opSqrt) 
                  [155]:#0060CB6D (:%opOpen) 
                  [156]:#0060CBF2 (:!opClosem9) 
                  [157]:#0060CC04 (:%opClose) 
                  [158]:#0060CC27 (:%opSeek) 
                  [159]:#0060CC81 (:%opWhere) 
                  [160]:#0060CBCA (:%opFlush) 
                  [161]:#0060C6C5 (:%opPuts) 
                  [162]:#0060C1EE (:%opGetc) 
                  [163]:#0060C370 (:%opGets) 
                  [164]:#0060CA6B (:%opGetKey) 
                  [165]:#0060CAF7 (:%opWaitKey) 
                  [166]:#0060CCCA (:%opLock) 
                  [167]:#0060CD31 (:%opUnLock) 
                  [168]:#0060CD70 (:%opGetText) 
                  [169]:#0060CDC6 (:%opGetPos) 
                  [170]:#0060CE03 (:%opWrap) 
                  [171]:#0060CE2A (:%opTextRows) 
                  [172]:#0060CE73 (:%opBkClr) 
                  [173]:#0060CEA1 (:%opTxtClr) 
                  [174]:#0060CECF (:%opClrScrn) 
                  [175]:#0060CEEA (:%opFreeCons) 
                  [176]:#0060CF05 (:%opPosition) 
symtab[21]:{T_maintls,S_Proc,1,(K_wdb+K_ran),0,373,P,0,0,0,#02440028} 
symtab[22]:0 
symtab[23]:#008DE8BE[#0237A2F8] (T_ds4) 
symtab[24]:{5456,S_Const,0,(S_used+K_noclr+K_gbl+K_lit),0,1/#0237A30C,integer,-1} 
symtab[25]:{0,S_Const,0,(S_used+K_noclr+K_gbl+K_lit),0,2/#0237A310,integer,0} 
symtab[26]:{1,S_Const,0,(S_used+K_noclr+K_gbl+K_lit),0,3/#0237A314,integer,1} 
symtab[27]:{eu,S_Nspc,0,#0,0,0,0} 
 
.... 
 
symtab[2619]:{i,S_TVar,21,(S_used+S_set+S_for+K_wdb),2604,2620,integer,?,[esp-36]} 
symtab[2620]:{-1,S_TVar,0,(S_set),0,2621,integer,?,[esp-40]} 
symtab[2621]:{-1,S_TVar,0,(S_set),0,0,atom,?,[esp-44]} 
symtab[2622]:{fn,S_TVar,21,(S_used+S_set+K_used+K_wdb+K_othr),2264,2623,integer,?,[esp]} 
symtab[2623]:{x,S_TVar,21,(S_used+S_set+K_used+K_wdb+K_othr),2609,2624,object,?,[esp-4]} 
symtab[2624]:{maxlen,S_TVar,21,(S_used+S_set+K_used+K_wdb+K_othr+K_dlft),2610,2625,integer,?,[esp-8]} 
symtab[2625]:{-1,S_TVar,0,(S_set),0,0,object,?,[esp-12]} 

last of symtab = 2625

p -d xxxxx:

symtab[1]:{integer,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',1},0,1,0,#0043B03A} 
symtab[2]:{T_N,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[3]:{atom,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',3},0,1,0,#0043B03B} 
symtab[4]:{T_Dsq,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[5]:{0b0101,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[6]:{0b0110,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[7]:{0b0111,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[8]:{string,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',8},0,1,0,#0043B03D} 
symtab[9]:{0b1001,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[10]:{0b1010,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[11]:{0b1011,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[12]:{sequence,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',12},0,1,0,#0043B03C} 
symtab[13]:{0b1101,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[14]:{0b1110,S_Type,0,(K_used+K_gbl),0,0,T,0,0,0,#0043AFFF} 
symtab[15]:{object,S_Type,0,(S_used+K_used+K_gbl),0,0,{84'T',15},0,1,0,#0043B03E} 
symtab[16=filepaths][1]:"h:\\Phix\\builtins\\" 
                    [2]:"h:\\Phix\\builtins\\VM\\" 
                    [3]:"h:\\Phix\\" 
                    [4]:"H:\\Euphoriaprog\\Microexp\\" 
symtab[17=filenames][1]:{4, "testmicroexp.ew"} 
                    [2]:{4, "memory.ew"} 
                    [3]:{2, "pDiagN.e"} 
                    [4]:{2, "pprntfN.e"} 
                    [5]:{2, "pUnassigned.e"} 
                    [6]:{2, "puts1.e"} 
                    [7]:{2, "pPower.e"} 
                    [8]:{2, "pHeap.e"} 
                    [9]:{2, "pDeleteN.e"} 
                    [10]:{2, "pcallfunc.e"} 
                    [11]:{2, "pStack.e"} 
                    [12]:{2, "pFEH.e"} 
                    [13]:{2, "pFPU.e"} 
                    [14]:{2, "psprintN.e"} 
                    [15]:{1, "pcurrdir.e"} 
                    [16]:{1, "pgetpath.e"} 
                    [17]:{1, "peekstr.e"} 
                    [18]:{1, "pcase.e"} 
                    [19]:{1, "ppp.e"} 
                    [20]:{1, "puts1h.e"} 
                    [21]:{4, "reader.ew"} 
                    [22]:{4, "myinferer_4.ew"} 
                    [23]:{2, "pSubseN.e"} 
                    [24]:{2, "pFixup.e"} 
                    [25]:{2, "pSubssN.e"} 
                    [26]:{2, "pRepeN.e"} 
                    [27]:{2, "pRepsN.e"} 
                    [28]:{2, "pMkSqN.e"} 
                    [29]:{2, "pApnd.e"} 
                    [30]:{2, "pJcc.e"} 
                    [31]:{2, "pType.e"} 
                    [32]:{2, "pUnary.e"} 
                    [33]:{2, "pMath.e"} 
                    [34]:{2, "pXor.e"} 
                    [35]:{2, "pLen.e"} 
                    [36]:{2, "pRmdr.e"} 
                    [37]:{2, "pMem.e"} 
                    [38]:{2, "pfileioN.e"} 
                    [39]:{2, "pJnotx.e"} 
                    [40]:{2, "pRepeatN.e"} 
                    [41]:{2, "pSleep.e"} 
                    [42]:{2, "pcfunc.e"} 
                    [43]:{2, "cbhand.e"} 
                    [44]:{2, "pFind.e"} 
                    [45]:{2, "pMatch.e"} 
                    [46]:{1, "to_int.e"} 
                    [47]:{1, "pAlloc.e"} 
                    [48]:{1, "pmaths.e"} 
                    [49]:{2, "pTrig.e"} 
                    [50]:{1, "get.e"} 
                    [51]:{1, "to_str.e"} 
                    [52]:{1, "pflatten.e"} 
                    [53]:{1, "matchrepl.e"} 
                    [54]:{1, "pseqc.e"} 
                    [55]:{1, "sort.e"} 
                    [56]:{1, "scanf.e"} 
                    [57]:{1, "ptrim.e"} 
                    [58]:{1, "utfconv.e"} 
                    [59]:{1, "panykey.e"} 
                    [60]:{1, "pCrashN.e"} 
symtab[18]:866 (T_nslink) 
symtab[19]:1 (T_cmdlnflg) 
symtab[20=optable][1]:#00456004 (:%puts1) 
                  [2]:#0045600D (:%puts1ediesi) 
                  [3]:#00456027 (:%puthex32a) 
                  [4]:#00456041 (:%puthex32) 
                  [5]:#00456088 (:%puthex64) 
                  [6]:#004560D7 (:%putsint) 
                  [7]:#0045613E (:%getc0) 
                  [8]:#0045624E (:%pCrashMsg) 
                  [9]:#0045627D (:%pCrashFile) 
                  [10]:#004562AC (:%pCrashRtn) 
                  [11]:#004562CC (:%pThrow) 
                  [12]:#00456308 (:!SetBatchMode) 
                  [13]:#00456317 (:!fatalN) 
                  [14]:#00456327 (:!iDiag) 
                  [15]:#0045640F (:!fehDiag) 
                  [16]:#00000000 (:%opTrace) 
                  [17]:#00000000 (:%opLnt) 
                  [18]:#00000000 (:%opClrDbg) 
                  [19]:#00000000 (:%opProfout) 
                  [20]:#00000000 (:%opProfile) 
                  [21]:#00000000 (:%opLnp) 
                  [22]:#00000000 (:%opLnpt) 
                  [23]:#00455349 (:%pGetTCB) 
                  [24]:#00455388 (:%pGetpGtcb) 
                  [25]:#0045538E (:%pNewGtcbChain) 
                  [26]:#0045539A (:%pRestoreGtcbChain) 
                  [27]:#00455374 (:%pSetSaveEBP) 
                  [28]:#00455A8D (:%pAllocStr) 
                  [29]:#00455AD7 (:%pAllocSeq) 
                  [30]:#00455B13 (:%pLoadFlt) 
                  [31]:#00455B23 (:%pStoreFlt) 
                  [32]:#00455C0F (:%pStoreMint) 
                  [33]:#00455BD5 (:%pLoadMint) 
                  [34]:#00455C3F (:%pDealloc) 
                  [35]:#00455C42 (:%pDealloc0) 
                  [36]:#00455603 (:%pGetPool) 
                  [37]:#004559D1 (:%pFreePool) 
                  [38]:#00455D73 (:%pAlloc) 
                  [39]:#00455D95 (:%pFree) 
                  [40]:#00455DCF (:%pInitCS) 
                  [41]:#00455DFB (:%pDeleteCS) 
                  [42]:#00455E17 (:%pEnterCS) 
                  [43]:#00455E51 (:%pTryCS) 
                  [44]:#00455E65 (:%pLeaveCS) 
                  [45]:#00454E35 (:%pGetSymPtr) 
                  [46]:#00454E3C (:%pSetSymPtr) 
                  [47]:#00454E43 (:!opGetST) 
                  [48]:#00454E46 (:%opGetST) 
                  [49]:#00454EAF (:%pNewStack) 
                  [50]:#00454EDE (:>initStack) 
                  [51]:#00454F5C (:%opGetArgELF) 
                  [52]:#00454F5D (:%opFrame) 
                  [53]:#00454FAB (:%opCallOnce) 
                  [54]:#00454FEA (:%opRetf) 
                  [55]:#0045502A (:%pFreeStack) 
                  [56]:#004550B9 (:%opTchk) 
                  [57]:#004550E8 (:%opTcFail) 
                  [58]:#004550F5 (:%SetCCleanup) 
                  [59]:#004550FB (:%RunCleanup) 
                  [60]:#0045519E (:%opAbort) 
                  [61]:#0044DF08 (:%cbhandler) 
                  [62]:#0044DF78 (:!cb_ret) 
                  [63]:#004552C9 (:%opDelRtn) 
                  [64]:#004552FD (:%opDelete) 
                  [65]:#00455209 (:%opCallFunc) 
                  [66]:#00455269 (:%opCallProc) 
                  [67]:#00455250 (:!cf_ret) 
                  [68]:#00451C17 (:%opInt) 
                  [69]:#00451C4E (:%opAtom) 
                  [70]:#00451C78 (:%opStr) 
                  [71]:#00451C88 (:%opSq) 
                  [72]:#00451C98 (:%opObj) 
                  [73]:#0045473D (:%down53) 
                  [74]:#00454744 (:%up53) 
                  [75]:#0045474B (:%near53) 
                  [76]:#00454752 (:%trunc53) 
                  [77]:#00454759 (:%down64) 
                  [78]:#00454760 (:%up64) 
                  [79]:#00454767 (:%near64) 
                  [80]:#0045476E (:%trunc64) 
                  [81]:#00454CC6 (:>initFEH) 
                  [82]:#00456171 (:%pUnassigned) 
                  [83]:#00456183 (:%pBadRetf) 
                  [84]:#00456191 (:%e01tcfAddiii) 
                  [85]:#004561AA (:%e01tcfediDiv) 
                  [86]:#004561D9 (:%pRTErn) 
                  [87]:#004561E3 (:%pDiv0) 
                  [88]:#004561E3 (:%e02atdb0) 
                  [89]:#004561EF (:%e01tcfDivi2) 
                  [90]:#00456206 (:%e01tcfediMul) 
                  [91]:#00456220 (:!opCallOnceYeNot) 
                  [92]:#0045183D (:%opAdd) 
                  [93]:#00451856 (:%opAddi) 
                  [94]:#00451875 (:%opSub) 
                  [95]:#0045188E (:%opSubi) 
                  [96]:#004518F9 (:%opDiv) 
                  [97]:#00451912 (:%opDivi) 
                  [98]:#00451976 (:%opDivf) 
                  [99]:#00451985 (:%opDiv2) 
                  [100]:#004519EE (:%opMul) 
                  [101]:#00451A07 (:%opMuli) 
                  [102]:#00451A3A (:%opAndBits) 
                  [103]:#00451A6D (:%opOrBits) 
                  [104]:#00451AA0 (:%opXorBits) 
                  [105]:#004515C8 (:%opLen) 
                  [106]:#0045333A (:%fixupIndex) 
                  [107]:#00453390 (:%fixupSliceStart) 
                  [108]:#004533E6 (:%fixupSliceEnd) 
                  [109]:#00453450 (:%pSubse) 
                  [110]:#0045350D (:%pSubse1) 
                  [111]:#00453575 (:%pSubse1i) 
                  [112]:#004535B3 (:%pSubse1ip) 
                  [113]:#004535CC (:%pSubse1is) 
                  [114]:#00452F74 (:%pSubss) 
                  [115]:#004531D8 (:%pSubsss) 
                  [116]:#00451E7E (:%opJcc) 
                  [117]:#00451EED (:%opJccE) 
                  [118]:#00451F1A (:%opJif) 
                  [119]:#00451F33 (:%opScmp) 
                  [120]:#00451F5E (:%opInt0) 
                  [121]:#00451F6E (:%opAtom0) 
                  [122]:#00451F82 (:%opStr0) 
                  [123]:#00451F96 (:%opSq0) 
                  [124]:#0044E122 (:%opJnotx) 
                  [125]:#0045161A (:%opXor) 
                  [126]:#00455E91 (:%opPow) 
                  [127]:#0045153D (:%opRmdr) 
                  [128]:#00452BDB (:%pRepe) 
                  [129]:#00452D2E (:%pRepe1) 
                  [130]:#00452EA2 (:%pRepe1ip) 
                  [131]:#00452F01 (:%pRepe1is) 
                  [132]:#00452726 (:%pReps) 
                  [133]:#0044E092 (:%opRepCh) 
                  [134]:#0044E0A6 (:%opRepeat) 
                  [135]:#00451AED (:%opUminus) 
                  [136]:#00451B2F (:%opNot) 
                  [137]:#00451B62 (:%opNotBits) 
                  [138]:#00451BAC (:%opFloor) 
                  [139]:#00451FB5 (:%opApnd) 
                  [140]:#00452316 (:%opConcat) 
                  [141]:#004524D8 (:%opCatsi) 
                  [142]:#0045252D (:%opConcatN) 
                  [143]:#00450EF4 (:%opPeeki) 
                  [144]:#00450F21 (:%opPeekNx) 
                  [145]:#0045124D (:%opPokeN) 
                  [146]:#004513F7 (:%opMemCopy) 
                  [147]:#00451487 (:%opMemSet) 
                  [148]:#004526CB (:%pMkSq) 
                  [149]:#0044DEAC (:%opCos) 
                  [150]:#0044DEB8 (:%opSin) 
                  [151]:#0044DEC4 (:%opTan) 
                  [152]:#0044DED2 (:%opArcTan) 
                  [153]:#0044DEE0 (:%opLog) 
                  [154]:#0044DEF2 (:%opSqrt) 
                  [155]:#00450B15 (:%opOpen) 
                  [156]:#00450B9A (:!opClosem9) 
                  [157]:#00450BAC (:%opClose) 
                  [158]:#00450BCF (:%opSeek) 
                  [159]:#00450C29 (:%opWhere) 
                  [160]:#00450B72 (:%opFlush) 
                  [161]:#0045066D (:%opPuts) 
                  [162]:#00450196 (:%opGetc) 
                  [163]:#00450318 (:%opGets) 
                  [164]:#00450A13 (:%opGetKey) 
                  [165]:#00450A9F (:%opWaitKey) 
                  [166]:#00450C72 (:%opLock) 
                  [167]:#00450CD9 (:%opUnLock) 
                  [168]:#00450D18 (:%opGetText) 
                  [169]:#00450D6E (:%opGetPos) 
                  [170]:#00450DAB (:%opWrap) 
                  [171]:#00450DD2 (:%opTextRows) 
                  [172]:#00450E1B (:%opBkClr) 
                  [173]:#00450E49 (:%opTxtClr) 
                  [174]:#00450E77 (:%opClrScrn) 
                  [175]:#00450E92 (:%opFreeCons) 
                  [176]:#00450EAD (:%opPosition) 
symtab[21]:{T_maintls,S_Proc,1,(K_wdb+K_ran),0,95,P,0,0,0,#0043B000} 
symtab[22..23]:0 
symtab[24]:{T_constm1,S_Const,0,(S_used+K_noclr+K_gbl+K_lit),0,1/#00402014,integer,-1} 
symtab[25]:{T_const0,S_Const,0,(S_used+K_noclr+K_gbl+K_lit),0,2/#00402018,integer,0} 
symtab[26]:{T_const1,S_Const,0,(S_used+K_noclr+K_gbl+K_lit),0,3/#0040201C,integer,1} 
 
... 
 
symtab[2610]:{con,S_TVar,59,(S_used+S_set+K_used+K_wdb+K_othr+K_dlft),0,2612,integer,{integer,1,1,object,-1},[esp-4]} 
symtab[2611]:{-1,S_Const,59,(S_used+S_set+K_sqr+K_noclr+K_lit),0,990/#00402F88,T_Dsq,{1,2}} 
symtab[2612]:{-1,S_TVar,0,(S_set),0,0,integer,{integer,0,65791,object,-1},[esp-8]} 
symtab[2613]:{STD_OUTPUT_HANDLE,S_Const,59,(S_used+S_set+K_wdb+K_noclr+K_lit),3014,991/#00402F8C,integer,-11} 
symtab[2614]:{prompt,S_TVar,59,(S_used+S_set+K_used+K_wdb+K_othr+K_dlft),2609,2615,string,{string,MININT,MAXINT,integer,28},[esp]} 
symtab[2615]:{con,S_TVar,59,(S_used+S_set+K_used+K_wdb+K_othr+K_dlft),2610,0,integer,{integer,1,1,object,-1},[esp-4]} 

last of symtab = 2615

will start trace(1) F6 now

richard

new topic     » goto parent     » topic index » view message » categorize

8. Re: phix and debugging question

trace(1) and F6 dies with

pDiagN.e line 3300: symtab[220] bad S_NTyp[1] 
H:\Euphoriaprog\Microexp\testmicroexp.ew:-1 (era=#00600DDC, from_addr=#0, ret_addr=#0) 
type check failure, ???(varno=8738[or_ecx=#00002222]) is ??? 

EDIT

symtab[219]:{-1,S_TVar,0,(S_set),0,0,object,{object,MININT,MAXINT,object,-2},[esp-52]} 
symtab[220]:{fdelete,S_Proc,9,(S_used+K_used+K_wdb+K_ridt),0,232,{80'P',15},221,1,3,#0045477A} 
symtab[221]:{o,S_TVar,9,(S_used+S_set+K_used+K_wdb+K_othr),0,222,object,{object,MININT,MAXINT,object,-2},[esp]} 
 

richard

ps. if you don' need tzhe symtab (previous post) any more, i edit and delete them - to shorten the post.

new topic     » goto parent     » topic index » view message » categorize

9. Re: phix and debugging question

begin said...

trace(1) and F6 dies with

pDiagN.e line 3300: symtab[220] bad S_NTyp[1] 
H:\Euphoriaprog\Microexp\testmicroexp.ew:-1 (era=#00600DDC, from_addr=#0, ret_addr=#0) 
type check failure, ???(varno=8738[or_ecx=#00002222]) is ??? 

Can you try grabbing a fuller screenshot? For example, running Greg's "wrong file mode for attempted operation" sample as recently posted, trace(1) F6 (and <Ctrl A><CR>) gives me:

 ..Files (x86)\Phix\builtins\database.e  F1=main  F2=trace  F3=help  ?  q  Q  ! 
  296:  end function 
  297: 
  298:  procedure put1(integer x) 
  299:  -- write 1 byte to current database file 
  300:      puts(current_db, x) 
  301:  end procedure 
  302: 
  303:  procedure put4(atom x)                                                    304:  -- write 4 bytes to current database file 
  305:  -- x is 32-bits max 
  306:      poke4(mem0, x) -- faster than doing divides etc.                      307==>    puts(current_db, peek(memseq)) 
C:\Program Files (x86)\Phix\builtins\database.e:307 in procedure put4() 
wrong file mode for attempted operation 
    x = 45ocedure putn(sequence s) 
... called from C:\Program Files (x86)\Phix\builtins\database.e:508 in function db_allocate()uts(current_db, s) 
    n = 41d procedure 
    free_list = <novalue> 
    size = <novalue>fe_seek(atom pos) 
    size_ptr = <novalue>ition in the current db file 
    addr = <novalue>current_db, pos)!=0 then 
    free_count = 0tal(sprintf("seek to position %d failed!\n", pos)) 
    remaining = <novalue> 
    i = <novalue> 
 
Global & Local Variables 
 
--> see C:\Program Files (x86)\Phix\ex.err 
Press Enter... 

So obviously, in that case, it is failing on line 307 (and obviously the fact that you get a line number of -1 instead, is the biggest problem here).
Hopefully that somewhat garbled screen may contain some vital clues missing from the ex.err.

begin said...

ps if you don' need the symtab (previous post) any more, i edit and delete them - to shorten the post.

yeah, that may as well go now.

Pete

new topic     » goto parent     » topic index » view message » categorize

10. Re: phix and debugging question

i can't do that - like greg. the program runs off into a loop, it doesn't crash or anything like that. i run out of memory eventually, the program fails without any messages. i wish it would crash.

richard

new topic     » goto parent     » topic index » view message » categorize

11. Re: phix and debugging question

Your only options now are either upload something I can run, or laboriously go through adding print statements, eg

include memory.ew 
include reader.ew 
include myinferer_4.ew 
 
integer err = Parse() 
--?"got here" 
init_infer() 
?"got here" 
infer() 
?"did not get here" 

and, assuming those statements reflect reality, putting similar statements inside the infer() routine, and just keep on narrowing it down as far as possible.

Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu