FrontEnd GDB for freebasic

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

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Hi All

Well done VANYA.
Works without any problems in Linux 32, but have these errors in Linux 64.

Code: Select all

fbc -v -gen gcc -g -exx  -w all "Debug.bas" (in directory: /home/dinosaur/GDBFrontEnd)
FreeBASIC Compiler - Version 1.08.1 (2021-07-08), built for linux-x86_64 (64bit)
Copyright (C) 2004-2021 The FreeBASIC development team.
target:       linux-x86_64, x86-64, 64bit
backend:      gcc
compiling:    Debug.bas -o Debug.c (main module)
compiling C:  gcc -m64 -march=x86-64 -S -nostdlib -nostdinc -Wall -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-main -Werror-implicit-function-declaration -O0 -fno-strict-aliasing -frounding-math -fno-math-errno -fwrapv -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-format -g -masm=intel "Debug.c" -o "Debug.asm"
assembling:   as --64 "Debug.asm" -o "Debug.o"
linking:      ld -m elf_x86_64 -o "Debug" -dynamic-linker /lib64/ld-linux-x86-64.so.2 -T "/usr/local/bin/../lib/freebasic/linux-x86_64/fbextra.x" -L "/usr/local/bin/../lib/freebasic/linux-x86_64" -L "." -L "/usr/lib/gcc/x86_64-linux-gnu/7" "/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crt1.o" "/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o" "/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o" "/usr/local/bin/../lib/freebasic/linux-x86_64/fbrt0.o" "Debug.o" "-(" -lgtk-x11-2.0 -lgdk-x11-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgmodule-2.0 -lcairo -lpango-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -latk-1.0 -lz -lGL -lGLU -lwindow9 -lX11 -lscintilla -lfb -ltinfo -lm -ldl -lpthread -lgcc -lgcc_eh -lc "-)" "/usr/lib/gcc/x86_64-linux-gnu/7/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o"
Debug.o: In function `INIT_DEBUGING':
/home/dinosaur/GDBFrontEnd/Debug.bas:89: undefined reference to `DEINIT'
/home/dinosaur/GDBFrontEnd/Debug.bas:93: undefined reference to `LOAD_FILE'
/home/dinosaur/GDBFrontEnd/Debug.bas:95: undefined reference to `FILL_GLOBAL_VAR_LISTVIEW'
/home/dinosaur/GDBFrontEnd/Debug.bas:97: undefined reference to `FILL_PANEL'
/home/dinosaur/GDBFrontEnd/Debug.bas:109: undefined reference to `RESIZE_WIN'
/home/dinosaur/GDBFrontEnd/Debug.bas:119: undefined reference to `RESIZE_WIN'
Debug.o: In function `main':
/home/dinosaur/GDBFrontEnd/Debug.bas:127: undefined reference to `CREATE_MAIN_DIALOG'
/home/dinosaur/GDBFrontEnd/Debug.bas:198: undefined reference to `OPENFILEREQUESTEREXE'
/home/dinosaur/GDBFrontEnd/Debug.bas:205: undefined reference to `OPENFILEREQUESTEREXE'
/home/dinosaur/GDBFrontEnd/Debug.bas:226: undefined reference to `INFO_ALL_VARIABLES_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:232: undefined reference to `INFO_LOC_VARIABLES_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:244: undefined reference to `TIMER_DATA'
/home/dinosaur/GDBFrontEnd/Debug.bas:246: undefined reference to `RUN_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:250: undefined reference to `RUN_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:256: undefined reference to `CONTINUE_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:260: undefined reference to `STEP_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:264: undefined reference to `STEP_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:268: undefined reference to `KILL_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:276: undefined reference to `COMMAND_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:290: undefined reference to `RESIZE_WIN'
/home/dinosaur/GDBFrontEnd/Debug.bas:336: undefined reference to `DIALOG_CHOOSE_DEBUG_PATH'
/home/dinosaur/GDBFrontEnd/Debug.bas:374: undefined reference to `DIALOG_SET_VALUE'
/home/dinosaur/GDBFrontEnd/Debug.bas:412: undefined reference to `INFO_LOC_VARIABLES_DEBUG'
/home/dinosaur/GDBFrontEnd/Debug.bas:416: undefined reference to `INFO_ALL_VARIABLES_DEBUG'
linking failed: 'ld' terminated with exit code 1
Compilation failed.
Looks like a library missing but no error message to that affect.

Regards

EDIT: Sorry, same old mistake. I was loading only Debug.bas and expecting the includes to automatically include all other files.
Had to specifically nominate each file to be compiled.
All good now.

Especially impressed that I can see all values in Struct elements.
You have just exceeded the Gede debugger.
Once again well done.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

Hi ALL!

Minor fix, archive updated.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Hi All

VANYA, can you explain the purpose of the "repeats" statement in the struct elements as per example below.
I have just only copied one line as an example.

Code: Select all

struct 
  TARGET = '\000' <repeats 35 times>, "D:/HMI/Recipes/5KG.JVP\000\000\000", 
When I use Geany to search for this element in the source code , there are only about 7 matches.

Regards
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

Dinosaur wrote:Hi All

