Author Topic: SB π  (Read 7555 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #150 on: April 08, 2019, 05:40:20 PM »
Great!

No more root abuse.  :)

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #151 on: April 08, 2019, 05:47:04 PM »
I found a lightweight web server (Cherokee) that has what I need for the sbhttpd proxy server and supports MySQL. There wasn't a distribution for the RPi so I had to build it from source.


============================
Install prefix        /usr/local
CFLAGS                -g -O2
trace                 no
backtracing           no
sendfile()            yes
IPv6 support          yes
Polling method 1      epoll
Polling method 2      poll
Polling method 3      select
Threading support     yes
OpenSSL support       yes
PCRE library          yes
Compatible PAM        no
Python                yes
LDAP                  no
MySQL                 yes
GeoIP                 no
FFMpeg                no
crypt support         multithread

Installation dir /usr/local/bin
============================


« Last Edit: April 08, 2019, 05:50:21 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #152 on: April 09, 2019, 08:58:45 PM »
AIR,

I was able to get a build and DEB built for the Raspberry Pi Zero W.

Issues

* Your Perl fix didn't work and I had to revert back to the old way.

* SBT.so doesn't get built because it can't find libscriba.a in the LD path because it hasn't been created yet or installed.

* SBT.bas isn't being created correctly an only the alias function names shown.

My set of test scripts seem to run okay.

Good News!

The RPi Zero build even works on the 3 B+.
« Last Edit: April 10, 2019, 03:25:25 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #153 on: April 15, 2019, 05:55:49 PM »
AIR,

Can you change the mkdeb.sh script to allow an optional name for the .deb?


Offline AIR

  • BASIC Developer
  • Posts: 684
Re: SB π
« Reply #154 on: April 15, 2019, 06:44:36 PM »
You should be able to make this change.

Simple if block checking passed parameters. 

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #155 on: April 15, 2019, 07:18:00 PM »
You locked (in theory) the repo until your reorganization was complete.

I found out that no capital letters are allowed. I could change the filename but the uninstall wouldn't work.

Where this becomes an issue is when I'm creating a .deb for the RPi. Both the Zero and ARMv7 (3 B) generate the same file name.
« Last Edit: April 15, 2019, 09:40:53 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 684
Re: SB π
« Reply #156 on: April 16, 2019, 04:31:45 AM »
Repo is not 'locked'.  All I said was don't merge the branches.

The deb is generated using lowercase, what's the issue?

You've stated elsewhere that the deb generated on the zero also works on the 3.  So generate the FINAL deb on the zero.

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #157 on: April 16, 2019, 05:21:09 AM »
I would like to offer both an ARMv6 (zero) and ARMv7 (3 B) for the Raspberry Pi.

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #158 on: April 16, 2019, 01:40:38 PM »
Quote
The deb is generated using lowercase, what's the issue?

I hard coded a name in mkdeb.sh which had capital letters in it and it failed. How I learned about this limitation.

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #159 on: April 16, 2019, 03:17:03 PM »
AIR,

I'm trying to get the console debugger I wrote working with the RPi Zero.

I'm getting this strange error with the sdbg extension module.


pi@raspberrypi:~/sbrpi $ scriba dbgcon.sb testarray.sb
/usr/local/bin/scriba: symbol lookup error: /usr/local/lib/scriba/sdbg.so: undefined symbol: strnicmp
(0): error &H16:The file can not be opened.
pi@raspberrypi:~/sbrpi $

« Last Edit: April 16, 2019, 03:30:58 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 684
Re: SB π
« Reply #160 on: April 16, 2019, 04:20:12 PM »
You're missing a lot more than just that.

In interface.c, make these changes:

UXLIBS: -lc

//#ifdef __DARWIN__
#if defined (__DARWIN__) || defined (__linux__)

Then rebuild using ./setup --module=sdbg


Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #161 on: April 16, 2019, 04:40:25 PM »
I made the changes you gave me but I'm still getting the same error.

Update:

I did a make -B in the SDBG extension module directory as the generated shared object in BIN date didn't change.

I'm not getting an error any longer but it doesn't seem to be connecting with the shelled SCRIBA running -i SDBG.


« Last Edit: April 16, 2019, 05:09:01 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #162 on: April 16, 2019, 05:39:14 PM »
The 6647 port wasn't enabled according to netstat so I enabled it with the following.

sudo apt-get install ufw
sudo ufw allow 6647
sudo ufw enable
sudo reboot


I don't get any error and the I can type stuff but no response from SDBG.

