Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!uxc.cso.uiuc.edu!tank!ra_robert@gsbacd.uchicago.edu From: ra_robert@gsbacd.uchicago.edu Newsgroups: comp.sys.mac.programmer Subject: LSP/THINK Code Resource question Message-ID: <4246@tank.uchicago.edu> Date: 4 Jul 89 04:40:47 GMT Sender: news@tank.uchicago.edu Distribution: na Organization: University of Chicago Graduate School of Business Lines: 44 I'm writing an MDEF with LSP/THINK Pascal. Near the start of my MDEF I call a sub-procedure in which I allocate a pointer with NewPtr (which I dispose of before exiting the MDEF). While debugging (with TMON), I intercepted the NewPtr call, but the NewPtr call isn't in my sub-proc any longer, but rather it's near the start of main the code. I think this section of main code is called from my sub-proc and then jumps back there. Any idea of what's going on? It's more difficult to debug when the assembly differs greatly from the source (i.e, why is my NewPtr call not in the section of code (my sub-proc) where it "should" be?). This is basically (a very much simplified and edited version of) my setup: procedure myMDEF(all the right params); type myStuff:array[1..x] of whatever; myPtr:^myStuff var mainMyPtr:MyPtr; function GiveMeMyPtr: MyPtr begin GiveMeMyPtr:=MyPtr(NewPtr(sizeof(myStuff))); end; begin {main} mainMyPtr:=GiveMeMyPtr; DisposPtr(pointer(mainMyPtr)); end; {main} Robert ------ ra_robert@gsbacd.uchicago.edu ------ generic disclaimer: all my opinions are mine