gdb

Working program gets an Illegal instruction fault on 'clean machine' ?

I have a program that works correctly on my development machine but produces an Illegal instruction fault when tested on a 'clean machine' where only the necessary files have been copied. The program consists of my shared library, built from C++ sources and a C wrapper sample program that demonstrates the libraries usage. On the develop...

QT4 GDB debugger doesn't link to shared libraries on Ubuntu

Hello: I'm new to UNIX and QT4 but ubuntu is coming along. My first QT4 project links a simple test app to a shared dll of ported code. I am able to build the application using QT Creator and to run it from the terminal. However the embedded GDB debugger reports: unable to load shared ... no such file or directory. The .pro file c...

Print whole string verbatim in gdb

I'm printing a string(char *) in gdb (gdb) p l l=0x9aa1f48 "up2 129104596496602200 19 0 0 3 0 eth1 XX :001CB",'0' <repeats 12 times>, "DC" Is there a setting to have p print the whole string and not fill inn the "repeats ... ". While at it - also extend the default printable length of a string, p seems to cut off if the string is quit...

gdb error: Unable to execute epoll_wait: (4) Interrupted system call

I am unable to run my code in debug using gdb because of the following error: Unable to execute epoll_wait: (4) Interrupted system call Any ideas on how to solve this? Thanks ...

Debugger not working in C++

I've written an iPhone program which includes a library. The library uses some C++. The program runs fine in the simulator as long as debugger is turned off. GDB immediately complains with the following /SourceCache/gdb/gdb-962/src/gdb/dwarf2read.c:7593: internal-error: could not find partial DIE in cache A problem internal to GDB ha...

Debugging in Linux using core dumps

What are the 'best practices' when it comes to debugging core dumps using GDB? Currently, I am facing a problem: The release version of my application is compiled without the '-g' compiler flag. The debug version of my application (compiled with '-g') is archived (along with the source code, and a copy of the release binary). Recent...

GDB launches after iPhone OS App

Hello guys, Strangest thing happening to me right now: GDB seems to launch after the app does. Output in xcode terminal window looks like this: [Session started at 2010-02-15 18:57:31 +0100.] 2010-02-15 18:57:35.822 CPPlayer[2890:207] CPLanguageManager.m:26 Initializing LanguageManager 2010-02-15 18:57:35.825 CPPlayer[2890:207] CPLang...

Equivalent to toString() in Eclipse for GDB debugging

In Eclipse I can override the toString() method of an Object to pretty print it. This is especially useful because during a debug sessions as I can click on a variable and see the object in a human readable form. Is there any kind of equivalent for C++ during a gdb session. I'm also open to any IDEs that can emulate this behavior. ...

Is <value optimized out> in gdb a problem?

I have an application that only crashes in -O2 optimization (compiled with gcc 4.2.4). When I step through the code and get to the spot that crashes and try to inspect the value, I get a "value optimized out" in gdb. I read on the internet that this means that the value is stored in the register. I was wondering if my crash could be r...

gdb Input/Output error remote debugging to Android

I'm trying to debug an android app that call native code to do some GL rendering. The native code is existing code that I'm trying to port (and that I don't really know that well). I've got the existing code compiling, linking, and installing correctly, and I've got some native functions that call in to that code that are being correct...

pusha assembly language instruction

I am having a core dump which stack is corrupted. I try to disassemble it and found the following plz help me to anaylyse it .. (gdb) bt #0 0x55a63c98 in ?? () #1 0x00000000 in ?? () (gdb) disassemble 0x55a63c90 0x55a63ca8 Dump of assembler code from 0x55a63c90 to 0x55a63ca8: 0x55a63c90: add %cl,%dh 0x55a63c92: cmpsb %...

C Strange behaviour on 64-bit server

Hi, I have this strange behaviour in Apache post_config handler : int setup_module(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s) { //1 my_config_t *config = ap_get_module_config(s->module_config, &my_module); //2 log_me(config->logfp, apr_psprintf(ptemp, "My module version %s\n", MY_VERSION)); ...

gdb python scripting: where has `parse_and_eval` gone?

I had some scripts in Python to help me debugging with GDB that used the function gdb.parse_and_eval (still documented) to get the inferior values from the arguments passed to a scripted command, and now the module doesn't seem to have any trace of that function. Doing python import gdb; print dir(gdb) from GDB clearly shows that this fu...

Troubleshooting segmentation Fault

I am getting a segmentation fault in some C code, and I cannot figure out how to read this so I can figure out the problem.. Does anyone have any techniques that can help me? Does anything jump out to you? Here is gdb output: GNU gdb 6.8 for GNAT Pro 6.2.1 (20090115) [rev:143235] Copyright (C) 2008 Free Software Foundation, Inc. Lic...

Doing platform specific things in gdbinit

I develop on both mac and linux and have one network mounted home directory that is shared between them. On linux, it is useful to have the following in my .gdbinit: set print thread-events off Unfortunately, this errors on mac: (gdb) set print thread-events off Undefined set print command: "thread-events off". Try "help set print"...

What is an szone_error?

I see this sometimes in xcode console. ...

need help with conditional gdb debugging (of C code)

I have a C code similar to: int f() { for (int i = 0; i < 100; i++) { scanf flag; if(flag) scanf data1; scanf data2; } } I want to break the execution only when flag == 0. How should I set the breakpoint (using gdb)? ...

C++ Program Always Crashes While doing a std::string assign

I have been trying to debug a crash in my application that crashes (i.e. asserts a * glibc detected free(): invalid pointer: 0x000000000070f0c0 **) while I'm trying to do a simple assign to a string. Note that I'm compiling on a linux system with gcc 4.2.4 with an optimization level set to -O2. With -O0 the application no longer cras...

Does getting random SIGTRAP signals (in MinGW-gdb) is a sign of memory corruption?

I wrote my own reference counted memory manager c++ (for fun) and I'm sure it isn't perfect ;) . And now when I'm trying to use it I got random SIGTRAP signals. If I comment out every line which are in connection with that memory manager everything runs fine. Getting SIGTRAP-s instead of SIGSEGV is quite strange. I know that SIGTRAP-s ar...

Can I use GDB to debug a running process?

Under linux, can I use GDB to debug a process that is currently running? ...