gdb

std::string::assign() causes segfault

The situation: I have a std::vector that contains strings at specific offsets. Here's a shortened dump: ... @128 00 00 00 00 00 00 00 00 73 6F 6D 65 74 68 69 33 ........somethin @144 38 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ng.............. @160 00 00 00 00 00 00 00 00 31 2E 32 2E 33 00 00 00 ........1.2.3... @176 00...

gdb within emacs on Windows

I'm running Emacs 22.3 in Windows. Earlier today I had gdb working within Emacs just fine. I was installing QT4 and during the installation it asked me to uninstall MSYS which I quickly clicked through not thinking about things. I think I had gdb installed with the MSYS package and Emacs was using that, but I'm not completely sure. N...

How to run gdb with -quiet in xcode

I'm a newbie, so you'll have to explain this pretty clearly. I'm looking for a way for Xcode to automatically run gdb with the -quiet command so that it doesn't show startup text. I tried to edit the /Developer/usr/bin/gdb executable by adding -q to the exec lines at the end after "$gdb" in this code (somebody mentioned doing that elsew...

How do you disassemble an overloaded operator in gdb?

If I have something like bool operator ==(const uint128& x, const uint128& y); how can I get gdb to disassemble it? ...

Switching between multiple stacks in gdb 6.3

Hello! There are two stacks in the program: one is created by OS and the second is created by program itself to run some code with it. When the program crashes in the second stack, I want to switch to the main stack in gdb and see the backtrace. Is it possible? I tried to save the rsp to a variable and change it after the crash, but th...

modify values of elements of an array in gdb for C++

Hi Just wonder how to modify the values of multiple elements of an array under gdb for C++? Thanks and regards! ...

gdb breakpoint on pthread_create

I am trying to set a breakpoint in linux in gdb for a program creating threads. I would like to set a breakpoint on thread creation, but unfortunately pthread_create is a versioned symbol, and I can't get its full name. If I type: catch thread_start I get Catch of thread_start not yet implemented How is the best way to catch thre...

How can malloc() cause a SIGSEGV?

I have an odd bug in my program, it appears to me that malloc() is causing a SIGSEGV, which as far as my understanding goes does not make any sense. I am using a library called simclist for dynamic lists. Here is a struct that is referenced later: typedef struct { int msgid; int status; void* udata; list_t queue; } msg_...

iphone Simulator crashing from Xcode run and go

Does anybody know what might be causing this problem? When I run the code, the program immediately crashes on the simulator before getting anywhere; however if I just go to the simulator and run the program, the changes were loaded and there doesn't seem to be any obvious problems. Or how could I try to pinpoint this problem? [Session ...

How to avoid entering library's source files while debugging in Qt Creator with gdb?

How can I configure Qt Creator and/or gdb so that while debugging my program using Qt libraries the debugger would avoid stepping into Qt's source files? ...

Analyzing a Xen core dump

After a Xen guest domain hang, I took a dump using xm core-dump . Following the sparse documentation I found, I tried using the crash utility to analyze the dump. Unfortunately, the kernel image (Debian lenny) is stripped, so I am forced to make use of the map file. However, crash /boot/System.map-2.6.26-2-xen-amd64 vmlinux-2...

gdb - debugging with pipe

If i have a two programs named blah and ret.. I want to debug blah program which receives input from ret program via pipes .. how do I debug the blah program in the following case using gdb bash> ret | blah ...

Is there any memory browser in QtCreator?

I can't find it. In the watcher window I can manually type memory addresses but I'd like to see bigger chunks of memory... If this doesn't exist, is there any other free memory mapper for the Mac (except for XCode and Eclipse)? Thanks, rui ...

Most tricky/useful commands for gdb debugger

Hi All, Can you post your most tricky and useful commands while you run a debugger like gdb or dbx. ...

Configure Qt Creator to work with GDB

I have both GDB and CDB in my machine. My Qt creator is using the CDB for debugging. How do i configure it to use GDB? I tried to point to the GDB path, but it doesn't work. How do i set Qt Creator to debug using GDB? ...

gdb, set breakpoint on all functions in a file.

Is there a single command in gdb which can set breakpoints on all the functions in a given file ? I know about rbreak regex which sets breakpoints in matching regular expression functions, but my file doesnt have fixed patterned functions. In another way, is there a command by which I can set a breakpoint on a filename. Which will mean...

Using gdb in emacs v23

I am trying to move from Emacs v22.3.1 to v23.1.1 and all was going well until I tried to run gdb using gud inside Emacs. When I do meta-x gdb and give a command of 'gdb /my/executable/here' the window comes up fine, but when I type a command at the gdb prompt upon hitting return key to execute the command, nothing happens, status bar s...

Suppressing default output from gdb when stepping between instructions

When I step through a debugging session with gdb, it prints out some information for me. How do I stop this. Here's an example: Breakpoint 1, 0x100000d4 in ?? () (gdb) si 0x100000d8 in ?? () (gdb) si 0x100000dc in ?? () (gdb) Here I want to remove the lines that say 0x100000d8 in ?? (). I can't find anything in the documentation about...

How to run a Linux program line by line

I would like to run a GTK+/C program line by line with some debugger. I have never debugged a Linux program so where can I find instructions to a very beginner on how to debug code? I have just an idea that I have to download the sources from net, compile the project with debug symbols and run sources through DDD or GDB. So can anyone gi...

gdb not hitting breakpoints

To learn a bit more about FreeBSD and *nix systems in general, I'm starting to look at the binaries from the DEFCON 17 Capture The Flag game. Right now, I'm reversing the tucod binary. Here's some possibly useful information on tucod: tucod: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 7.2, dynamically link...