Questions tagged [gdbinit]

34 questions
0
votes
0 answers

Finding argv address in GDB

I am trying to learn about how the stack works so I wrote a pretty simple C program to run through GDB and examine the stack: int main(int argc, char **argv) { char buf[100]; strcpy(buf, argv[1]); } I compiled the program and set a…
thomasdclark
  • 464
  • 1
  • 6
  • 22
0
votes
1 answer

How can I hook to the command x in gdb?

I've tried hooking to other commands such as echo and it works well. But when it comes to hooking the x command, it fails. Here's the codes inside of my .gdbinit file. set $pince_injection_failed = 1 set $pince_debugging_mode = 0 define hook-x if…
Korcan Karaokçu
  • 467
  • 4
  • 18
0
votes
1 answer

How do I get the .gdbinit command file needed by Eclipse for debugging?

My knowledge and experience in programming is still very fresh and basic, so please bear with me. I want to be able to use C++ on my MacBook (OS 10.9.5 Mavericks) via Eclipse, which I have already been using for Java previously. So I followed the…
Harmony
  • 3
  • 1
  • 3
-1
votes
1 answer

How can I include a string beginning with "define" in a multi-line Makefile variable?

In a GNU Makefile, I am defining the contents of a temporary file using multi-line variable syntax as follows: define __FOO__ file with many lines endef This file happens to be a GDB script, which supports function definitions with the following…
ardnew
  • 2,028
  • 20
  • 29
1 2
3