English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. C/C++ (https://eab.abime.net/forumdisplay.php?f=118)
-   -   m68k-amigaos-gdb (https://eab.abime.net/showthread.php?t=93055)

JuanLuis 04 February 2020 20:03

2 Attachment(s)
Quote:

Originally Posted by bebbo (Post 1376458)
learn gdb - first lesson: how to set a break point.
watch closely:
Code:

stefan@ZETRA:~/amiga-gcc/tickets/eab7$ m68k-amigaos-g++ -g test7.c -o test7
stefan@ZETRA:~/amiga-gcc/tickets/eab7$ m68k-amigaos-strip test7 -o /mnt/c/Amiga/MyWB31/Develop/prj/test/test7



WINUAE: bgdbserver test7



stefan@ZETRA:~/amiga-gcc/tickets/eab7$ m68k-amigaos-gdb test7
GNU gdb (GDB) 8.3.50.200102-195310-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=m68k-amigaos".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from test7...
(gdb) target remote :2345
Remote debugging using :2345
warning: Target reported unsupported offsets: Text=4062b0e0;Data=4059fb50;Bss=4059ff68
0x4062b0e0 in _stext ()
(gdb) list
1      #include <stdio.h>
2
3      int main(int argc, char** argv) {
4          for (int i = 0; i < argc; i++)
5              printf("Arg #%d -> \"%s\"\n", i, argv[i]);
6                     
7          return 0;
8      }
9
(gdb) b main:4
Breakpoint 1 at 0x4062b316: file test7.c, line 4.
(gdb) c
Continuing.

Breakpoint 1, main (argc=1, argv=0x4059ff68) at test7.c:4
4          for (int i = 0; i < argc; i++)
(gdb) c
Continuing.

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb)


so use
b main:4
instead of
b 4

Same thing happens. Please, take a look on the attached pictures. I'm using your precompiled bgdbserver from your page:
https://github.com/bebbo/bgdbserver

Mi bdbserver executable has 20.888 bytes. Its sha256 is:
$ sha256sum bgdbserver
d327eb58fc4f0c537ded73a54159a157c84d6ffb4cd0a2837a2ffb12b957cdd0 *bgdbserver


Should I compile bgdbserver for amiga from your source code instead of using your precompiled version?

Other suspicious thing is that argument values are wrong. When I enable -g on linking is like -noixemul was ignored. The problem I was talking about on the other thread appears again.

Do you think my m68k-gdb has a problem?

Am I doing something else wrong?

Thanks.

bebbo 04 February 2020 21:03

Quote:

Originally Posted by JuanLuis (Post 1376563)
Same thing happens. Please, take a look on the attached pictures. I'm using your precompiled bgdbserver from your page:
https://github.com/bebbo/bgdbserver


uuups - I updated that binary and some more places...



/sorry

tolkien 04 February 2020 21:07

Would be nice to have the links for the gcc and gdb binaries in the first page.

JuanLuis 04 February 2020 23:34

Quote:

Originally Posted by bebbo (Post 1376590)
uuups - I updated that binary and some more places...



/sorry

Don't worry Bebbo. Then, what must I do?

I'll try to compile your gdb source code meanwhile. Tomorrow I'll say to you whether I was successful.

JuanLuis 05 February 2020 00:45

I have recompiled bgdbserver from source code, and the result is the same as well.

I expectect suggestions.

bebbo 05 February 2020 08:32

Quote:

Originally Posted by JuanLuis (Post 1376644)
I have recompiled bgdbserver from source code, and the result is the same as well.

I expectect suggestions.


try wsl (ubuntu) together with VcXsrv instead of cygwin?

EDIT:
try different WinUAE configurations:

* CPU?
* Kickstart?
* ...

bebbo 05 February 2020 09:56

Quote:

Originally Posted by bebbo (Post 1376675)
try wsl (ubuntu) together with VcXsrv instead of cygwin?

EDIT:
try different WinUAE configurations:

* CPU?
* Kickstart?
* ...


WINUAE: if the CPU is 68020 also enable 68882

bebbo 06 February 2020 18:37

Quote:

Originally Posted by bebbo (Post 1376697)
WINUAE: if the CPU is 68020 also enable 68882


Since the memory is patched correctly but the trap handler is not invoked, it looks like a bug in WinUAE.


=> ask there for support.

JuanLuis 06 February 2020 18:38

The configuration I use to use is an A1200 with 68882 coprocessor. Anyway, the program I'm testing is very simple and it doesn't use floating point instructions. I don't think that's the source of the problem.

I have a Debian distribution on my computer. I think Ubuntu is a distribution based on Debian. Theorically, it should be equivalent. I have to prepare the environment (compiling your compiler, etc.). I need a little time.

I'll tell you the results.

Thanks.

bebbo 06 February 2020 19:45

Quote:

Originally Posted by JuanLuis (Post 1377041)
The configuration I use to use is an A1200 with 68882 coprocessor. Anyway, the program I'm testing is very simple and it doesn't use floating point instructions. I don't think that's the source of the problem.

I have a Debian distribution on my computer. I think Ubuntu is a distribution based on Debian. Theorically, it should be equivalent. I have to prepare the environment (compiling your compiler, etc.). I need a little time.

I'll tell you the results.

Thanks.


Since the behaviour changes if only the WinUAE config is changed, it's a Kickstart or a WinUAE issue.



Good luck hunting elsewhere.

rocho08 17 May 2020 13:13

Unable to set-up the debugger on eclipse-cdt
 
3 Attachment(s)
First of all, thank you very much for such a big contributuion!

I manage to build last versions from both m68k-amigaos-* compiler tools and bgdbserver. I can debug manually launching m68k-amigaos-gdb and bgdbserver, nevertheless I'm having trouble to debug using eclipse-cdt in Windows 10.

Eclipse-CDT version:

Version: 2020-03 (4.15.0)
Build id: 20200313-1211
With patched telnet core plugin -> org.eclipse.remote.telnet.core_1.0.0.201803121903.jar

The build output in eclipse seems correct:

12:20:45 **** Build of configuration Debug for project hellowamiga ****
make all
Building file: ../src/hellowamiga.c
Invoking: Cross GCC Compiler
m68k-amigaos-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/hellowamiga.d" -MT"src/hellowamiga.o" -o "src/hellowamiga.o" "../src/hellowamiga.c"
Finished building: ../src/hellowamiga.c

Building target: hellowamiga
Invoking: Cross GCC Linker
m68k-amigaos-gcc -g -o "hellowamiga" ./src/hellowamiga.o
Finished building target: hellowamiga

/usr/bin/make --no-print-directory post-build
Copy the executable to the amiga emulator shared drive
cp hellowamiga C:\UAE-PC


In WinUAE, I change to the folder where both the bgdbserver and the app binary are located:

cd PC:
bgdbserver


But when I start the debug command in eclipse, it connects to the amiga host, but never finishes (it gets blocked at 89%):


Process hellowamiga created; pid = 1
Listening on port 2345
Launching hellowamiga Debug 89%


In see in WinUAE that a connection has been started (see attachements).

In the remote absolute file path section of the eclipse debug configuration, I tried both with relative path "hellowamiga" and absolute "PC:hellowamiga"; but without any luck.

Any idea about how to fix this?

Thanks in advance

Attachment 67369

Attachment 67370

Attachment 67371

bebbo 04 June 2020 14:16

Quote:

Originally Posted by rocho08 (Post 1400434)
First of all, thank you very much for such a big contributuion!

I manage to build last versions from both m68k-amigaos-* compiler tools and bgdbserver. I can debug manually launching m68k-amigaos-gdb and bgdbserver, nevertheless I'm having trouble to debug using eclipse-cdt in Windows 10.

Eclipse-CDT version:

Version: 2020-03 (4.15.0)
Build id: 20200313-1211
With patched telnet core plugin -> org.eclipse.remote.telnet.core_1.0.0.201803121903.jar

The build output in eclipse seems correct:

12:20:45 **** Build of configuration Debug for project hellowamiga ****
make all
Building file: ../src/hellowamiga.c
Invoking: Cross GCC Compiler
m68k-amigaos-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/hellowamiga.d" -MT"src/hellowamiga.o" -o "src/hellowamiga.o" "../src/hellowamiga.c"
Finished building: ../src/hellowamiga.c

Building target: hellowamiga
Invoking: Cross GCC Linker
m68k-amigaos-gcc -g -o "hellowamiga" ./src/hellowamiga.o
Finished building target: hellowamiga

/usr/bin/make --no-print-directory post-build
Copy the executable to the amiga emulator shared drive
cp hellowamiga C:\UAE-PC


In WinUAE, I change to the folder where both the bgdbserver and the app binary are located:

cd PC:
bgdbserver


But when I start the debug command in eclipse, it connects to the amiga host, but never finishes (it gets blocked at 89%):


Process hellowamiga created; pid = 1
Listening on port 2345
Launching hellowamiga Debug 89%


In see in WinUAE that a connection has been started (see attachements).

In the remote absolute file path section of the eclipse debug configuration, I tried both with relative path "hellowamiga" and absolute "PC:hellowamiga"; but without any luck.

Any idea about how to fix this?

Thanks in advance

Attachment 67369

Attachment 67370

Attachment 67371


My guess is that you are having a newer plugin installed. So if you copy the
Code:

org.eclipse.remote.telnet.core_1.0.0.201803121903.jar
plugin into the plugins folder, ensure that there is no newer (different) version of the same plugin. E.g. if there is a
Code:

org.eclipse.remote.telnet.core_1.0.0.201909031456.jar
plugin, remove that newer version, since the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=529429 is still not fixed.

activist 25 June 2020 00:04

1 Attachment(s)
I realise this is not stackoverflow.com but getting same as @rocho08 trying to debug the Hello World ANSI C Project on windows 7 64-bit.

Debug seems to start well:

Process helloworld created; pid = 1
Listening on port 2345

Attachment 67955

Status on bottom right in Eclipse says : 'Launching helloworld Debug 89%'. But that's as far as goes. Doesn't hit breakpoint.

The (only) telnet plugin is:
org.eclipse.remote.telnet.core_1.0.0.201803121903.jar
which have overwrote with the patched one.

Eclipse IDE for C/C++ Developers
Version: 2019-12 (4.14.0)
Build id: 20191212-1212

bgdbserver v1.0
winuae 4.3.0 64-bit

Winuae version maybe ?

No problems compiling,building or copying the built file to Amiga share folder (the folder I run bgdbserver)
Will play about with it, as it does seems really good. Many thanks

bebbo 26 June 2020 13:38

Quote:

Originally Posted by activist (Post 1409864)
I realise this is not stackoverflow.com but getting same as @rocho08 trying to debug the Hello World ANSI C Project on windows 7 64-bit.

Debug seems to start well:

Process helloworld created; pid = 1
Listening on port 2345

Attachment 67955

Status on bottom right in Eclipse says : 'Launching helloworld Debug 89%'. But that's as far as goes. Doesn't hit breakpoint.

The (only) telnet plugin is:
org.eclipse.remote.telnet.core_1.0.0.201803121903.jar
which have overwrote with the patched one.

Eclipse IDE for C/C++ Developers
Version: 2019-12 (4.14.0)
Build id: 20191212-1212

bgdbserver v1.0
winuae 4.3.0 64-bit

Winuae version maybe ?

No problems compiling,building or copying the built file to Amiga share folder (the folder I run bgdbserver)
Will play about with it, as it does seems really good. Many thanks


Your telnet plugin is working, your program gets started remotely.


Does your program run without debugger? And is it really the same as your local version?

walkero 27 June 2020 12:42

Great stuff here guys. May I ask if it is possible to use it with vbcc as well?

activist 29 June 2020 12:43

Quote:

Originally Posted by bebbo (Post 1410096)
Does your program run without debugger?

No. When I start the debug server on Amiga and then, from Eclipse, select Run/Run History/<my remote application debug profile> it says:

'Connection closed by foreign host.'

Excuse ignorance again but should the executable launch and run remotely (if bgdbserver is running) ? Does Eclipse build configuration make any difference (Debug or Release) ?

helloworld runs fine if execute it manually on the Amiga.


Quote:

Originally Posted by bebbo (Post 1410096)
And is it really the same as your local version?

Yes. definitely. Checked the dates. If I delete the built helloworld, then 'Build All' the file re-appears in the test folder.

Does the debugging have to be done on the System: (dh0) volume by any chance? My test folder is a shared folder from windows mounted as dh1.
There are only two files in the Test folder: bgdbserver and helloworld

Tom_Goblins 04 July 2020 10:54

@bebbo, to give you good news, everything I am doing with your GCC is working like a charm. I have also GDB working through VSCode on windows and I am not having many issues.

I have debugged some long stuff beyond hello world and it helped me a lot, but I use logs mostly.

Some of my issues and pain with bgdbserver was because my application was not system friendly, but not it is.

Take a look at what I could do with your hard work, Thanks a lot!

This is targeting a stock 1200
https://www.youtube.com/watch?v=ckUu...ature=youtu.be

Warty 08 August 2020 17:47

1 Attachment(s)
First off, thanks for the cross chain and for this debugger!

I have hit a problem in an area I didn't expect: Eclipse.

I have the cross chain working (can compile 1.3 and 3.x apps).

But for this step of the setup instructions:

Quote:

2. Select Help -> Install New Software ... then press [Add...] then enter "BebboSoft Tools" as name and "https://bebbosoft.de/updatesite" as location.
3. Unselect [Group Items by Category], Select "Amiga CDT Integration" (unselect 'Contact all update sites...') and press [Next], [Next], accept the license and [Finish]. Finally click "Install anyway".
On the first "Next" in step 3, you it gives a bunch of messages along the lines of "not working, trying other alternatives, this make take a while". It seems to have gone through 15 "things", but then I get an error screen (see attachment) that says it won't be installing it. (and it doesn't).

