This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Python pretty-printing [1/6]
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 7 Apr 2009 11:24:31 -0700
- Subject: Re: Python pretty-printing [1/6]
- References: <m3eiwabwut.fsf@fleche.redhat.com>
Hi Tom,
I hope this isn't too late a review to bring this up. I looked at
this series of patches last Friday, but I didn't have an internet
connection back then.
> 2009-01-25 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
> Tom Tromey <tromey@redhat.com>
>
> * configure, config.in: Regenerate.
> * configure.ac: Support for relocatable GDB datadir. Add
> --with-pythondir.
> * python/python.c (_initialize_python): Set pythondir or datadir
> as needed. Update sys.path.
> * maint.c (_initialize_maint_cmds): Add "maint set gdb_datadir".
> * defs.h (gdb_datadir): Declare.
> * main.c (gdb_datadir): New global.
> (captured_main): Initialize gdb_datadir.
I'm wondering whether we could implement this slightly differently.
Right now, this patch adds code that is conditional on wether some
macros are defined or not. For instance:
> +#ifdef PYTHONDIR
> + PyModule_AddStringConstant (gdb_module, "pythondir", PYTHONDIR);
> +#else
> + if (gdb_datadir)
> + PyModule_AddStringConstant (gdb_module, "datadir", gdb_datadir);
> +#endif
Can we change that, for instance by assuming that we always have
PYTHONDIR, and that by default, configure will set to the datadir?
I was going to comment on the ..._RELOCATABLE macro, but I see that
we're already using that idiom for at least the system gdbinit file.
--
Joel