<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class="">I am excited to announce that over the next couple of days I am going to commit patches that enable LLDB to debug QBASIC programs</div><div class=""><br class=""></div><div class="">This is what your experience will look like</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0e7605" class="">(lldb) </span>target create -Q file.bas</div></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">Current executable set to 'qbasic.exe' (i386*).</div></div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">* no really, we setup DOSBOX to run qbasic on an emulated 386.</div><div class=""><br class=""></div><div class="">You can set a breakpoint by function, obviously, or by line number because it is BASIC</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0e7605" class="">(lldb) </span>break set -n MyFunction</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">Breakpoint 1: 3 locations.</div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0e7605" class="">(lldb) </span>break set -l 386</div></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">Breakpoint 2: 1 location.</div></div><div class=""><br class=""></div><div class=""><div class="">Launching the program will setup a DOSBOX session, launch QBASIC.EXE inside said session, and then hijack control of DOSBOX so that:</div><div class="">a) we can insert breakpoints as needed</div><div class="">b) we can gather the AST from QBASIC to create types</div><div class="">c) we can gather variable information</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(14, 118, 5); background-color: rgb(0, 0, 0);" class="">(lldb) <span style="font-variant-ligatures: no-common-ligatures; color: #29f914" class="">run</span></div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">Process 40774 launched: 'qbasic' (i386)*</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">* no really, we setup DOSBOX to run qbasic on an emulated 386.</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">Process 40774 stopped</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">* thread #1: tid = 0xcb3f2, 0x00007fff8c39736b qbasic.exe`main:386, stop reason = breakpoint 2.1</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">    frame #0: 0x00007fff8c39736b qbasic.exe`main:386</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">386 IF I$ = "" : PRINT "HELLO WORLD"</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">387 IF I% > 0: I% = I% - 1</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">388 IF I% > 0: I% = I% - 1</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">389 IF I% > 0: GOSUB 401</div></div><div class=""><br class="webkit-block-placeholder"></div><div class="">You can inspect variables</div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0e7605" class="">(lldb) </span>frame variable</div></div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">DIM I% = 12</div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">DIM I$ = ""</div><div class=""><br class=""></div><div class="">as you can see, we changed the default style of “frame variable” to reflect the syntax of BASIC more closely. This is work I am personally quite proud of.</div><div class="">And, of course, Sean spent a considerable amount of time assuring reliable expression evaluation works naturally:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0e7605" class="">(lldb) </span>expr I% + 12</div></div><div style="margin: 0px; font-size: 16px; font-family: 'Perfect DOS VGA 437'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">DIM LRV0% = 24</div><div class=""><br class=""></div><div class="">We decided that $ symbols were confusing - imagine $0$ for a string result - so we went with a LRV prefix (<b class="">L</b>LDB <b class="">r</b>esult <b class="">v</b>ariable)</div><div class=""><br class="webkit-block-placeholder"></div><div class="">Flow control across subroutine calls is very stable - still a little flakey when it comes to GOSUBs but we plan to enhance that over the coming weeks</div><div class=""><br class=""></div><div class="">I think this is a great addition to LLDB and I look forward to your feedback</div><div class=""><br class=""></div><div class=""><b class="">disclaimer:</b> you will need to supply your own legally licensed copy of QBASIC.EXE for this to work. If you can’t acquire one, you can build with the LLDB_DISABLE_AWESOMENESS macro defined and that will disable building the QBASIC support</div><div class="">
<div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">Thanks,</div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div>
</div>
<br class=""></div></body></html>