We have installed GDB on AIX 6.1 (gdb-6.0-1.aix5.1.ppc_AIX.rpm) and I notice that there is no "TUI" (terminal user interface) mode for "interactive source code debugging"?
Is that a known thing for GDB on AIX? Is there another way I can debug my application through the source code like using TUI mode on AIX? Perhaps using TTY somehow?
Thanks for the help
Lynton
Perhaps you need a more recent GDB. GDB is now at version 7.3.1 and gdb 7.2 has a --tui option.
Did you try to build GDB from its source code?
There is a same problem in my Mac OS X 10.6.6, then I try to build gdb 7.3.1 from source code, finally get the --tui option. While I use command "gdb --tui program" and typed "run" to debug, I get this message:
Unable to find Mach task port for process-id 36434: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
Then I use command "sudo gdb --tui program" to resolve it.
And there is a cgdb which based curses, and like TUI option.
See also question No TUI support for gdb on Mac?
Related
I installed 'gdb' to debug my C program in mac with VS Code.
When I typed "brew install gdb", it told me to follow the instructions in https://sourceware.org/gdb/wiki/BuildingOnDarwin to give permission to gdb.
But there is one sentence that I have no idea how to follow.
The sentence is :
If you plan to build gdb frequently, this step can be automated by passing --enable-codesign=gdb-cert (assuming, again, that gdb-cert is the name of the certificate) to configure.
How can I pass the message to the configure? What is the 'configure' in mac terminal?? I'm using Catalina and zsh. please help!
I've installed (OSX Mojave 10.14.6.) Eclipse CDT and GNU MCU Eclipse plugin and finaly GNU Tools for ARM. My goal is to build and debug ARM code using GDB (arm-none-eabi-gdb).
I've created a Hello World project for Arm, which builds ok - but, debugging seems not to work with GDB (that comes with the Arm package). GDB gets stuck:
I have set the proper paths in Eclipse to arm-none-eabi-gdb.
I have signed the arm-none-eabi-gdb (with the same certificate that I used to sign GDB installed via brew into /usr/local/bin/gdb the day before - and it worked!).
I have also tried running Eclipse as root from command line.
Nothing helps.
The message is "Configuring GDB Aborting configuring GDB".
What to do?
Probably what is going on here is that you built to a given target (ARM based) and you're trying to run it (with gdb) on your mac (x86).
You'll need an emulator or QEMU to properly run on your mac or maybe a real board.
I am new to coding and trying to get eclipse neon running on my macbook air. I am having trouble getting the debugger to work. I installed gdb with homebrew, created a certificate and signed gdb as per the instructions in the link:
https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html
I then configured eclipse debugger settings with the location of the newly installed gdb. However now when I try to start the debugger, the initialization process starts but gets stuck forever on 62%. Any tips on how to solve this? Could it be a memory issue? MBA has 4gb RAM...
This is a known bug in CDT - Bug #509737
The problem in summary is that CDT version 9.2.0 cannot work with GDB version 7.12.
One way to resolve this is to use an older version of GDB, for example GDB version 7.11
Another way to workaround this is to pretend GDB 7.12 is actually version 7.11.
Create the following executable script:
#!/bin/sh
if [ "$1" = "--version" ]; then
echo "GNU gdb (Debian 7.11-1) 7.11"
exit
fi
exec /usr/local/bin/gdb "$#"
and configure eclipse to run it instead of gdb.
I made my code as a standalone .c file and read that, in order to debug, the file must be in a project. So I made an empty project and added my file to it, set some breakpoints and, when i run the debugger, I get this on console:
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6.1
Child process PID: 13112
Error in re-setting breakpoint 2: PC register is not available
Error in re-setting breakpoint -3: PC register is not available
In ()
Tried some tutorials and whatched some videos without success. Does somebody knows a fix for that? Is there a simpler way to debug a .c file?
For linux system you could use gdb as debugger in this way:
$ vim hello.c
# include <stdio.h>
int main()
{
printf("hello \n");
}
$ gcc -o hello hello.c
$ ./hello
$ gdb hello
(gdb) break main
(gdb) run
and then you can use:
c or continue
n or next
s or step
For more details see this.
Updated MinGW downloading it from its sourceforge repositor.
Downloaded the 6.2.0 version that is available in this link.
Then I unziped it to C:\ and modified the environment variable Path to add the new C:\MinGW\bin folder. To know if you made it correctly just open CMD and type gcc --version.
After that, I modified the compiller and debugger settings of Code::Blocks to use the new version of MinGW and its executables.
Now it is compiling and debugging properly.
According to Free Pascal's GDB Debugger Tips the problem is with GDB and they cite Bug 14018.
It appears you should use a different version of GDB. They suggest downgrading to 7.2. Now I believe other versions are now available, like 8.0. I don't know if GDB 8.0 suffers it too.
I just started learning C, and I am looking for a simple tool for debugging in gcc environment. Such tool would print a stack trace, and indicate where a segmentation fault occurs.
Try gdb; or a frontend like ddd or kdgb.
Compile with the -g flag.
GDB does it all - you need to compile your program with debug information (use -g switch) and then open it with GDB. To print stack trace use command bt.
To investigate segfaults you need to pass path to core file to GDB as well, like this:
gdb yourprogram core
If your system by default doesn't generate core files in case of segfault, you can switch it on using command:
ulimit -c unlimited
GDB is what you are looking for. In particular, the backtrace command in GDB will show you a stack trace. http://www.cs.cmu.edu/~gilpin/tutorial/
If you use X try "ddd"
Whether you use the command line gdb, or one of the front-ends such as DDD, you should definitely take a look at the gdb manual, which is also (like many GNU manuals) a very good tutorial.
I would also advise to look at valgrind.
There's also a nice integration of gdb in kdevelop (the emacs binding is fine too..)