English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 04 February 2020, 20:03   #61
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
Quote:
Originally Posted by bebbo View Post
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.
Attached Thumbnails
Click image for larger version

Name:	Amiga Debugging.jpg
Views:	215
Size:	433.9 KB
ID:	66094   Click image for larger version

Name:	m68k-amigaos-gdb.jpg
Views:	180
Size:	350.3 KB
ID:	66095  
JuanLuis is offline  
Old 04 February 2020, 21:03   #62
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by JuanLuis View Post
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
bebbo is offline  
Old 04 February 2020, 21:07   #63
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Would be nice to have the links for the gcc and gdb binaries in the first page.
tolkien is offline  
Old 04 February 2020, 23:34   #64
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
Quote:
Originally Posted by bebbo View Post
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 is offline  
Old 05 February 2020, 00:45   #65
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
I have recompiled bgdbserver from source code, and the result is the same as well.

I expectect suggestions.
JuanLuis is offline  
Old 05 February 2020, 08:32   #66
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by JuanLuis View Post
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?
* ...

Last edited by bebbo; 05 February 2020 at 09:42.
bebbo is offline  
Old 05 February 2020, 09:56   #67
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by bebbo View Post
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 is offline  
Old 06 February 2020, 18:37   #68
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by bebbo View Post
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.
bebbo is offline  
Old 06 February 2020, 18:38   #69
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
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.
JuanLuis is offline  
Old 06 February 2020, 19:45   #70
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by JuanLuis View Post
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.
bebbo is offline  
Old 17 May 2020, 13:13   #71
rocho08
Registered User
 
Join Date: May 2020
Location: Spain
Posts: 1
Unable to set-up the debugger on eclipse-cdt

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

Click image for larger version

Name:	bgdbserver_debug.png
Views:	274
Size:	7.2 KB
ID:	67369

Click image for larger version

Name:	eclipse_debug_conf_I.png
Views:	279
Size:	33.5 KB
ID:	67370

Click image for larger version

Name:	eclipse_debug_conf_II.png
Views:	273
Size:	7.1 KB
ID:	67371
rocho08 is offline  
Old 04 June 2020, 14:16   #72
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by rocho08 View Post
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.
bebbo is offline  
Old 25 June 2020, 00:04   #73
activist
Registered User
 
Join Date: May 2017
Location: Dublin Ireland
Posts: 46
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

Click image for larger version

Name:	shell.jpg
Views:	319
Size:	81.5 KB
ID:	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
activist is offline  
Old 26 June 2020, 13:38   #74
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by activist View Post
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?

Last edited by bebbo; 26 June 2020 at 14:44.
bebbo is offline  
Old 27 June 2020, 12:42   #75
walkero
Registered User
 
walkero's Avatar
 
Join Date: May 2012
Location: Dublin/Ireland
Posts: 358
Great stuff here guys. May I ask if it is possible to use it with vbcc as well?
walkero is offline  
Old 29 June 2020, 12:43   #76
activist
Registered User
 
Join Date: May 2017
Location: Dublin Ireland
Posts: 46
Quote:
Originally Posted by bebbo View Post
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 View Post
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
activist is offline  
Old 04 July 2020, 10:54   #77
Tom_Goblins
Registered User
 
Join Date: Dec 2018
Location: Seattle
Posts: 13
@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
[ Show youtube player ]
Tom_Goblins is offline  
Old 08 August 2020, 17:47   #78
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
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?
Attached Thumbnails
Click image for larger version

Name:	eclipse_bebbo_config_error.png
Views:	117
Size:	77.3 KB
ID:	68407  
Warty is offline  
Old 08 August 2020, 23:44   #79
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by Warty View Post
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 is offline  
Old 08 August 2020, 23:45   #80
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by bebbo View Post
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
bebbo is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Csound 3.481 on m68k squidbass Amiga scene 5 21 July 2013 21:29
Rewriting m68k code RobSis Coders. Tutorials 1 26 January 2013 16:15
Remote GDB debugging copse support.WinUAE 6 31 August 2011 01:05
m68k-amigaos-ld.exe bug ? FrenchShark Coders. General 2 30 November 2009 09:54
Shorten ported to AmigaOS m68k and WarpOS Paul News 0 20 August 2006 12:05

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:01.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18457 seconds with 14 queries