Looking at the update site xml:
<category-def label="Amiga CDT Integration" name="Amiga CDT Integration" version="1.0.0">
<description>
This feature adds the ability to remote debug Amiga programs build with Bebbo's amiga-gcc.
</description>
</category-def>
<feature id="de.bb.eclipse.cdt-amiga.feature" url="features/de.bb.eclipse.cdt-amiga.feature-1.0.0-SNAPSHOT.jar" version="1.0.0">
<category id="Amiga CDT Integration"/>
</feature>


Maybe that 1.0.0 snapshot is no longer available? Newer version maybe?

bebbo 08 August 2020 23:44

Quote:

Originally Posted by Warty (Post 1419181)
First off, thanks for the cross chain and for this debugger!

I have hit a problem in an area I didn't expect: Eclipse.

I have the cross chain working (can compile 1.3 and 3.x apps).

But for this step of the setup instructions:



On the first "Next" in step 3, you it gives a bunch of messages along the lines of "not working, trying other alternatives, this make take a while". It seems to have gone through 15 "things", but then I get an error screen (see attachment) that says it won't be installing it. (and it doesn't).

Looking at the update site xml:
<category-def label="Amiga CDT Integration" name="Amiga CDT Integration" version="1.0.0">
<description>
This feature adds the ability to remote debug Amiga programs build with Bebbo's amiga-gcc.
</description>
</category-def>
<feature id="de.bb.eclipse.cdt-amiga.feature" url="features/de.bb.eclipse.cdt-amiga.feature-1.0.0-SNAPSHOT.jar" version="1.0.0">
<category id="Amiga CDT Integration"/>
</feature>


Maybe that 1.0.0 snapshot is no longer available? Newer version maybe?


The installation failure is not related to that minor issue. Workaround:


Install 2019-12, install Amiga-CDT and perform an update -> you get 2020-06.

bebbo 08 August 2020 23:45

Quote:

Originally Posted by bebbo (Post 1410096)
Your telnet plugin is working, your program gets started remotely.


Does your program run without debugger? And is it really the same as your local version?




sounds dumb... but...


create a .gdbinit file in your home folder


All times are GMT +2. The time now is 16:00.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05319 seconds with 11 queries