FB debugger : 3.02 32/64 BIT WDS/LNX..... (2023/07/05)

User projects written in or related to FreeBASIC.
Post Reply
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi Sarg

Using your keys.bi and window9.bi solved all the compile errors.
Then had to copy the buttons folder to the source folder. (path in window9.bi is from project folder)

Now I just have to chase down missing libraries.
ld: cannot find -lgtk-x11-2.0
ld: cannot find -lgdk-x11-2.0
ld: cannot find -lgio-2.0
ld: cannot find -lgobject-2.0
ld: cannot find -lglib-2.0
ld: cannot find -lgmodule-2.0
ld: cannot find -lcairo
ld: cannot find -lpango-1.0
ld: cannot find -lgdk_pixbuf-2.0
ld: cannot find -lpangocairo-1.0
ld: cannot find -latk-1.0
ld: cannot find -lz
ld: cannot find -lGLU
ld: cannot find -lscintilla
linking failed: 'ld' terminated with exit code 1
Compilation failed.
Regards
Edit: You must have made a few links to other libraries, as some of these are not available but included in others.
When I try others, Mint 19.3 tells me I already have the latest. ?

EDIT: Resolved all except lscintilla.so which when installed creates an error when starting program:
./fbdebugger_new: error while loading shared libraries: libscintilla.so: cannot open shared object file: No such file or directory
I even changed Window9.bi to #define __USE_GTK3__ which was remmed out, but to no avail.
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

Hi Dinosaur,

Thank you for your efforts.
Dinosaur wrote:EDIT: Resolved all except lscintilla.so which when installed creates an error when starting program:
Hard to find libscintilla maybe doesn't exists anymore. You should be forced to compile your own version.
As a last resort use provided lib and put it in the folder of fbdebugger.
Dinosaur wrote:Edit: You must have made a few links to other libraries, as some of these are not available but included in others.
When I try others, Mint 19.3 tells me I already have the latest. ?
I'm sorry but they are needed by window9 and as I'm not very comfortable with Linux' stuff not sure I'll give right advices.
Maybe a link to window9 page.

The very last version : https://users.freebasic-portal.de/sarg/ ... inux64.zip
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi SARG

I have tried the following:
Used your libscintilla.so and put it into the source folder.
window9.bi has ''#define __USE_GTK3__ remmed out.
Compiled Debugger OK.
Run Debugger:
./fbdebugger_new: error while loading shared libraries: libscintilla.so: cannot open shared object file: No such file or directory

Deleted all instances of libscintilla.so
Compiled library from source with "make "
copied library to source
Compiled Debugger OK
Run Debugger;
same error as before.

Deleted all instances of libscintilla.so again.
Compiled library from source with "make GTK3=1"
window9.bi has #define __USE_GTK3__ enabled
Compiled library from source with "make GTK3=1"
copied library to source
Compiled Debugger OK
Run Debugger:
same error as before.

All trials compiled OK, meaning that the one and only library was found and used.
So, the error must not be that it can't find the library, but can't run it.
The issue with name change from libscintilla.so to -lscintilla.so has always confused me.
Don't know where to go from here.???

Regards

EDIT: Tried the following.
Using your fbdebugger_new and your libscintilla.so with the following command at the prompt:
sudo LD_LIBRARY_PATH="home/dinosaur/fbdebugger/libscintilla.so" ./fbdebugger_new
same result
./fbdebugger_new: error while loading shared libraries: libscintilla.so: cannot open shared object file: No such file or directory
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by VANYA »

Dinosaur wrote: EDIT: Tried the following.
Using your fbdebugger_new and your libscintilla.so with the following command at the prompt:
sudo LD_LIBRARY_PATH="home/dinosaur/fbdebugger/libscintilla.so" ./fbdebugger_new
same result
./fbdebugger_new: error while loading shared libraries: libscintilla.so: cannot open shared object file: No such file or directory
Try this:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dinosaur/fbdebugger/ ; ./fbdebugger_new
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi All

VANYA, thanks for your input, but again to no avail.
Contents of folder:
ls
buttons fbdebugger_new libscintilla.so scintilla.a source
Running your suggestion from that folder.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dinosaur/fbdebugger/ ; ./fbdebugger_new
./fbdebugger_new: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
Regards
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by VANYA »

Dinosaur wrote:Hi All

VANYA, thanks for your input, but again to no avail.
Contents of folder:
ls
buttons fbdebugger_new libscintilla.so scintilla.a source
Running your suggestion from that folder.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dinosaur/fbdebugger/ ; ./fbdebugger_new
./fbdebugger_new: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
Regards
There is a result. Now the program sees the libscintilla.so library, but the message says that libtinfo.so.6 is missing on the computer. Install this library.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi All

I was seeing the error line so many times, that this time I didn't even read it. MISTAKE

But "installing" that library is not so straight forward.

Will perservere.

Regards

EDIT: First to show it is there.
dinosaur@dinosaur-GA-MA78LMT-S2:~/FBDebugger$ ls
buttons fbdebugger_new libscintilla.so libtinfo.so.6 scintilla.a source
Then run same as before.
dinosaur@dinosaur-GA-MA78LMT-S2:~/FBDebugger$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dinosaur/fbdebugger/ ; ./fbdebugger_new
./fbdebugger_new: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by VANYA »

