Click Here
home features news forums classifieds faqs links search
6155 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
22 crawler(s) on-line.
 95 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!

/  Forum Index
   /  Amiga Development
      /  Brief questions about Amiga and GDB
Register To Post

Goto page ( 1 | 2 Next Page )
PosterThread
Wanderer 
Brief questions about Amiga and GDB
Posted on 2-Mar-2013 10:32:25
#1 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

I want to debug a C/C++ program on Amiga. It should be command line based, since I want to use it as a source level debugger in my IDE.

The platform I am working on is AmigaO3.9 on WinUAE.

I am using GCC 2.95.3 if that matters.

First question: does that matter?
Do I need a specific GDB verison given a specific GCC, or is it (within reasonable boundaries) free to choose.
In Aminet I found GDB 4.16 http://aminet.net/package/dev/gg/gdb-bin
Will that work with GCC 2.95.3, or will I need GCC4.x?

Second question:
Does GDB need an MMU? Is my project doomed because its WinUAE+JIT based (no MMU with JIT)?

Third question:
Is this portable to other Platforms (OS4, MOS, AROS), by exchanging the GCC+GDB binaries, but keeping the command line calls with their parameters as-is?

Last question:
Is there an alternative that works better than GCC+GDB?

Last edited by Wanderer on 02-Mar-2013 at 04:10 PM.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 7-Mar-2013 14:25:58
#2 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@Wanderer
anyone?

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: Brief questions about Amiga and GDB
Posted on 7-Mar-2013 19:07:58
#3 ]
Elite Member
Joined: 9-Jun-2004
Posts: 13047
From: Norway

@Wanderer

I skip the first questions I don't know, I do not make programs under classic AmigaOS3.x anymore.

I think you need MMU.

You need to compile all .c files whit -ggdb option to get debug symbols, this includes individually linked .o files.

Quote:
Third question:
Is this portable to other Platforms (OS4, MOS, AROS), by exchanging the GCC+GDB binaries, but keeping the command line calls with their parameters as-is?


AmigaOS4 uses GCC, and GDB works, GDB works whit ELF PowerPC native binaries, I have no idea if GDB for OS4.1 can debug any other format (Hunk 680x0).

I always start debuging using

gdb "my_elf_exe_file_with_gdb_debug_symbols"

then I press r and enter, to start program or set break points and press r.

Quote:
Last question:
Is there an alternative that works better than GCC+GDB?


On AmigaOS4 yes db101, on AmigaOS3.x I don't know.

Last edited by NutsAboutAmiga on 07-Mar-2013 at 07:14 PM.
Last edited by NutsAboutAmiga on 07-Mar-2013 at 07:13 PM.
Last edited by NutsAboutAmiga on 07-Mar-2013 at 07:10 PM.

_________________
http://lifeofliveforit.blogspot.no/
Facebook::LiveForIt Software for AmigaOS

 Status: Offline
Profile     Report this post  
ChaosLord 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 3:32:13
#4 ]
Cult Member
Joined: 4-Apr-2005
Posts: 782
From: Houston, Texas USA

@Wanderer

If the program is written in C then the SASC debugger is massively better than GDB.

_________________
Wanna try a wonderfull magical Amiga strategy game?
Total Chaos AGA

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 9:09:21
#5 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@ChaosLord

I need a debugger that runs in background. The visualization (sourcecode etc.) is done on my side. It should also be free software.

Why is the SASC debugger better? Can it debug GCC executables?

It is still not clear to me if MMU is required.That would be sadly a nogo. How was debugging done on Classic Amigas without MMU?

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
olegil 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 10:06:05
#6 ]
Elite Member
Joined: 22-Aug-2003
Posts: 5900
From: Work

@Wanderer

Quote:

Wanderer wrote:

It is still not clear to me if MMU is required.That would be sadly a nogo. How was debugging done on Classic Amigas without MMU?


Debugging was not done on classic Amigas. Back then, men were men and horses were women. Backup was something we had heard of but couldn't get to work. And things cost less. Except for things that cost more.

_________________
This weeks pet peeve:
Using "voltage" instead of "potential", which leads to inventing new words like "amperage" instead of "current" (I, measured in A) or possible "charge" (amperehours, Ah or Coulomb, C). Sometimes I don't even know what people mean.

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 11:19:39
#7 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@olegil

