Questions tagged [gdbinit]
34 questions
22
votes
2 answers
Loading .gdbinit from current directory fails with "auto-loading has been declined by your `auto-load safe-path'"
I'm having trouble loading a .gdbinit file located in the current directory. On starting gdb, I get this:
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later…

fragapanagos
- 629
- 1
- 7
- 13
9
votes
2 answers
Where to put .gdbinit in Windows?
And should it be called .gdbinit or gdb.ini?
I thought that I would try this file.
I am testing with Vectorcast, which uses MinGw. I copied the file with both names (.gdbinit and gdb.ini) to both the Vectorcast directory and it's MinGW bin…

Mawg says reinstate Monica
- 38,334
- 103
- 306
- 551
7
votes
1 answer
Can't disable pagination in gdb
I can't seem to disable pagination in gdb. I've read all of the various answers suggesting to add set pagination off or set height 0 or set height unlimited to my ~/.gdbinit file, and I've tried all of them, but gdb seems to be ignoring them all.…

MrAzzaman
- 4,734
- 12
- 25
6
votes
2 answers
how can I make gdb ignore .gdbinit
I have set up my ~/.gdbinit with some commands for a specific configuration.
Sometimes I would like to start gdb to ignore the .gdbinit.
Is there a mechanism to ignore .gdbinit or override it by another .gdbinit?

Krischu
- 1,024
- 2
- 15
- 35
4
votes
0 answers
Remote debug slow, how i can filter what libraries are loaded
I am trying to debug our code on remote server. Our code base is large and the bandwidth to the server from our office is quite slow. It is impossible to debug (each step takes from 10 seconds to few minutes).
The project is based on cpp, with CMake…

Ilia
- 534
- 3
- 21
4
votes
1 answer
how to have conditional part in gdbinit based on the environnment
In the gdb manual there is this part:
if else
This command allows to include in your script conditionally
executed commands. The if command takes a single argument, which is an
expression to evaluate...
I can perform tests in my gdbinit when I…

Guillaume
- 5,488
- 11
- 47
- 83
4
votes
1 answer
monitor linux dynamic library
I would like to monitor(debug) a linux dynamic library written in C.
I want to see when and what parameters are passed to it.
The library to monitor 'X', is invoked by another dynamic library 'Y'.
Both 'X and 'Y' appear in /proc/pid/maps of the…

user756235
- 65
- 3
3
votes
1 answer
GDB automate commands after symbols have been loaded
I'm debugging a microcontroller with GDB remote.
I have multiple build targets and I would like to have one generic .gdbinit file for flashing and/or debugging all the different targets.
I'm launching GDB with a BAT script where the debuggable .elf…

llahteinen
- 113
- 1
- 6
3
votes
1 answer
Make gdb read project specific .gdbinit when using Qt Creator
~/.gdbinit is loaded when I start a remote debugging session from Qt Creator.
How can I force gdb to load a project specific .gdbinit file?
I've added this line to ~/.gdbinit
set auto-load local-gdbinit on
and added an additional .gdbinit file to…

huysentruitw
- 27,376
- 9
- 90
- 133
2
votes
1 answer
Configure GDB to load specific symbols only
I have a huge monolith with more than 100 shared libraries. Some of them are so huge that if I let GDB load all the symbols, nearly all my PC RAM is filled up and I can do nothing else. So I want to disable loading all the libraries, and only load…

lightsunray
- 409
- 5
- 16
2
votes
1 answer
Track all variables for execution of function in gdb
I want to track the state of all the variables in a function in C.
I know I can use info commands in gdb to get all the variables state at the current context.
And I can use gdbinit to automate the gdb.
But what I want to do is set a breakpoint at…

sonic_maniac
- 59
- 10
2
votes
1 answer
GDB: Re-run program until it faults, answering prompts along the way
Issue
I am attempting to have gdb automatically debug a c program that I am reviewing, where there is a small, but real chance (ie: one in 10,000 chance) of a crash occurring due to a known bug. I contend with another engineer that it's serious…

Cloud
- 18,753
- 15
- 79
- 153
2
votes
0 answers
python import from gdbinit doesn't work
I have installed python-opencv and I can run import cv2 and check version without problems from a python shell.
When trying to source this python file in gdb to provide a new gdb command I always get:
(gdb) source…

oblitum
- 11,380
- 6
- 54
- 120
2
votes
2 answers
GDB pretty printing: Python Exception no codec search functions registered: can't find encoding
I tried to setup pretty-printing with gdb for STL from :
http://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/ and ran it according to the instructions
and fixed the issues of python as per the instructions at:
GDB pretty printing ImportError: No module…

user3443184
- 51
- 1
- 4
1
vote
1 answer
Get return from gdb exec
In .gdbinit I call to function
call open("tmp/test",1)
Then I got return value
$15 = 1
I want to use $15 to the next operation.
How can I got this var to the .gdbinit next line ?

user13145920
- 179
- 1
- 9