Questions tagged [gdbinit]

34 questions
1
vote
1 answer

How to execute commands conditionally in gdbinit functions

I have a gdb function, defined in gdbinit file: define myfunc set $retval = SOMEHOW_RET_VALUE_OF shell my-shell-command if $retval == 0 load my-output else echo command not succeeded, not doing anything.\n end end…
ceremcem
  • 3,900
  • 4
  • 28
  • 66
1
vote
0 answers

Is this a problematic design for gdb non-stop mode automation?

I've implemented this code in my .gdbinit file to make stop-requiring gdb commands work(such as x, set etc) define hook-x if $pince_debugging_mode == 0 interrupt end end define hook-stop if $pince_debugging_mode == 0 c & end end…
Korcan Karaokçu
  • 467
  • 4
  • 18
1
vote
1 answer

Invalid syntax gdbinit

I am trying to use the gdbinit file from https://github.com/gdbinit/Gdbinit while debugging some old fortran code. Everything works fine with GDB if I don't include the gdbinit file; however, when including the file I get the following error: Error…
Andrew
  • 693
  • 6
  • 19
1
vote
1 answer

How to configure GDB in Eclipse such that all prcoesses keep on running including the process being debugged?

I am new in C programming and I have been trying hard to customize an opensource tool written in C according to my organizational needs. IDE: Eclipse, Debugger: GDB, OS: RHEL The tool is multi-process in nature (main process executes first time and…
Rohit
  • 604
  • 1
  • 10
  • 25
1
vote
1 answer

.gdbinit file missing

Eclipse is not debugging my c++ code. It asked for a version of gdb. I fixed the path of gdb but .gdbinit file is still missing. I cant locate it. The debug process just terminates now. Does eclipse has an inbuilt .gdbinit file whose location i can…
user2058314
  • 19
  • 1
  • 1
  • 3
1
vote
1 answer

How to set arg using gdbinit but just when a specific binary is loaded in gdb?

How to set arg -d through the file ~/.gdbinit but just when a specific binary is loaded in gdb?
Rodrigo Gurgel
  • 1,696
  • 2
  • 15
  • 32
1
vote
1 answer

Unable to set pending breakpoints in .gdbinit

gdb-6.8 In case of the program or library is not loaded, it's weird that manually setting pending breakpoints works, but not through .gdbinit. What could be wrong? [Manual way] (gdb) break foo.cc:111 No source file named foo.cc. Make breakpoint…
Stan
  • 37,207
  • 50
  • 124
  • 185
0
votes
1 answer

GDB --init-command - import python class

I have a very minimal understanding of Python. I am also not too experienced with GDB. I'm trying to use GDB's --init-command flag to initialize some set up for me. I have two processors to debug which require setting up a JLink debug server. Since…
Warpstar22
  • 567
  • 4
  • 19
0
votes
0 answers

How to switch to source mode when doing 'next' in gdb site:stackoverflow.com

I build a program with '-g', if I use this gdbinit, I type next will step to next instruction instead of step next line. I don't know what changed in that init file. Any advise?
VictorV
  • 637
  • 7
  • 16
0
votes
1 answer

How to load gdbinit while debugging?

When I start to debug with gdb I edit few breakpoints and commands into gdbinit file. How can I change this file and load it again while I debugging without detach from process?
Kokomelom
  • 143
  • 1
  • 10
0
votes
1 answer

How to use python into gdbinit script

I use gdbinit file to run few commands when gdb is init. How can I use there python command? Instead using x/x $pc I want to print with binascii 10 bytes after $PC register. How can I do that?
yfr24493AzzrggAcom
  • 159
  • 1
  • 2
  • 13
0
votes
1 answer

GDB is not taking the instruction placed in the ~/.gdbint and/or ~/.gdbrc file

I am using GDB to debug my C program. And since I am handling SIGUSR1 in my program. So once I run the gdb with my program executable like - gdb under the gdb prompt (gdb) I need to enter - handle SIGUSR1 nostop noprint pass since…
Darshan L
  • 824
  • 8
  • 30
0
votes
2 answers

How to do basic parameter passing in gdb

I have the following defined in my .gdbinit to make it easier to print "the stack" when I want to see it in decimal format: define s x/5gd $rsp end Now I can type in something like: >>> s 0x7fffffffe408: 10 8 0x7fffffffe418: 6 …
samuelbrody1249
  • 4,379
  • 1
  • 15
  • 58
0
votes
1 answer

GDB define command: print $arg1 doesn't print the correct value when in define

I want to define a new command which basically sets a breakpoint on a line, print a value of a certain variable and then continues execution. Unfortunately I am having issues. Here is the code I am using (gdb) define print_and_continue Type commands…
Bogi
  • 2,274
  • 5
  • 26
  • 34
0
votes
2 answers

Unable to source file from .gdbinit

I have a file ~/.gdb_bps containing GDB breakpoints. I generated this file with save breakpoints .gdb_bps. I'm trying to source this file when GDB starts by adding this line to ~/.gdbinit: source .gdb_bps When I start GDB I get the error: No…
builder-7000
  • 7,131
  • 3
  • 19
  • 43