Dinosaur wrote:Hi All

I was seeing the error line so many times, that this time I didn't even read it. MISTAKE

But "installing" that library is not so straight forward.

Will perservere.

Regards
Are you running the compiled fbdebugger file from SARG? SARG probably has a newer version of Linux.
Try compiling fbdebugger yourself.
buttons fbdebugger_new libscintilla.so libtinfo.so.6 scintilla.a source
remove scintilla.a, it is not needed as you are using libscintilla.so

also try to take libscintilla.so from the archive: https://sourceforge.net/projects/fronte ... sic/files/
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi All

VANYA, finally got the program to fire up.
I must admit going to the dentist is less painful.
For the life of me, I can't understand after so many years of Linux we still have to put up
with generic error messages like:
error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
Is there an error in the library, OR is it missing, OR is the loading faulty, where is the option to get an expanded result.
If on the hundreds of computerised machines that I have manufactured all over the world, had messages like that, I would have gone broke.

OK, my blood pressure is back down now.

Compiling fbdebugger_new and then placing it in the source folder allowed the program to run.
I haven't tried to debug anything, BUT I need to try and bring the installation back to something resembling
a standard Linux application.

So I will attempt that first.
Many thanks for your help.

Regards
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi All

SARGE, I now have the debugger running (thank you VANYA) and would like to highlight initial impressions "problem ?".

Because all of my projects are 32 bit, the current project is the first 64bit on this system.
That means that there will be problems on my side (like not having folders where I expect them)
However, that will test the debugger and hopefully give me error messages indicating the problem.

Can't seem to expand the source code window by dragging the edge.
Set a break point , but then can't see a "Run to Break point"
When I run program to "Run to Exit" I expect it to stop on the break point with a high lighted bar, but from the GUI it seems to just grey out the buttons and sit there.

EDIT: Same happens if I run to cursor. A red round circle appears, but stepping buttons are still greyed out.

Regards
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

Hi Dinosaur, VANYA,

First of all, many thanks to VANYA :-)

@Dinosaur
Sorry for all the problems you met and fortunately solved.

Experiment with a small program so you'll better understand how things are working in Fbdebugger.

At the bottom left corner there is a status information so you should see the state of fbdebugger (waiting, running debuggee).
Except when using 'step by step', buttons are disabled the only button enabled, 'halt', allows to stop at any time.
Run To Exit or Run to Cursor let the debuggee running until it meets a BP. So maybe the BP is never reached.
Another explanation : fbdebugger can't correctely debug if you compiled using several modules (.o not .bas). It's a point I have to work on.

Expansion (source code and other tabs) is only in height. I can add expansion in width. GUI is not the hardest part....
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi SARG

The program hangs on this code

Code: Select all

    '-----------------------------------
    Dim as String s , Chrs
    Dim as Long PF = FreeFile
    Open pipe "echo $HOME" For Input As #PF 'get Home path to link all others.
    Do Until Eof(PF)        'HANGS HERE
        Input #PF, Chrs
        s += Chrs
    Loop
    Close #PF
    Paths.Root = s + "/HMI/"
    If Debug.PrintFlag = 1 Then Print Paths.Root
    '-----------------------------------
Regards
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

Hi Dinosaur,

In dbg_linux.bas search 'case SIGCHLD' and add the line as marked below.
I did a test with the snippet you posted (removing useless things) and it does not anymore hang.

Code: Select all

case SIGCHLD
	ptrace(PTRACE_GETREGS, thread(threadcur).id, NULL, @regs)
	print "sigchld=";hex(regs.xip)
	dim as tsiginfo siginfo
	ptrace(PTRACE_GETSIGINFO, thread(threadcur).id, NULL, @siginfo)
	print "siginfo=";siginfo.si_signo, siginfo.si_code, siginfo.si_errno,hex(siginfo.si_addr),siginfo.dummy(0),siginfo.dummy(1)
	
	ptrace(PTRACE_CONT,thread(threadnb).id,0,0) ''<-------------------------------------------- add this line
	
case else
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by Dinosaur »

Hi SARGE

That fixed that issue.

Firstly you should note that the program I am testing works aside from the Debugger.
On one of the lines I call a library routine:

Code: Select all

    InitCgui(1024,768,16)               ' set to full screen
No point stepping through it, so put BP on next instruction.
When it enters the library a small window pops up with:
Previous Thread 5067 changed by 5069
Continue with the new one ? No/Yes
Pressing Yes draws the screen, and then when it exits the library:
Previous Thread 5067 changed by 5070
Continue with the new one ? No/Yes
Pressing Yes or No will change the debugger with "Running to XOP" allowing Termination of program.
The problem is, the next instruction is never executed, almost like we are busy in another thread ??

Regards
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.98.1 32/64 BIT ..... (2021/01/30)

Post by SARG »

Hi Dinosaur,

My username is SARG not SARGE :-) but it doesn't matter.

In the current Fbdebugger version only one thread can run at a time.
Switch between the threads in thread tab by selecting a thread and using the menu option 'Select next thread to be executed'

If it's possible send me the source code. I guess there are many cases I didn't think and multi-threading is a tricky thing.
Post Reply