gdb

Xcode "step in" debugger problem

Hello, I have a problem when using step in a function - the debugger jumps in a header file that is not related with the implementation of that function. This is working as expected for other functions.. Did you have such problems before? What did you do to solve this? It's very weird.. I never had such problem in Xcode before. I tried ...

How to debug program with signal handler for SIGSEGV

I am writing a plugin for a application, occasionally a SIGSEGV would be throw out. However, the application catches the signal SIGSEGV. In other word, The plugin is a dynamical library. The error occurs in my plugin and dynamical library. But the applcation handle the sSIGSEGV and exit normally. So, it is quite difficult for me to debug...

Xcode debugger static member variables

Hello, Do you know how may I see the value of a static member variable from a class in xcode? I can all the other variables except the static ones. Thank you! ...

Howto debug program that needs to run as root from gdb (Eclipse) as user (set gdb suid root?)

I need to debug a program on Linux with Eclipse (gdb). The program run as root and is quite large. The binary with debug symbols is about 250MB large and has more than 60 running threads after startup. I'm thinking about the best solution: Use gdbserver Run Eclipse as root Set gdb suid I think number 1 (gdbserver) would be the bes...

GDB Debugging on Eclipse hangs for infinite time

Hi, I downloaded Eclipse for C++ v 3.6 32-bit version on my WIndows 7 64-bit OS. I can build and run my code, but I cannot debug. I am using MingW32 compiler v5.1.6 with GDB v7.1 . When try to "debug" my application, the progress tab shows "Launching: Configuraing GDB" at 86% for infinite time. The stop button beside the progress bar...

Quick GDB Question; what does it mean if multiple memory locations are showing up as ??

#1089 0x9999992f in ?? () #1090 0x50409a99 in ?? () #1091 0x666666a6 in ?? () #1092 0x31306666 in ?? () #1093 0x35343332 in ?? () #1094 0x39383736 in ?? () #1095 0x33323130 in ?? () #1096 0x37363534 in ?? () #1097 0x31303938 in ?? () #1098 0x35343332 in ?? () #1099 0x39383736 in ?? () #1100 0x91403130 in ?? () #1101 0x9999992f in ?? () #...

Function abruptly returns when it shouldn't

I am working on an Operating Systems assignment for one of my summer classes. The teacher has provided an object file that provides functions that mimic the behaviour of a disk device driver. We are then to write a file system API that uses the disk device driver in C. I am working on my file system format function named Format() which ...

Debug Native Code on Motorola Droid

Hi all, I'm trying to debug an application build with the NDK on a Motorola Droid. I'm following the instructions here and I've had success in the past on an emulator (I have root access obviously) but when I try to start gdbserver :5039 --attach 1082 through the adb shell, I get a gdbserver:permission denied. Obviously as this is...

How can I debug multiple apps by loading multiple symbol definitions with GDB?

I am doing embedded software development. By nature, I have 3 different applications running simultaneously that are guaranteed to run in different ranges of virtual addresses, e.g. App 1 runs on 0x10000000 - 0x20000000, App2 runs in 0x20000000 - 0x30000000 and so on. Generally GDB seems to accept only one symbol definition file. But i...

gdb problem setting hardware watchpoint/how to set software watchpoint

An earlier question explained that on x86 the size of objects being watched is limited by debug registers. here. As expected, I can "watch" a double variable. But I can't watch a double datamember, eg watch pObject->dPrice produces Hardware watchpoint 1: pObject->dPrice But when you try to continue execution, it says Could not in...

Debugging multithreaded code with gdb but no access to private variables?

Hey guys. My program uses OpenMP at a few parts to do multithreading. It works for the most part, but occasionally stalls and just sits there. So I run it in the debugger, and I find the area it is stalling at. Then I try to examine the current variables, and I get this: 169 if(0<=myPtr[3] && myPtr[3]<=1){//Reassign the velocities....

Emacs 23.1.1 with gdb - forcing source windows

I'm using emacs 23.1.1 with gdb and gdb-many-windows. My question is if it's possible to force gdb to always use the main source window for stepping through the code. What happens is that as I move through stack frames, if I happen to have the source file up in another emacs frames, emacs brings that frame to the foreground while leavin...

Gdb gives no stack on a simple std::string uncaught exception

Hi folks, im a little bit newbie on gdb so here goes: Im working on cpp unit testing operation right now. I try to construct string objects with invalid parameters like null_char but program expectedly gives exceptions :). When i try to debug the app using gdb, i type bt after the crash, but it gives me no stack message. Any ideas to w...

What causes a Sigtrap in a Debug Session

In my c++ program I'm using a library which will "send?" a Sigtrap on a certain operations when I'm dubugging it ( using gdb as debugger). I can then choose weather I wish to Continue or Stop the program. If I choose to continue the program works as expected but setting custum breakpoints, after a Sigtrap has been caught, causes the debu...

Invoke and control GDB from Python

I am running a Python GUI application. I want to invoke and control GDB from it, like load an executable file, set breakpoints etc. I see that GDB has a command line interface which can be used by sending strings to the GDB process, but I want to do it the Python way. Is there a gdb.py? I see that "archer" branch has something like "impo...

i'm running gdb with attach on a process how do i halt the continuing i'm stuck there

hi i'm pretty much using gdb for the first time, i tried looking at the internet for info about my prob but i could not find. i run $gdb then i'm running attach <mypid> then i see that my process is stuck (which is probably ok) now i want it to continue running so i run continue and my process continues running but from here i...

Difficulty getting GDB to load debugging symbols

I use GDB to debug C/C++ programs very often, and I'm reasonably knowledgeable with how it works and what it can do. However, every so often I run into problems where mysteriously I can't seem to get GDB to properly load symbols from a core file. Currently, I have a binary executable in a shared NFS directory. The executable was def...

gdb cannot watch variables declared inside for-loop

I am using gcc 4.1.2 20080704 (Red Hat 4.1.2-48) GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.1) and I cannot watch variables declared inside for-loop. I tried to recreate this behavior on a smaller example but it worked fine. Seems like this problem shows up only inside complex class member functions. Please, advise. EDIT: o...

How can i prevent gdb from attaching to an exe?

I'd like to prevent would-be hackers from attaching to my binary on Linux systems. I see that ptrace DENY_ATTACH can be used on OSX. Is there such option that can be used on linux? How about on Windows? Thanks for any info! ...

Remotely debugging a Linux process from Windows with gdb and gdbserver: what exactly is needed on the Windows side?

Hi all, I am running Eclipse CDT on Windows to develop C code that is built & tested on remote Linux systems. Currently, the code is never compiled on Windows. I am able to use CDT to begin the remote process on the Linux target under gdbserver, and then attach gdb from the Windows host. However, gdb immediately fails with errors like:...