Все вопросы: [gdb]

208 вопросов

похожие теги: ndk-gdbgdb-pythoncuda-gdb
2
голосов
3ответов
234 просмотров

Optimized code on Unix?

What is the best and easiest method to debug optimized code on Unix which is written in C? Sometimes we also don't have the code for building an unoptimized library.

10
голосов
3ответов
2109 просмотров

Anyone tried reverse-debugging in gdb?

Has anyone tried using the new record/replay and reverse-debugging features in the newly released gdb-7.0? I am one of the gdb developer/maintainers, and I'm very eager for user feedback!

3
голосов
1ответов
2400 просмотров

What does "dwarf2_read_address: Corrupted DWARF expression." mean?

I'm trying to do a little debugging in my iPhone project, and whenever i try to print out an object to see its description in one specific method i get this message in gdb: "dwarf2_read_address: Corrupted DWARF expression." Does anyone know why this happens and how i would go about fixin...

0
голосов
2ответов
600 просмотров

C code - need to clarify the effectiveness

Hi I have written a code based upon a requirement. (field1_6)(field2_30)(field3_16)(field4_16)(field5_1)(field6_6)(field7_2)(field8_1)..... this is one bucket(8 fields) of data. we will receive 20 buckets at a time means totally 160 fields. i need to take the values of field3,field7 & fiel...

28
голосов
2ответов
9837 просмотров

how can I put a breakpoint on "something is printed to the terminal" in gdb?

I would like to know from where inside a huge application a certain message is printed. The application is so big and old that it uses all conceivable ways of printing text to the terminal; for example printf(), fprintf(stdout, ...) etc. I write to put a breakpoint on the write() system call but...

2
голосов
3ответов
1817 просмотров

Can I use my gdb to debug an XCode project

I have a XCode which builds and runs under XCode. I would like to know if it is possible to debug it using a gdb I build under Mac OSX (gdb 7 to be specified). If yes, can you please tell me how can I do that? Thank you.

53
голосов
2ответов
81892 просмотров

How to print a null-terminated string with newlines without showing backslash escapes in gdb?

I have a variable char* x = "asd\nqwe\n ... " and I want to print it with newlines printed as newlines not backslash n. Is it possible?

5
голосов
1ответов
3074 просмотров

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 (F...

3
голосов
3ответов
1595 просмотров

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 so...

0
голосов
3ответов
1613 просмотров

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...

7
голосов
2ответов
3718 просмотров

Using gdb in Emacs 23

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 ...

48
голосов
2ответов
23145 просмотров

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...

6
голосов
2ответов
10123 просмотров

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. I tried to point to the GDB path, but it doesn't work. How do I set Qt Creator to debug using GDB?

138
голосов
12ответов
37896 просмотров

Most tricky/useful commands for gdb debugger

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

7
голосов
3ответов
4898 просмотров

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

40
голосов
2ответов
18377 просмотров

gdb - debugging with pipe

Say I have a two programs named blah and ret. I want to debug blah program which receives input from ret program via I/O redirection. How do I debug the blah program in the following case using gdb? bash> ret | blah

2
голосов
1ответов
4458 просмотров

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.m...

24
голосов
4ответов
5166 просмотров

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?

2
голосов
2ответов
2525 просмотров

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 ...

8
голосов
6ответов
15238 просмотров

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;...

16
голосов
3ответов
9619 просмотров

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 imple...

3
голосов
1ответов
774 просмотров

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

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

1
голосов
1ответов
553 просмотров

Switching between multiple stacks in gdb 6.3

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 an...

3
голосов
1ответов
976 просмотров

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?

4
голосов
1ответов
962 просмотров

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...

1
голосов
2ответов
1203 просмотров

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 u...

7
голосов
1ответов
14618 просмотров

std::string::assign() causes segfault

I have a std::vector<uint8_t> 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 2...

3
голосов
3ответов
4022 просмотров

Help interpreting gdb: segfault in function

I am trying to debug a segfault, and I have this output from gdb: (gdb) n Program received signal SIGSEGV, Segmentation fault. 0x08048af9 in parse_option_list (ptr=0x6f72505f <Address 0x6f72505f out of bounds>, box_name=0x696d6978 <Address 0x696d6978 out of bounds>, option_list=0x31...

4
голосов
2ответов
2348 просмотров

Is it possible to set a conditional breakpoint at the end of a function based on what the function is about to return?

I have a more complicated version of the following: unsigned int foo (); unsigned int bar (); unsigned int myFunc () { return foo()+bar(); } In my case, myFunc is called from lots of places. In one of the contexts there is something going wrong. I know from debugging further down what the...

10
голосов
5ответов
5398 просмотров

Xcode 3.2 + LLVM = no local symbols when debugging

I have a project for Mac OS X 10.5 that I'm building on 10.6 using Xcode 3.2. When I use GCC 4.2 for Debug build and hit a breakpoint, Xcode debugger displays local variable information normally. If I choose LLVM GCC 4.2 or Clang LLVM, when I hit breakpoint, local symbols are not available, and G...