From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,1b0e337c9ace3fea X-Google-NewGroupId: yes X-Google-Thread: ffc31,1b0e337c9ace3fea X-Google-NewGroupId: yes X-Google-Thread: 1164f8,1b0e337c9ace3fea X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidf4c4f7386e,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.102.33 with SMTP id fl1mr3674108pab.38.1369758306901; Tue, 28 May 2013 09:25:06 -0700 (PDT) Path: d5ni18708pbl.0!nntp.google.com!news.glorb.com!aioe.org!.POSTED!not-for-mail From: paramucho@hotmail.com (paramucho) Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: Debugging Programs under RT-11 Date: Tue, 28 May 2013 16:25:04 GMT Organization: Aioe.org NNTP Server Message-ID: <51a4d13b.59971698@nntp.aioe.org> References: <51a368d5$0$32108$14726298@news.sunsite.dk> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: yPe0Vz9rK3epnEf2vEo6yg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 1.5/32.451 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Mon, 27 May 2013 10:05:39 -0400, "Jerome H. Fine" wrote: >Does anyone reading this still write code to be run >under RT-11? When a program has a bug, what do >you use to find the problem? For debugging programs, >SD: seems the most efficient way, especially when a >Mapped Monitor is being used. Alternatively, ODT >(VDT when Multi-terminal Support is included in the >RT-11 monitor) can be LINKed into the program. > >Recently, I have been considering enhancements to >the SD: variant, SDHX.SYS, which would reduce >the Low Memory required along with adding an >additional feature which is part of Ersatz-11. >Specifically, SET PCLOG ON requests the >Ersatz-11 emulator to save the addresses of the >last 64 instructions that were executed. The the >command SHOW PCLOG displays all 64 addresses >at the users request. > >I would appreciate a response from anyone still writing >and debugging programs that run under RT-11 and >which debug package is being used along with the >advantages and disadvantages that have been found. I still write and debug RT-11 programs, but mostly running under RUST, or more recently under RTX (RUST running under RSX). I use my own debuggers. For MACRO, I use output logging and a single breakpoint, or wait for a memory or instruction error to trigger the debugger. I haven't used a symbolic debugger for a long time--I have the program source available on a different screen and read from that. Every so often I need the link map to get a symbolic address. For C programs I use printf almost exclusively, although my preprocessor has a feature which allows me to log progress at the terminal very easily. Most of my debugging is done under the V11 emulator which has a great debugger where I can trap all kinds of behaviors. Along with WATCH it also supports FEEL which traps when a particular location is read. A couple of years ago I wrote a new debugger for RUST/SJ with full trace trap support. RUST/XM has yet another debugger which runs in kernel space--it allows ordinary system usage to continue while debugging in user or kernel mode (although you have to be careful). V11 and the new RUST/SJ debugger support a command history. The L (last) and N (next) debug commands walk through the command history (like your PCLOG). 144414 112504 movb (r5)+,r4 | l 144412 112546 movb (r5)+,-(sp) | l 143764 4567 jsr r5,144412 | l 143762 103026 bcc 144040 | l 131404 4737 call @#143762 | l 131402 261 sec | l 131400 5001 clr r1 | l 131376 5726 tst (sp)+ | I generally use an edit-compile-test loop for each bug. Hundreds of compiles. I rely heavily on RT-11 and RSX system call traces. The trace below shows the RTX program VIP.SAV (think PIP.SAV) being run out of a native RSX directory. There are both RT-11 and RSX system calls. Using this kind of trace lets me localise bugs very quickly. .run dl:[1,64]vir 173506 .close chan=17 137542 .spfun chan=17 func=777 buf=165220 wcnt=0 blk=0 crtn=0 174112 .dstat dnam=163462=c00: retspc=163536 173534 .lookup chan=17 dblk=163462=c00:vip.sav seq=10 167330 .lookup chan=17 dblk=163510=dl:001064.dsk seq=163536 137542 .spfun chan=17 func=1777 buf=165142 wcnt=163536 blk=163536 160202u alun lun=20 dev=[DL] 160202u glun lun=20 buf=145722 161216u qiow fun=11=(fna) mod=0 lun=20 efn=41 isb=160006 p6=145736 nam=[DL0:001064.DIR] fid=0/0 did=4/4 137542 .spfun chan=17 func=1777 buf=165220 wcnt=163536 blk=163536 161216u qiow fun=11=(fna) mod=0 lun=20 efn=41 isb=160006 p6=145736 nam=[DL0:VIP.SAV] fid=0/0 did=24/1 161216u qiow fun=16=(acw) mod=0 lun=20 efn=41 isb=160006 p1=147174 p5=100000 161216u qiow fun=26=(rat) mod=0 lun=20 efn=41 isb=160006 p1=147174 p2=151126 173566 .readw chan=17 buf=2000 wcnt=400 crtn=0 blk=0 40 userpc 4056 42 usersp 1000 44 jsw -ovly$ 50 userto 52540 173750 .readw chan=17 buf=1000 wcnt=25400 crtn=0 blk=1 173440 .close chan=17 137542 .spfun chan=17 func=777 buf=165220 wcnt=1000 blk=1000 crtn=0 161216u qiow fun=20=(dac) mod=0 lun=20 efn=41 isb=160006 p1=147174 141646u gtim buf=120266 4104 .serr 51674 .settop addr=121102 50 userto 121102 4142 .gtjb addr=3756 44 jsw +ttlc$ 4254 .csispc (gtlin) linbuf=56576 prompt=3664 VIP> VIP> Ian