Valgrind produced a vgcore.NNNN file -- how do I debug the core using GDB? Do I need to use the original executable and supply the core, or is there some other way to do it?
Using valgrind as the root executable doesn't seem to work, and using the executable that was being run under valgrind directly in GDB with the core seems to produ...
Hi!
Below details are from a session in a sun machine.
$ file devli
devli: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
$ file a
a: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
$ gdb
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the ...
I have 2 methods in C++ class as follows:
class myClass {
public:
void operator()( string myString ) {
// Some code
}
void myMethod() { ... }
}
For a regular method, I can simply set the breakpoint in GDB as:
b myClass::myMethod
But how do I set the breakpoint for the first method?
UP...
void outputString(const char *str) {
cout << "outputString(const char *str) : " << str << endl;
}
turns out to be
Dump of assembler code for function _Z12outputStringPKc:
0x004013ee <_Z12outputStringPKc+0>: push ebp
0x004013ef <_Z12outputStringPKc+1>: mov ebp,esp
0x004013f1 <_Z12outputStringPKc+3>: sub esp,0x8
0x004...
Using gdb, I am trying to trace the function calls of a web server. I set breakpoints on every function call and when I tell gdb to 'run' it breaks at all the right places while the server starts up. Then gdb says 'Program ended with code 01' and doesn't stop at breakpoints anymore (obviously). However, the web server is still running.
...
I am trying to run the following code:
1. NSURL *checkLicenseURL = [NSURL URLWithString:@"check_license.php?accesskey=&license_key="];
// call server API
2. NSError *err = nil;
3. NSXMLDocument *xmlResult = [[NSXMLDocument alloc] initWithContentsOfURL:checkLicenseURL options:NSXMLDocumentTidyXML error:&err];
But when looking at variab...
It's mentioned in http://sourceware.org/ml/gdb/2007-06/msg00360.html before.
But no one seemed to have actually implemented this kind of idea.
Is there any obstacles for realizing this?
My requirements are the following:
Being able to plugin to any elf binary executable (ex. by using LD_PRELOAD)
The binary may be a multithreaded ex...
I have some compiled libraries on x86 Linux and I want to quickly determine whether they were compiled with debugging symbols.
...
I'm working on an embedded C++ application running on Linux. I've recently encountered some really strange performance problems with pthreads.
My system has 8 threads passing information back and forth protected using a pthread mutex lock. When running my application stand-alone, thread performance is abysmally slow when taking a mute...
I'm developing an iPhone application using mixed Obj-C and C++. It seems that sometimes the values of various fields are totally bogus as reported by gdb when stepping from an Obj-C file to a C++ file. For instance, in a method:
int count = 1;
for (int i = 0; i < count; ++i) {
int x = 0; // put a breakpoint here to see how many ti...
Hi.
I want to compile an application with debug information using gcc and gdb. When I do the following, the debug (.dSYM) files are generated correctly:
gcc -ggdb src/test.c -o build/test
If I, however, split this into a compile step and a link step, like this:
gcc -ggdb -c src/test.c -o build/test.o
gcc -ggdb build/test.o -o dist/b...
After switching from Ubuntu to CentOS 5.4 we came across a strange GDB behavior. Running application in debugger causes sem_wait() to return several (5-10) times with EINTR error.
I installed the latest GDB version but it did not solve the problem.
I suppose this is cause by some signal sent by GDB but I could not get any info in signal ...
Why is the following code giving segmentation fault?
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *file;
file = fopen("text","r");
if (file == NULL) printf("Error READING FILE");
if (ferror(file)) printf("error reading file"); //line 9
return 0;
}
Doing backtrace in gdb gives:-
> #0 0x00007ffff7...
When tab or !ls in command window in ddd, there're always a long list to display in the command window. However, unlike other pager behavior, ddd will not stop and let you hit enter or something to continue the list, it just display the whole list straight to the end. I wonder is there any setting related to this to control this noisy be...
Hi guys!
I tried today to find a bug in Thunderbird, or more specifically - the location where it crashes ( the Crash reporter jumps in ).
However when I try to run it in gdb, the program immediately exits with code 06.
And then the Crash reporter springs into action again.
This way, I can never get to the actual point where it dies.
I...
I'm trying to debug a simple stop-and-copy garbage collector (written in C) using GDB. The GC works by handling SIGBUS. I've set a breakpoint at the top of my SIGBUS signal handler. I've told GDB to pass SIGBUS to my program. However, it doesn't appear to work.
The following program (explained inline) shows the essence of my problem:
#...
Hello,
Does anyone know how to save gdb settings (like "set print pretty on" or "set print elements 0", both from here)? I don't want to set my configuration every time that I will use gdb :/
I searched in google and SO, but I found nothing.
Thanks.
...
I need to trace all instrutions of a program using gdb.
After every execution of a instruction, I want gdb invokes a specified function.
Is it a possiable work? How to achieve this?
I searched internet and found "stepi arg" command in gdb could step arg instructions.
But how to find total number of instructions?
After e...
I'm trying to debug a native shared library that my App uses through JNI. I can attach to a running app just fine with "gdbserver --attach pid" but i need to actually launch my app when i launch the gdbserver command.
There's a million blog hits on this topic but none of them seem to be clear as to how you launch your app. They all say ...
In Windows, it is possible to set the threadname via this code. The threadname is then shown in debuggers.
Under Linux, see this question.
In MacOSX, I have seen several hints which indicates that there are threadnames. I think the class NSThread also has a name-attribute. My goal is that I can set the threadname in my C++ application ...