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)

Warty 09 August 2020 06:38

Quote:

Originally Posted by bebbo (Post 1419264)
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.

Thanks Bebbo! It works like a charm now. I wrote a game without anything like this, with just VBCC, and it was pretty darn painful. Now I'm all juiced up to start a new project. I've got a bad feeling about this C128 game I've been working on for the past 6 months, which is currently at 95% complete...

Thanks for the cross chain, and also for the debugger. Seriously, magic.

activist 09 August 2020 23:00

Quote:

Originally Posted by bebbo (Post 1419265)
sounds dumb... but...create a .gdbinit file in your home folder

Have you an example .gdbinit file ?

Seems to work ok on command line.

e.g. On the target (amiga), type 'bgdbserver helloworld' I get 'Running GDB server on port 2345'.
Then on host (windows 7 64) type 'target remote localhost:2345'. Seems to connect. Says 'Remote debugging using localhost:2345'
At this point I can set break point ..b 18.
Or just type 'cont'.
I can then see it executing successfully on target.

So that's all fine. But Eclipse. Not sure..Windows version at least anyway.
A quick google on bing for gcc Eclipse stuck 'Launching Debug: (91%)' Starting Program: Configuring GDB seems a well known issue.


Also, no joy at all port 514.

e.g. on target if I type 'bgdbserver' I get 'Starting RSH server on port 514'.
on windows host cmdline type:
'bgdbserver helloworld'
then
'target remote localhost:514'
but just times out.

bebbo 10 August 2020 10:27

Quote:

Originally Posted by activist (Post 1419477)
Have you an example .gdbinit file ?

Seems to work ok on command line.

e.g. On the target (amiga), type 'bgdbserver helloworld' I get 'Running GDB server on port 2345'.
Then on host (windows 7 64) type 'target remote localhost:2345'. Seems to connect. Says 'Remote debugging using localhost:2345'
At this point I can set break point ..b 18.
Or just type 'cont'.
I can then see it executing successfully on target.

So that's all fine. But Eclipse. Not sure..Windows version at least anyway.
A quick google on bing for gcc Eclipse stuck 'Launching Debug: (91%)' Starting Program: Configuring GDB seems a well known issue.


Also, no joy at all port 514.

e.g. on target if I type 'bgdbserver' I get 'Starting RSH server on port 514'.
on windows host cmdline type:
'bgdbserver helloworld'
then
'target remote localhost:514'
but just times out.


an empty file should do it.


plus you have to configure that file in Eclipse with abolute path
in the Debug settings what gdbinit file to use. Set it in the preferences and it's there in new debug configurations.


I can debug with Eclipse 202006 in Windows now

felmur 22 November 2022 18:43

1 Attachment(s)
Hello,
I installed eclipse + toolchain-gcc scrupulously following Bebbo's instructions, to whom I thank him for the excellent tutorial.

It works very well in Eclipse and now I successfully compile the programs I write, testing them in FS-UAE and also on my amiga600.

Everything worked fine until I needed to pass parameters to the program via the command line.

I wrote this simple source:
Code:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const * const * argv) {
        printf("Number of arguments passed: %d\n",argc);
        for (int i=0; i<argc; i++){
                printf("Arg# %d: '%s'\n", i, argv[i]);
        }
        return EXIT_SUCCESS;
}

The code compiles perfectly, but when I try it in FS-UAE the parameters I pass via command line are not recognized. The value of argc appears to be correctly set, but it is also not possible to read the value of argv[0], which should contain the program name. Does anyone have any idea what I'm doing wrong?:banghead:banghead

hitchhikr 22 November 2022 20:58

I think you should use the -noixemul parameter.

felmur 22 November 2022 21:29

Quote:

Originally Posted by hitchhikr (Post 1577010)
I think you should use the -noixemul parameter.

Hi hitchhikr,

where i have to put this parameter?

Thank you.

hitchhikr 22 November 2022 21:31

In the gcc parameters. Dunno how it is done in eclipse but there's certainly a way to set extra params somewhere in the project data.

felmur 22 November 2022 21:39

1 Attachment(s)
Quote:

Originally Posted by hitchhikr (Post 1577024)
In the gcc parameters. Dunno how it is done in eclipse but there's certainly a way to set extra params somewhere in the project data.

oh yeah, IT WORKS. Thank you!

In Eclipse -> Project -> Properties, then configure linker as reported in the attacked image.

THANK YOU!

alkis 22 November 2022 23:32

for future reference and just in case you want to build for 1.3 kickstart then you have to replace -noixemul with -mcrt=nix13

felmur 26 November 2022 11:20

Quote:

Originally Posted by alkis (Post 1577059)
for future reference and just in case you want to build for 1.3 kickstart then you have to replace -noixemul with -mcrt=nix13

thanks.

I've a new problem now: compiling a source with MUI.

--> TRANSFERRED HERE: http://eab.abime.net/showthread.php?t=112625

bebbo 26 November 2022 20:38

wrong thread, isn't it?

Samurai_Crow 26 November 2022 22:49

Quote:

Originally Posted by bebbo (Post 1577840)
wrong thread, isn't it?

Yes. @felmur , start a new thread.

MartinW 19 April 2023 01:11

I don't know if I'm being thick, but I want to debug a program that makes a check at the start to ensure it has been run from workbench as it reads values from tool types. If I try and debug this with bgdbserver I can't because it has to be run from the command line. Is there a trick I'm missing here or is it just not possible?

Nightfox 06 May 2023 16:45

I can't seem to get it to work.

I'm running bgdbserver on my real amiga and used the command
Code:

bgdbserver program.exe
where program.exe is the program file. The server is happy and its listening at port 2345.

However when I go onto my MacBook and run
Code:

./m68k-amigaos-gdb /Volumes/repos/amigatest/program.exe
and then type in
Code:

target remote <ip address of amiga>:2345
gdb crashes with the following:

Code:

Remote debugging using 192.168.1.254:2345


Fatal signal: Segmentation fault: 11
----- Backtrace -----
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

[1]    38234 segmentation fault  ./m68k-amigaos-gdb /Volumes/repos/amigatest/program.exe

I get the same result in both macOS Apple Silicon and also on a Linux VM on my Intel MacBook

bebbo 06 May 2023 21:56

Quote:

Originally Posted by Nightfox (Post 1614549)
I can't seem to get it to work.
...
[1] 38234 segmentation fault ./m68k-amigaos-gdb /Volumes/repos/amigatest/program.exe
[/CODE]I get the same result in both macOS Apple Silicon and also on a Linux VM on my Intel MacBook


Feel free to file a bug at https://github.com/bebbo/binutils-gdb and provide enough details to make it reproducable.
(note that debugging using the amiga13.1 branch is not yet supported)


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

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

Page generated in 0.06155 seconds with 11 queries