I tried two version of gdb, and one crashes on breakpoints with "uninitialized trap vector", the other one says "Don't know how to run. Try "help target".".
Hm...

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
ChaosLord 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 12:19:26
#8 ]
Cult Member
Joined: 4-Apr-2005
Posts: 782
From: Houston, Texas USA

@Wanderer

Quote:

Wanderer wrote:
@ChaosLord

Why is the SASC debugger better?

It has a gazillion features.

It lets u see your C source code and/or your asm source code simultaneously as u step over the code.

It actually works.

It can remotely source debug another machine across the serial port. So if u have a program that is crashing and burning the whole Amiga this is really powerful.

As many breakpoints as your heart desires.

Watch as many vars as you want, but this can be really slow so I never watch more than a couple of suspicious vars at once.

A gazillion other features.


Quote:

Can it debug GCC executables?

Hell no.


Quote:

It is still not clear to me if MMU is required.That would be sadly a nogo. How was debugging done on Classic Amigas without MMU?

I never really used it on anything without an MMU. But AFAIK u only need the MMU if u want the debugger to automatically stop every time you get an enforcer hit (MuGuardianAngel) and place the cursor on the offending line of C code. It is MuGuardianAngel that needs the MMU.

AFAIK for "normal" debugging u don't need it. I can't imagine why u would need an MMU to do regular simple debugging.


To be blunt:
If u are not using SASC debugger for C projects then u just are not taking things seriously and your progress will be much slower than it should be.

If u are not using MuGuardianAngel then you are not taking things seriously and your progress will be much slower than it should be.


You will waste hundreds of hours of time if you don't use the awesome tools that others have made for you. You will also cause yourself endless amounts of stress if you don't use a real debugger. I used to waste endless amounts of hours trying to track down a random bug. Then I discovered the SASC debugger, which is called CodeProbe or CPR, and *bam* the bug became instantly obvious and easy to fix.


_________________
Wanna try a wonderfull magical Amiga strategy game?
Total Chaos AGA

 Status: Offline
Profile     Report this post  
NovaCoder 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 12:38:34
#9 ]
Regular Member
Joined: 16-Apr-2008
Posts: 493
From: Melbourne (Australia)

I wish I knew

I have to result to old school logging to try and figure out why something doesn't work, probably explains why it takes me ages to get something working properly on OS3

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 13:30:14
#10 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@ChaosLord

Thanks for the explanation.

Please understand that I dont need (and qcually dont want) an debugger with GUI.
I am perfectly fine if the commands are set through the command line / stdin.

And it must work with a free compiler, best would be GCC since I dont have to re-write the code for every platform that has a different toolchain.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
itix 
Re: Brief questions about Amiga and GDB
Posted on 8-Mar-2013 21:28:24
#11 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

@Wanderer

This was long ago but on Amiga 500 you could insert break points and trace code using Mon. You dont need MMU to debug code but I dont know about GDB.

_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
Samurai_Crow 
Re: Brief questions about Amiga and GDB
Posted on 9-Mar-2013 9:08:06
#12 ]
Elite Member
Joined: 18-Jan-2003
Posts: 2320
From: Minnesota, USA

@Wanderer

Quote:

Wanderer wrote:

I am using GCC 2.95.3 if that matters.

First question: does that matter?
Do I need a specific GDB verison given a specific GCC, or is it (within reasonable boundaries) free to choose.
In Aminet I found GDB 4.16 http://aminet.net/package/dev/gg/gdb-bin
Will that work with GCC 2.95.3, or will I need GCC4.x?

Older versions of GCC should work with newer versions of GDB.
Quote:

Second question:
Does GDB need an MMU? Is my project doomed because its WinUAE+JIT based (no MMU with JIT)?

No MMU is needed unless you want to use MuForce and MuGuardianAngel to trap errors that might cripple your system.
Quote:

Third question:
Is this portable to other Platforms (OS4, MOS, AROS), by exchanging the GCC+GDB binaries, but keeping the command line calls with their parameters as-is?

Since the Amiga HUNK executable format was never fully supported by GDB, it will work on all of those platforms except AmigaOS 3.9 and earlier.
Quote:

