Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
18 user(s) are online (14 user(s) are browsing Forums)

Members: 2
Guests: 16

TearsOfMe, Maijestro, more...

Support us!

Headlines

 
  Register To Post  

GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Just popping in
Just popping in


See User information
Hi again,

did anybody get gdb working with latest SDK and GCC/G++ 11.2.0?
I am using g++ for compiling my stuff and even force -gdwarf-2 when building the debug version.

But when loading the binary in gdb it cannot set breakpoints and when rereading my binary it complains that it finds DWARF version 5 while it is expecting version 2.

But doing objdump on my binary and grepping the DWARF version clearly tells me that it has DWARD version 2!

So can GDB on AOS4 no longer being used? Or at least not when C++ got compiled?

Does anybody have maybe an idea here how to get it working again (used to work in old GCC 2.4.3 installation)?

Thank you in advance!

Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Home away from home
Home away from home


See User information
@Reth
The one which is with SDK is too old, and can't be used with binaries compiled with new GCC. You should build new GDB which support all DWARFs. There is version which is works:

https://github.com/AmigaLabs/binutils- ... ree/nativeOS4-build-clib4

To build you need firstly build latest clib4:

https://github.com/AmigaLabs/clib4/tree/development

Then, install it to SDK , install clib4.library to your actual LIBS: in os4, then build GDB with those includes, and then you are ready.

Steps to build (for my cross-compiler, but you can see the logic and change it in your way):

Clib4:

cd /amiga/
git clone --single-branch --branch development https://github.com/AmigaLabs/clib4
cd clib4
vim GNUmakefile
.os4
<replace /usr/ppc-amigaos/SDK/clib4 on /usr/local/amiga/ppc-amigaos/SDK/clib4)

make -f GNUmakefile.os4 INSTALL_PREFIX=/usr/local/amiga/ppc-amigaos/SDK/clib4 -j4
debug version
make -f GNUmakefile.os4 DEBUG=true INSTALL_PREFIX=/usr/local/amiga/ppc-amigaos/SDK/clib4 -j4


rm 
-rf /usr/local/amiga/ppc-amigaos/SDK/clib4

mkdir 
/usr/local/amiga/ppc-amigaos/SDK/clib4
mkdir 
/usr/local/amiga/ppc-amigaos/SDK/clib4/lib
mkdir 
/usr/local/amiga/ppc-amigaos/SDK/clib4/include

make -f GNUmakefile.os4 install


Then take ready clib4.library, copy to your OS4.

Then dl and build GDB:

cd /amiga/
git clone --single-branch --branch nativeOS4-build-clib4 https://github.com/AmigaLabs/binutils-gdb
cd binutils-gdb
mkdir native
-build
cd native
-build

CFLAGS
="-mcrt=clib4 -Wno-sign-compare -lpthread -athread=native" CXXFLAGS="-mcrt=clib4 -Wno-sign-compare -lpthread -athread=native" ../configure --enable-tui --enable-source-highlight --with-expat --disable-threading --disable-plugins --disable-sim --host=ppc-amigaos --target=ppc-amigaos

make 
-j6


Ready GDB will be in native-build/gdb/GDB

If you will have some problems in process ask here , i will help with.


PS. one note to add, if you on x5000, it will not work with public kernel, sadly. It needs an updated one.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Just popping in
Just popping in


See User information
@kas1e

Thank you. Never did such kind of things so far also not x-compiling yet (only occasionally Codebench in AOS4). Maybe I need to try something like that one day.

I am on Peg2 so no X5000. Short question regarding your compilation: Could that GDB not be used by others as well?

Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Home away from home
Home away from home


See User information
@Reth
Sure, i hope MightyMax (the one who work on this GDB) doesn't mind that i share ready to use binary. This just current compile of latest code, i.e. work in progress and have issues to be fixed, but it runs, can load up binary, set breakpoints, etc. Also as bonus it have syntax highlighting enabled (when you do "list" in gdb, to have colored output) and enabled TUI (which not as good as we may hope for our shell).

Anyway, there is : https://kas1e.mikendezign.com/aos4/gdb/gdb_2025_04_23.zip

GDB binary (unstripped, so 50mb of size), and also latest clib4.library which you need to put to your LIBS: in your OS4 install.

If you will meet with any bugs, there is bug-tracker for:

https://github.com/AmigaLabs/binutils-gdb/issues

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Just popping in
Just popping in


See User information
@kas1e

Thank you very much. Does this mean I also have to compile my stuff against clib4?

And does your repo from here also compile under the AOS4 SDK?

Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Amigans Defender
Amigans Defender


See User information
@Reth

No you can use also newlib programs

i'm really tired...
Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Just can't stay away
Just can't stay away


See User information
@kas1e

Using your attached GDB with latest clib4 v1.5 it just crashes.
https://github.com/AmigaLabs/clib4/releases/tag/v1.5.0

With the one you include v1.4 no problem. any chance to rebuild GDB with clib4 v1.5?

TiA

Go to top
Re: GBD not working when compiling with 11.2.0 version - even when using -gdwarf-2
Home away from home
Home away from home


See User information
@Javier
You need to use exactly attached clib4.library from archive, not the 1.5 one. The one attached it the very latest one (few days ago commits). Of course it will also work with any new clib4 too (all after 1.5), just the one attached is must as minimum. It show "1.4.1 (12.01.2025)" by unluck, maybe makefile do not take date correctly, and version itself stick like this. But it's latest one anyway.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project