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
6
votes
1 answer

"gdb.exe has stopped working " in windows7

I build GDB for ARM from GDDBSources(GDB7.5) using MinGW and MSYS for windows.But sometimes while connecting GDB to the QEMU , GDB crash occurs with a message : "gdb.exe has stopped working" in windows7. What is the solution of this issue?
Fila
  • 97
  • 1
  • 4
6
votes
1 answer

Using gdb to inspect "non-current" thread on eCos mips target

I have a MIPS target running eCos, which uses several thread. For debugging I'm using gdb 7.5 and a JTAG probe. How can I from GDB inspect and back trace a non-current thread. I do have the base thread address, and the program counter from the…
Allan
  • 4,562
  • 8
  • 38
  • 59
6
votes
1 answer

LLDB equivalent of 'detach' in GDB in Xcode?

Is there any equivalent of GDB's 'detach' command in LLDB?
Alexey Golikov
  • 652
  • 8
  • 19
6
votes
1 answer

Updating GDB on mac osx 10.8 from 6.3 to 7.*

I now have gdb-6.3 from Xcode. Wanting to upgrade to gdb-7.* Here's what happened: I used macports to install GDB-7.5, all is fine during installation only until I tried to run gdb as, ggdb exectutable it showed, BFD:…
Joshua
  • 111
  • 1
  • 5
6
votes
3 answers

help with gdb traces (or similar)

I have an application. I have the source code (in C). I can compile it anyway I want. Add whatever tool I want to it. Etc. However, I do not want to pepper the source code with a bunch of printf's. I want to be able to produce a log of some sort…
tvaughan
  • 341
  • 3
  • 5
6
votes
0 answers

android gdb error: "Cannot access memory at address"

Target: Android 4.1.2, device: Google Nexus S, gdb server version: 7.3.1-gg2 Host: cygwin, gdb version: 7.3.1-gg2 ndk-build, using NDK_DEBUG=1 GNU gdb (GDB) 7.3.1-gg2 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL…
6
votes
1 answer

Program terminates early with valgrind memcheck

I have a C-programm (a lot of numerics and too long to post) which I compile with gcc -g -O0 program.c -o program I am trying to debug it using gdb and valgrind memcheck. After some changes on the code I found that valgrind --tool=memcheck…
highsciguy
  • 2,569
  • 3
  • 34
  • 59
6
votes
2 answers

Return a value via a gdb user-defined command

I'm debugging with a core-file, so I have no active process in which to run anything. I'm using gdb user-defined commands to inspect a bunch of data from the core file, and attempting to simplify the process using user-defined commands. However, I…
abelenky
  • 63,815
  • 23
  • 109
  • 159
6
votes
1 answer

Cleaner, prettier stack traces in GDB for C++ template (mostly boost)-heavy code

I work on a financial application (Linux/C++/gcc) that uses boost and templates extensively. The stack traces generated while debugging via GDB is horrifyingly complex with the internal template-wiring of boost adding a lot of ugly noise to the…
ARV
  • 6,287
  • 11
  • 31
  • 41
6
votes
4 answers

gdb macro to determine the architecture of debugged program

I need to write some gdb macros that need to different between 32 and 64 bit architectures. I'm looking for a way to determine in gdb whether the debugged executable is 32 or 64 bit. info target includes info about file type e.g. file type…
dbbd
  • 864
  • 1
  • 8
  • 23
6
votes
1 answer

How to set width of GDB memory examine (x) or print (p) commands?

I am trying to get a formatted print of a long 2D array, of width 8, of floats. When using the x command, I get the array printed as four-column table: (gdb) x/16f 0x81000000 0x81000000: 0 0 1 0 0x81000010: 2 0 3 0 0x81000020: 4 0 5 …
ysap
  • 7,723
  • 7
  • 59
  • 122
6
votes
1 answer

How to debug the NFC implementation of Android?

This question can be decomposed into multiple smaller problems. The end result would be to be able to set a breakpoint in the C/C++ NFC implementation of a Galaxy Nexus (Android 4.1) device using a debugger such as gdb to examine it's internal…
mibollma
  • 14,959
  • 6
  • 52
  • 69
6
votes
3 answers

How to debug a segmentation fault

How do I debug a segmentation fault? Basically this is what happens: I run my server in background: ./server & then I run my client: ./client When I try to login to my server, on correct username and password, everything is okay, but when I type…
user1587149
  • 87
  • 2
  • 7
6
votes
1 answer

Is it a button or a tab on headers in Emacs gdb-many-windows-mode?

Some of the windows have clickable buttons or tabs on header in gdb-many-windows-mode such as 'Locals/Registers' or 'Breakpoints/Threads'. Are they tabs? Can I add new one next to them?
aspirin
  • 347
  • 1
  • 5
6
votes
1 answer

Curious thing when finding environment variable address in gdb

Recently I'm doing some Return-to-libc attack experiment base on the paper Bypassing non-executable-stack during exploitation using return-to-libc with my Ubuntu11.10. Before my experiment I closed the ALSR. According to the paper, I can find…
KUN
  • 527
  • 4
  • 18