Last question:
Is there an alternative that works better than GCC+GDB?

Boy do I wish there was. I even tried EDebug under AmigaE and it still didn't always work.

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 9-Mar-2013 16:00:15
#13 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@Samurai_Crow

Does anyone use gdb under 68k successully?

I tried two different versions (4.16, 4.18), both dont work properly.

The executable was a hello world with GCC 2.95.3.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
matthey 
Re: Brief questions about Amiga and GDB
Posted on 9-Mar-2013 19:53:16
#14 ]
Elite Member
Joined: 14-Mar-2007
Posts: 2877
From: Kansas

@Wanderer
I have heard of people using GDB successfully on 68k Amigas. GDB is primitive after using a debugger like BDebug (or even CodeProbe from SAS/C) from the Barfly package.

http://aminet.net/dev/asm/BarflyDisk2_00.lha

BDebug supports some source level debugging features with GCC STABS (GCC -gstabs). I use it all the time and it's very stable on my real 68060 Amiga. I bet a lot of your problems are because of UAE+JIT. You could turn JIT off and/or try a different UAE processor emulation as the stack frames are different and CPU specific.

 Status: Offline
Profile     Report this post  
ChaosLord 
Re: Brief questions about Amiga and GDB
Posted on 10-Mar-2013 4:10:24
#15 ]
Cult Member
Joined: 4-Apr-2005
Posts: 782
From: Houston, Texas USA

@Wanderer

Quote:

Wanderer wrote:
@ChaosLord

Thanks for the explanation.

Please understand that I dont need (and qcually dont want) an debugger with GUI.
I am perfectly fine if the commands are set through the command line / stdin.

I don't care if a debugger has a GUI or not. All I care about is whether it works or not and whether it saves me massive amounts of time. SASC debugger does wonderous amazing things for me so I would never discriminate against it just because it comes with a GUI.

It might be possible to use it without the GUI. I donno because I never tried. It has that "source level debug Machine A remotely from Machine B over the serial port" feature which might somehow allow CLI debugging.



Quote:

And it must work with a free compiler,

GCC is not free if it costs you thousands of hours of time and stress. I value your time as an expert computer programmer to be at least $20.00 per hour. Now how much does GCC cost?


_________________
Wanna try a wonderfull magical Amiga strategy game?
Total Chaos AGA

 Status: Offline
Profile     Report this post  
ChaosLord 
Re: Brief questions about Amiga and GDB
Posted on 8-Jul-2013 10:52:15
#16 ]
Cult Member
Joined: 4-Apr-2005
Posts: 782
From: Houston, Texas USA

@matthey

Quote:

matthey wrote:
@Wanderer
I have heard of people using GDB successfully on 68k Amigas. GDB is primitive after using a debugger like BDebug (or even CodeProbe from SAS/C) from the Barfly package.

http://aminet.net/dev/asm/BarflyDisk2_00.lha

BDebug supports some source level debugging features with GCC STABS (GCC -gstabs). I use it all the time and it's very stable on my real 68060 Amiga. I bet a lot of your problems are because of UAE+JIT. You could turn JIT off and/or try a different UAE processor emulation as the stack frames are different and CPU specific.


What does that mean? "supports some source level debugging features" ?

I am seriously considering trying to work with GCC C++ (or any of the other C++ packages for Amiga 680x0) so I am trying to figure out what all my options are.

Does Barfly work with debugging HUNK executables too?

I really want to switch to C++ on Amiga! But everything is so complicated

_________________
Wanna try a wonderfull magical Amiga strategy game?
Total Chaos AGA

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 8-Jul-2013 11:21:31
#17 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@ChaosLord

Exactly why I want to integrate GDB (or any other debugger that works) into AIDE (my current project). "Source level" means roughly, that the Debugger is completely hidden and operated through the GUI of the IDE which gives commands to the Debugger.
E.g. you step through the source code in the source code editor (with all its bells and whistles), not in a seperate shell. You query variable values by moving the mouse over the source code, not by typing them in etc.)

However, my tests with GDB didnt work out very well. I got one combination with GCC and GDB to work, but as soon as I do something more complicated than single stepping, it GURUs.

