public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Adding Python files to be autoloaded for a particular architecture
@ 2020-07-17 16:11 Reuben Thomas
  2020-07-17 21:42 ` Joel Brobecker
  0 siblings, 1 reply; 11+ messages in thread
From: Reuben Thomas @ 2020-07-17 16:11 UTC (permalink / raw)
  To: gdb

I have implemented gdb/binutils support for a new architecture (more on
that if & when I get it into a state in which it might be mergeable), and I
would like to have some Python loaded by default, to cope with an unusual
feature of the architecture (it's a stack machine, and gdb doesn't seem to
support stacks directly, so I added some Python routines to print out and
modify the stack).

This seems to be a suitable candidate for SYSTEM_GDBINIT_FILES. But if I
simply add a file to `SYSTEM_GDBINIT_FILES` in
`gdb/data-directory/Makefile.in`, and then configure with

--with-system-gdbinit-dir=$pkgdatadir/system-gdbinit

then all of the files are installed (there are already two existing files,
`elinos.py` and `wrs-linux.py`) and loaded when gdb starts up. This causes
errors, as `wrs-linux.py` in particular expects to find an environment
variable which I have not set.

So I wonder how I should do this? Ideally, I would like to load a file when
gdb is configured for my new architecture, but I can't find a mechanism for
that. I tried running `make SYSTEM_GDBINIT_FILES="my_file.py", but this
environment variable does not get passed to make in `data-directory`, so
has no effect unless I specifically run `make` in that directory.

Apologies if I've overlooked something obvious. I have been impressed that
so far I have been able to add a new backend with gdb/ld/gas/bfd/opcodes
support with no documentation (well, I did cheat a bit, and referred to the
defunct Internals manual; but on the whole the code is fairly clearly laid
out, and simply picking an existing architecture and finding all references
to it provided enough guidance).

-- 
https://rrt.sc3d.org

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-07-20 21:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 16:11 Adding Python files to be autoloaded for a particular architecture Reuben Thomas
2020-07-17 21:42 ` Joel Brobecker
2020-07-17 22:03   ` Reuben Thomas
2020-07-17 22:09     ` Christian Biesinger
2020-07-17 22:21       ` Reuben Thomas
2020-07-17 22:31         ` Christian Biesinger
2020-07-17 22:37           ` Reuben Thomas
2020-07-20 20:26             ` Christian Biesinger
2020-07-20 21:39               ` Reuben Thomas
2020-07-17 22:14     ` Joel Brobecker
2020-07-17 22:18       ` Reuben Thomas

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).