Skip to main content
Filter by
Sorted by
Tagged with
733 votes
9 answers
943k views

When running a program on GDB, usually, the arguments for the program are given at the run command. Is there a way to run the program using GDB and as well as give arguments within a shell script? I ...
drox's user avatar
  • 8,433
456 votes
4 answers
479k views

How can I print all global variables/local variables? Is that possible in gdb?
cpuer's user avatar
  • 7,913
284 votes
6 answers
228k views

I am running an application through gdb and I want to set a breakpoint for any time a specific variable is accessed / changed. Is there a good method for doing this? I would also be interested in ...
TJ Seabrooks's user avatar
  • 20.8k
261 votes
8 answers
446k views

How do I print the value of %eax and %ebp? (gdb) p $eax $1 = void
assem's user avatar
  • 3,261
253 votes
4 answers
292k views

Is there an equivalent command in GDB to that of WinDbg's !process 0 7? I want to extract all the threads in a dump file along with their backtraces in GDB. info threads doesn't output the stack ...
srikantha ks's user avatar
  • 2,531
241 votes
1 answer
197k views

Those who use Visual Studio will be familiar with the Shift + F11 hotkey, which steps out of a function, meaning it continues execution of the current function until it returns to its caller, at which ...
sashoalm's user avatar
  • 80.5k
226 votes
28 answers
139k views

Briefly: Does anyone know of a GUI for gdb that brings it on par or close to the feature set you get in the more recent version of Visual C++? In detail: As someone who has spent a lot of time ...
HappyDude's user avatar
  • 2,616
221 votes
5 answers
171k views

I usually run a program as : ./a.out arg1 arg2 <file I would like to debug it using gdb. I am aware of the set args functionality, but that only works from the gdb prompt.
user avatar
205 votes
3 answers
189k views

Can I specify that I want gdb to break at line x when char* x points to a string whose value equals "hello"? If yes, how?
341008's user avatar
  • 10.3k
178 votes
2 answers
104k views

When compiling C source code with either GCC or Clang, I always use the -g flag to generate debugging information for GDB. gcc -g -o helloworld helloworld.c I noticed that some people recommend -g3 ...
haziz's user avatar
  • 13.8k
173 votes
12 answers
151k views

My app runs fine but gdb fails to debug it with the following error (gdb) run Starting program: /path/to/app Unable to find Mach task port for process-id 83767: (os/kern) failure (0x5). I am on OS X ...
S B's user avatar
  • 8,434
159 votes
4 answers
225k views

I have to debug a program that has errors in it as part of my assignment. However, I must first pass command line arguments in order to solve this problem. I do: gdb -tui InsertionSortWithErrors ...
ShadyBears's user avatar
  • 4,237
158 votes
11 answers
60k views

OK, info break lists the breakpoints, but not in a format that would work well with reusing them using the --command as in this question. Does GDB have a method for dumping them into a file acceptable ...
casualcoder's user avatar
  • 5,080
156 votes
10 answers
169k views

I am running GDB and want to examine one of those unfortunate god objects. It takes many pages (and I have a 24" monitor turned sideways!) to see the whole thing. For ease of use, I'd like GDB to ...
pythonic metaphor's user avatar
152 votes
1 answer
153k views

Currently, when I print the value of a variable v in GDB (print v) I get an integer. Is it possible to have GDB print such integer variables in hexadecimal or binary?
Randomblue's user avatar
  • 117k
146 votes
3 answers
332k views

I am new to GDB, so I have some questions: How can I look at content of the stack? Example: to see content of register, I type info registers. For the stack, what should it be? How can I see the ...
user avatar
140 votes
12 answers
45k views

Can you post your most tricky and useful commands while you run a debugger like gdb or dbx.
138 votes
2 answers
149k views

0x0000000000400448 <main+0>: push %rbp 0x0000000000400449 <main+1>: mov %rsp,%rbp 0x000000000040044c <main+4>: mov $0x6,%eax 0x0000000000400451 <main+9>: ...
compile-fan's user avatar
  • 17.8k
134 votes
6 answers
137k views

I have the following stack trace. Is it possible to make out anything useful from this for debugging? Program received signal SIGSEGV, Segmentation fault. 0x00000002 in ?? () (gdb) bt #0 0x00000002 ...
Sangeeth Saravanaraj's user avatar
130 votes
4 answers
76k views

I'm working on a multithreaded application, and I want to debug it using GDB. Problem is, one of my threads keeps dying with the message: pure virtual method called terminate called without an ...
Ankur Sethi's user avatar
  • 3,618
127 votes
13 answers
57k views

On Unix, is there any way that one process can change another's environment variables (assuming they're all being run by the same user)? A general solution would be best, but if not, what about the ...
raldi's user avatar
  • 22.3k
123 votes
3 answers
82k views

Is it possible to inspect the return value of a function in gdb assuming the return value is not assigned to a variable?
fuad's user avatar
  • 4,493
122 votes
0 answers
4k views

Both gdb 7.7 and gbd 7.11 missed some shared libraries when debugging my device (oppo r7s). I've pulled all libraries to local. Here is a complete list of libraries shown by info shared (gdb) info ...
Joey.Z's user avatar
  • 4,938
119 votes
5 answers
232k views

I know that we can use several commands to access and read memory: for example, print, p, x... But how can I change the contents of memory at any specific location (while debugging in GDB)?
bits's user avatar
  • 8,410
113 votes
3 answers
149k views

I'm outside gdb's target executable and I don't even have a stack that corresponds to that target. I want to single-step anyway, so that I can verify what's going on in my assembly code, because I'm ...
Paul's user avatar
  • 1,886

1
2 3 4 5
234