Questions tagged [gdb]

Use this tag for problems related to or involving GDB, the standard debugger for the GNU software system.

The GNU Debugger, usually called just GDB and named gdb as an executable file, is the standard debugger for the GNU software system. It is a portable debugger that runs on many Unix-like systems and Microsoft Windows variants. GDB works for many programming languages, including C, C++, D, Go, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, and Ada.

Related Resources

11325 questions
5
votes
2 answers

attaching to android native app with gdb closes app on device

I am attempting to debug my native app compiled with ndk-r6. When I attempt to run ndk-gdb to attach the debugger to the process, the app quits on the device. I am stumped. Can anyone shed some light on this for me please? Here is a log of a run of…
Tom Whittock
  • 4,081
  • 19
  • 24
5
votes
1 answer

dump_bt not working when trying to analyse apache core dumps

I am trying to use dump_bt to analyse an apache core dump as we are getting segmentation faults after moving servers. The info I got on how to do it is at the following…
rsmarsha
  • 358
  • 3
  • 13
5
votes
2 answers

How to watch the vtable in gdb in a C++ program?

I have an interesting problem in one of my C++ programs. Apperantly the vtable of one of my classes is/becomes messed up during program execution. In a gdb session I found out that if I call a method of the object directly it succeeds, but if I use…
Raphael R.
  • 23,524
  • 1
  • 22
  • 18
5
votes
0 answers

Reverse debugging with gnu gdb on Mac OS X 10.7

I'm very interesting in ability to reverse debugging one immense xcode-based project on MacOS X. The problem is XCode 4.1 has gdb version 6.3.50, while reverse debugging presents starting from 7.0 So I installed gdb 7.3 via macports, but it rejects…
dev_null
  • 51
  • 3
5
votes
3 answers

How can we get the physical address in GDB?

OS prevents GDB from giving us the physical address, and instead we have virtual addresses. Is there a way to actually get that physical address? Doing debugging on Windows Visual Studio looks more promising: the addresses look more like real…
CppLearner
  • 16,273
  • 32
  • 108
  • 163
5
votes
1 answer

Linux: Snoop a signal without trashing the registers for the subsequent core dump?

When I get coredump-causing signal, I want to run my own handler to copy the siginfo_t and ucontext_t structures to global variables, so that they may be accessed in the core dump. Currently at the end of my handler I reassign the default handler…
gimmeamilk
  • 2,016
  • 5
  • 24
  • 36
5
votes
4 answers

What could make GDB refuse to break?

I'm at a loss here. I'm writing a compiler in C (for hobby), and compiling with GCC 4.6.1 on amd64 Linux 2.6.32, using GDB 7.3. Flags are "-Wall -Wextra -O0 -g", in addition to the usual -I and whatnot. I have a function whose purpose is to report a…
c4757p
  • 1,728
  • 4
  • 18
  • 25
5
votes
1 answer

Xcode: GDB and signal handlers

I'm using signal handlers in an Objective-C application to catch fatal errors, as SIGSEGV, SIGBUS and the like. When such an signal is raised, I'm writing a log file, with a backtrace and details about the error (I know I can have reentrancy issues,…
Macmade
  • 52,708
  • 13
  • 106
  • 123
5
votes
1 answer

Why is there a "±" in lea rax, [ rip ± 0xeb3]?

I just started learning about assembly language in Kali Linux in VMware. I have a Ryzen 5 CPU. In the below code snippet, I have a few things I don't understand. What is the meaning of lea rax, [rip ± 0xeb3] at
? I understand what lea…
5
votes
1 answer

GDB: warning: Multiple breakpoints were set on overloaded methods

anisha@linux-dopx:~> g++ -Wall -pedantic breakpoints.cpp -g anisha@linux-dopx:~> gdb a.out (gdb) b X::X Breakpoint 1 at 0x400ac1: file breakpoints.cpp, line 14. Breakpoint 2 at 0x400aa0: file breakpoints.cpp, line 9. warning: Multiple breakpoints…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
5
votes
5 answers

Stepping into swapcontext() with gdb

I'm doing a project that makes unix system calls. To be specific, my project heavily relies of calls to getcontext(), makecontext(), swapcontext() and setcontext(). I tried to debug my code using gdb. I stepped into the code line by line and…
Aswin Parthasarathy
  • 605
  • 1
  • 8
  • 17
5
votes
2 answers

Null pointer dereference not leading to seg-fault in previous statements

I am debugging a crash where we have a code snippet similar to - 1184 static void 1185 xyz_delete ( *c, **a) 1186 { ... ... ... ... 1196 b = *a; 1197 if (!b) { 1198 return; 1199 } ... ... 1203 prev =…
5
votes
2 answers

How to get a "backtrace" (like gdb) using only ptrace (linux, x86/x86_64)

I want to get a backtrace-like output as gdb does. But I want to do this via ptrace() directly. My platform is Linux, x86; and, later x86_64. Now I want only to read return addresses from the stack, without conversion into symbol names. So, for test…
osgx
  • 90,338
  • 53
  • 357
  • 513
5
votes
3 answers

GDB with ECLIPSE GUI over remote server?

I would love to debug my software with ECLIPSE as front end to GDB. Our build set up as follows. Linux server with code base Windows accessing code base via Samba (Eclipse IDE) Software is built on Linux server with makefiles (No ECLIPSE…
Kamath
  • 4,461
  • 5
  • 33
  • 60
5
votes
3 answers

gdb - pipe output of internal command to the shell command

Is there any way how to pipe output of internal gdb command to some shell command like grep - the variant of [cmd] ! grep in mdb? To be more clear: in solaris mdb you can e.g. write main::dis ! grep call to detect which functions are called from…
Michy
  • 623
  • 9
  • 15
1 2 3
99
100