VANYA, can you explain the purpose of the "repeats" statement in the struct elements as per example below.
I have just only copied one line as an example.

Code: Select all

struct 
  TARGET = '\000' <repeats 35 times>, "D:/HMI/Recipes/5KG.JVP\000\000\000", 
When I use Geany to search for this element in the source code , there are only about 7 matches.

Regards
GDB thus shortens the output of the same values ​​in structures, arrays. In this case, the value of the zero character is repeated 35 times (following each other):

'\000' <repeats 35 times>
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

The program has been updated:

1) added memory dump window
2) added register window

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

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Hi VANYA

Thanks for the update.
I don't know if this was intentional, but when you open the Register window
and then step to the next line, the Register window minimizes.

I would have thought the ideal scenario was to be able to watch the registers change as you step through.

Otherwise I am very happy with your effort.

Regards
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

Dinosaur wrote:Hi VANYA

Thanks for the update.
I don't know if this was intentional, but when you open the Register window
and then step to the next line, the Register window minimizes.

I would have thought the ideal scenario was to be able to watch the registers change as you step through.

Otherwise I am very happy with your effort.

Regards
Hi Dinosaur!

1) I will make edits to better display the dialog boxes (they will always be above the main window). This is why I did a quick update window9 library.
2) auto-update (when tracing) of register information and memory dump is not expected (too expensive in terms of performance and not very stable). Information is transmitted through PIPE and when there is a lot of it, it may not come all at once from GDB and this gives rise to a bunch of bad things. So, updating registers and memory dump only on request (button press).
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Hi VANYA
2) auto-update (when tracing) of register information and memory dump is not expected (too expensive in terms of performance and not very stable). Information is transmitted through PIPE and when there is a lot of it, it may not come all at once from GDB and this gives rise to a bunch of bad things. So, updating registers and memory dump only on request (button press).
I only look at registers after specific instructions, then pressing an update button is half expected. So far I have not had any weird behaviour or hanging, which is a frequent occurrence with Gede.

Regards

EDIT: After updating Window9 libraries & .bi, it now works correctly.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

Dinosaur , I updated the archives yesterday (made the child windows always above the parent window). Whoever will build FrontEnd from source needs the latest version of window9. Unfortunately, I was unable to notify about the update last night.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Hi VANYA

Coincidently I downloaded the update during our afternoon (Australia) so got the latest.

Just one final question.(perhaps more Linux then your program)
How do I start the program maximised ? (full screen)

I have modified a command in Geany so that pressing the "Build the current file" icon opens the debug program with my project.
Pressing "Compile the current File" still just compiles the project.

Sometimes the Main.bas does not show , only the "Variable & Value" window shows content.
When I maximize the screen and reload the file it is fine.
Mind you this only happens once every so often.

Regards
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

Dinosaur wrote: Just one final question.(perhaps more Linux then your program)
How do I start the program maximised ? (full screen)
On Linux, the application must support this functionality. At the moment, this is not provided in the program. Perhaps there are some third-party utilities that can do this. By the way, are you asking about fullscreen mode or MAXIMITE mode? These are different modes. Fullscreen mode opens the window, removing the MENU and CAPTION (used more often for games).
Dinosaur wrote: I have modified a command in Geany so that pressing the "Build the current file" icon opens the debug program with my project.
Pressing "Compile the current File" still just compiles the project.
I do not use Geany, my editor is enough for me
Dinosaur wrote:Sometimes the Main.bas does not show , only the "Variable & Value" window shows content.
When I maximize the screen and reload the file it is fine.
Mind you this only happens once every so often.
I noticed this on a Windows system and only immediately after starting the system and loading the program for the first time. GDB is sending data very late and the data is out of normal formatting. Are you talking about the Windows version too?
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Hi VANYA

I am using Linux, both 32bit Debian and 64bit Linux Mint 20.
Although I have not confirmed the issue on Debian 32 bit.

I have managed to set a particular key in GTK to Maximize the window and it reduces once pressed again.
Having tried other options when starting the debug program, this was the final solution.

I know you are involved in many other projects, so I am happy to leave it like this and use it.

Once again many thanks for your effort on this.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

Dinosaur wrote:I am using Linux, both 32bit Debian and 64bit Linux Mint 20.
Although I have not confirmed the issue on Debian 32 bit.
Did I understand you correctly? You have a problem on Linux mint 20 (64-bit):

Sometimes the Main.bas does not show , only the "Variable & Value" window shows content.
When I maximize the screen and reload the file it is fine.
Mind you this only happens once every so often.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: FrontEnd GDB for freebasic

Post by Dinosaur »

Correct

EDIT: Let me know if you would like me to test something.

Regards

EDIT: Correction: Linux Mint 19.3 Cinnamon
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FrontEnd GDB for freebasic

Post by VANYA »

@Dinosaur

I have no problems on Linux.

Your help is required:

1) In function get_name_files_from_exe (file interface.bas) at the beginning of the function, write:

Code: Select all

print sBuf
2) compile Debug: fbc -exx Debug.bas debug_gui.bas dialogs.bas pipe.bas interface.bas

3) when an error appears, copy the result from the terminal and post it to me on the forum
Post Reply