Last edited by Wanderer on 08-Jul-2013 at 11:22 AM.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
ChaosLord 
Re: Brief questions about Amiga and GDB
Posted on 8-Jul-2013 11:32:54
#18 ]
Cult Member
Joined: 4-Apr-2005
Posts: 782
From: Houston, Texas USA

@Wanderer

I happen to have my SASC manuals on my puter today so I found out that you CAN run SASC debugger from a shell!!!

Quote:

SASC Instruction Manual did Speaketh the Following Words:

Line Mode

You also can run CodeProbe as a line-mode debugger by starting it
with the -line option. In line mode the debugger displays its output
in the current Shell window. The -line option can be used to start
the debugger from a remote Shell that has been started from an
rlogin or from a Shell started across a serial line. For information
about starting a Shell over a serial line, see the description of the
AUX: device in The AmigaDOS Manual, 3rd Edition. 12 Chapter 1




CodeProbe Windowing Interface

CodeProbe provides a sophisticated windowing interface with multiple
windows and pull-down menus. Windows are used to issue debugger
commands, to receive output from CodeProbe commands, or to browse
through the source code for your program.


Screen Layout

CodeProbe starts with the Source and Dialog windows open, as shown
in Display 1.1. (BUY THE PROGRAM!)
13 Introduction to CodeProbe




Once CodeProbe is running, you can opell, close, move, and resize
windows. Display 1.2 is a sample CodeProbe screen showing the
following windows:

Source window
Dialog window
Memory window
Register window
Watch window. 14 Chapter 1




CodeProbe Windows

CodeProbe has 11 types of windows. You control the actual number of
windows open during a debugging session. No matter how many
windows are displayed, one of them will be the active window that is
currently receiving, or waiting for, input. The title bar of the active
window is highlighted (AmigaDOS Version 2.0 changes the color, and
Version 1.3 ghosts the title bar when a window is not activated). The
following list explains the function of each type of window:

It goes on and on....

_________________
Wanna try a wonderfull magical Amiga strategy game?
Total Chaos AGA

 Status: Offline
Profile     Report this post  
Wanderer 
Re: Brief questions about Amiga and GDB
Posted on 8-Jul-2013 11:40:26
#19 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

@ChaosLord

Where can I get this debugger, is it free, can I distribute it with my IDE and most important, does it work with GCC binaries? Or will I need to use a whole different tool chain?
The reason why I favour GCC is, that once integrated, it works for all Amiga and even not-so Amiga platforms.

_________________
--
Author of
HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more...
Homepage: http://www.hd-rec.de

 Status: Offline
Profile     Report this post  
ChaosLord 
Re: Brief questions about Amiga and GDB
Posted on 8-Jul-2013 12:05:19
#20 ]
Cult Member
Joined: 4-Apr-2005
Posts: 782
From: Houston, Texas USA

@Wanderer

Quote:

Wanderer wrote:
@ChaosLord

Where can I get this debugger,

Its all over the net.


Quote:

is it free,

The company has absolutely refused to sell it to anyone for over 10 years.

In the late 90's after SAS had officially dropped support for Amiga for a few years, they suddenly released a completely FREE updated SASC compiler (with other updated tools) for C++ support! Just gave it out for free! Its on Aminet if you don't believe me.

So, yes its free.


Quote:

can I distribute it with my IDE and most important, does it work with GCC binaries?

GCC does not produce Amiga-format exes. Its uses its own format.

I think I saw a proggy on Aminet that claimed to convert from GCC format to Amiga HUNK format. This could be the magic key that you need!


Quote:

Or will I need to use a whole different tool chain?

I think you can make all C compilers work with whatever make proggy you want.

But the linker probably needs to match the compiler.


Quote:

The reason why I favour GCC is, that once integrated, it works for all Amiga and even not-so Amiga platforms.


I understand that but since nobody can find a source level debugger that actually works with GCC and since the GCC team does not like Amiga 680x0 processors we are stuck.

If we get a proggy that converts GCC to Amiga HUNK format then we can probably use 2 or 3 different debuggers quite well.

Here I found it for you:
Convert GCC objects to Amiga HUNK format for FREE

I give u some knowledge, u do what u want

_________________
Wanna try a wonderfull magical Amiga strategy game?
Total Chaos AGA

 Status: Offline
Profile     Report this post  
Goto page ( 1 | 2 Next Page )

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle