public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Unable to register GDB Pretty Printers permanently.
Date: Mon, 14 Oct 2019 12:59:00 -0000	[thread overview]
Message-ID: <fa09c99c-04cf-4790-5324-b9e74c1f95a5@SystematicSw.ab.ca> (raw)
In-Reply-To: <CADW_+4DDn3e9LEQy=kZTRRpZEPXbO_B1PGA2_wbwjR2QhwjY-g@mail.gmail.com>

On 2019-10-14 04:32, Spellstaker wrote:
> I recently installed cygwin and the pretty printers for strings and vectors
> aren't registered by default like it is in mingw what should I do? Docs
> online suggest registering in .gdbinit file in home directory I did put
> that in home directory but to no avail I do get pretty printing when I
> manually register it tho But it isn't persistent
> 
> OS: Windows 10
> GDB: 8.2.1
> G++: 8.3.0

As documented under "$ info gdb Invoking Startup":
"To display the list of init files loaded by gdb at startup, you can
use 'gdb --help'."
$ gdb --help
...
At startup, GDB reads the following init files and executes their commands:

For more information, type "help" from within GDB, or consult the
GDB manual (available as on-line info or a printed manual).
Report bugs to "<http://www.gnu.org/software/gdb/bugs/>".

You can check the gdb configuration with:

$ gdb --configuration
This GDB was configured as follows:
   configure --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-python=/usr (relocatable)
             --without-guile
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --without-babeltrace

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)
$ gdb -q -iex 'show auto-load' -iex 'info auto-load' -iex q
gdb-scripts:  Auto-loading of canned sequences of commands scripts is on.
local-gdbinit:  Auto-loading of .gdbinit script from current directory is on.
python-scripts:  Auto-loading of Python scripts is on.
safe-path:  List of directories from which it is safe to auto-load files is
$debugdir:$datadir/auto-load.
scripts-directory:  List of directories from which to load auto-loaded scripts
is $debugdir:$datadir/auto-load.
gdb-scripts:  No auto-load scripts.
local-gdbinit:  Local .gdbinit file was not found.
python-scripts:  No auto-load scripts.

$ l /usr/lib/debug/usr/ /usr/share/gdb/
/usr/lib/debug/usr/:
bin/  sbin/

/usr/share/gdb/:
python/  syscalls/  system-gdbinit/

So it looks as though Cygwin gdb is configured and setup to source only startup
scripts from the current directory, but it may need to be or be added as a safe
path for that to work; or you create directory /usr/share/gdb/auto-load or
symlink that to a directory, and install startup scripts there; or create a gdb
alias to define scripts directory/-ies and execute init commands or files of
init commands with -iex and -ix:
$ alias gdb="/usr/bin/gdb -d "$GDB_SCRIPTS_DIR" -iex "add-auto-load-safe-path
$GDB_SCRIPTS_DIR" -ix $HOME/.gdbinit"

As you are running test releases, you can provide feedback on this list to the
Cygwin GDB maintainer about configuring, adding, or providing startup scripts,
where they are available on the web, under what licence, in which project.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      reply	other threads:[~2019-10-14 12:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 10:32 Unable to register " Spellstaker
2019-10-14 12:59 ` Brian Inglis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa09c99c-04cf-4790-5324-b9e74c1f95a5@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).