dbgcon.sb
Code: Script BASIC
  1. ' ScriptBasic Remote Console Debugger
  2.  
  3. cmdln = TRIM(COMMAND())
  4. IF cmdln = "" THEN
  5.   PRINT "Usage: dbgcon [prog2debug]\n"
  6.   END
  7. END IF
  8. exitcode = EXECUTE("/usr/local/bin/scriba -i sdbg " & cmdln,-1,PID)
  9. OPEN "127.0.0.1:6647" FOR SOCKET AS #1
  10. WHILE NOT EOF(1)
  11.   LINE INPUT #1, dbgs
  12.   IF dbgs = ".\n" THEN
  13.     PRINT "-> "
  14.     LINE INPUT dbgc
  15.     IF LCASE(CHOMP(dbgc)) = "h" THEN
  16. PRINT """h help
  17. s step one line
  18. S step one line, do not step into functions or subs
  19. o step until getting out of the current function
  20.  (if you stepped into but changed your mind)
  21. ? var  print the value of a variable
  22. u step one level up in the stack
  23. d step one level down in the stack (for variable printing)
  24. D step down in the stack to current execution depth
  25. G list all global variables
  26. L list all local variables
  27. l [n-m] list the source lines
  28. r [n] run to line n
  29. R [n] run to line n but do not stop in recursive function call
  30. b [n] set breakpoint on the line n or the current line
  31. B [n-m] remove breakpoints from lines
  32. q quit the program
  33. """
  34.     END IF
  35.     PRINT #1, dbgc
  36.     IF CHOMP(dbgc) = "q" THEN GOTO Done
  37.   ELSE
  38.     dbgcmd = CHOMP(dbgs)
  39. ' l - List Source
  40.    IF INSTR(dbgcmd,"Break-Point: ")<>undef THEN
  41.       p = INSTR(dbgcmd,"Break-Point: ")
  42.       IF MID(dbgcmd,p+13,1) = "0" THEN
  43.         PRINT " "
  44.       ELSE
  45.         PRINT "*"
  46.       END IF
  47.       GOTO IT
  48.     END IF
  49.     IF INSTR(dbgcmd,"Line-Number: ")<>undef THEN
  50.       p = INSTR(dbgcmd,"Line-Number: ")
  51.       PRINT FORMAT("%~[0000] ~",VAL(MID(dbgcmd,p+13)))
  52.       online = TRUE
  53.       GOTO IT
  54.     END IF
  55.     IF INSTR(dbgcmd,"Line: ")<>undef THEN
  56.       p = INSTR(dbgcmd,"Line: ")
  57.       IF online THEN
  58.         PRINT MID(dbgcmd,p+6),"\n"
  59.       ELSE
  60.         PRINT MID(dbgcmd,p),"\n"
  61.       END IF
  62.       online = FALSE
  63.       GOTO IT
  64.     END IF
  65.     IF INSTR(dbgcmd,"Global-Variable")<>undef THEN
  66.       p = INSTR(dbgcmd,"Global-Variable")
  67.       PRINT "G-Var" & MID(dbgcmd,p+15) & "\n"
  68.       GOTO IT
  69.     END IF
  70. ' Unprocessed out
  71.   PRINT dbgs
  72.   END IF
  73. IT:
  74. WEND
  75.  
  76. Done:
  77. PRINT #1,"q"
  78. CLOSE(1)
  79. PRINT "Debug session closed.\n"
  80. END
  81.  

testarray.sb
Code: Script BASIC
  1. i = 1
  2. d = .99
  3. s = "JRS"
  4. a[0,0] = 0
  5. a[0,1] = 123
  6. a[0,2] = 1.23
  7. a[0,3] = "One,Two,Three"
  8. a[1,0] = "Zero"
  9. a[1,1] = 321
  10. a[1,2] = 32.1
  11. a[1,3] = "Three,Two,One"
  12. PRINT "Done\n"
  13.  
« Last Edit: April 16, 2019, 05:41:55 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #163 on: April 17, 2019, 07:44:22 AM »
AIR,

I tried my old sdbg.so that use to work on an earlier version of Ubuntu and it is doing the same as the RPi version. I'm at a lost what has changed. It would be great to get the console mode debugger going as I spent a huge amount of time cleaning up that pre-processor.

Offline John

  • Forum Support / SB Dev
  • Posts: 2745
    • ScriptBasic Open Source Project
Re: SB π
« Reply #164 on: April 17, 2019, 08:40:05 AM »
AIR,

I was able to connect to the sdbg debugger pre-processor via telnet. This is a positive sign that the pre-processor is working.


pi@raspberrypi:~ $ telnet 127.0.0.1 6647
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Application: sbdbg 1.0
Version: 1.0
Source-File-Count: 1
Source-File: testarray.sb
Current-Line: 1
Current-Line: 1
.
l 1-
Break-Point: 0
Line-Number: 1
Line: i = 1
Break-Point: 0
Line-Number: 2
Line: d = .99
Break-Point: 0
Line-Number: 3
Line: s = "JRS"
Break-Point: 0
Line-Number: 4
Line: a[0,0] = 0
Break-Point: 0
Line-Number: 5
Line: a[0,1] = 123
Break-Point: 0
Line-Number: 6
Line: a[0,2] = 1.23
Break-Point: 0
Line-Number: 7
Line: a[0,3] = "One,Two,Three"
Break-Point: 0
Line-Number: 8
Line: a[1,0] = "Zero"
Break-Point: 0
Line-Number: 9
Line: a[1,1] = 321
Break-Point: 0
Line-Number: 10
Line: a[1,2] = 32.1
Break-Point: 0
Line-Number: 11
Line: a[1,3] = "Three,Two,One"
Break-Point: 0
Line-Number: 12
Line: PRINT "Done\n"
Current-Line: 1
.
r
Connection closed by foreign host.
pi@raspberrypi:~ $