* [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree.
@ 2013-03-27 20:17 Doug Evans
2013-03-27 20:17 ` Tom Tromey
0 siblings, 1 reply; 5+ messages in thread
From: Doug Evans @ 2013-03-27 20:17 UTC (permalink / raw)
To: gdb-patches
Hi.
How about this for 7.6?
2013-03-27 Doug Evans <dje@google.com>
* python/python.c (finish_python_initialization): Provide suggestion
for how to tell gdb to find its python files.
Index: python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.111
diff -u -p -r1.111 python.c
--- python.c 12 Mar 2013 17:39:45 -0000 1.111
+++ python.c 27 Mar 2013 18:34:24 -0000
@@ -1714,6 +1714,7 @@ finish_python_initialization (void)
warning (_("Could not load the Python gdb module from `%s'."),
gdb_pythondir);
warning (_("Limited Python support is available from the _gdb module."));
+ warning (_("Suggest passing --data-directory=/path/to/gdb/data-directory."));
do_cleanups (cleanup);
return;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree.
2013-03-27 20:17 [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree Doug Evans
@ 2013-03-27 20:17 ` Tom Tromey
2013-03-27 20:44 ` Doug Evans
0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2013-03-27 20:17 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> 2013-03-27 Doug Evans <dje@google.com>
Doug> * python/python.c (finish_python_initialization): Provide suggestion
Doug> for how to tell gdb to find its python files.
It looks reasonable to me.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree.
2013-03-27 20:17 ` Tom Tromey
@ 2013-03-27 20:44 ` Doug Evans
2013-03-28 12:00 ` Joel Brobecker
0 siblings, 1 reply; 5+ messages in thread
From: Doug Evans @ 2013-03-27 20:44 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
Tom Tromey writes:
> >>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> 2013-03-27 Doug Evans <dje@google.com>
> Doug> * python/python.c (finish_python_initialization): Provide suggestion
> Doug> for how to tell gdb to find its python files.
>
> It looks reasonable to me.
>
> Tom
This is a minor improvement. I think the output is more readable.
E.g.
@ruffy2:gdb$ ./gdb
Python Exception <type 'exceptions.ImportError'> No module named gdb:
warning: Could not load the Python gdb module from `/usr/share/fsf-gdb/python'.
warning: Limited Python support is available from the _gdb module.
warning: Suggest passing --data-directory=/path/to/gdb/data-directory.
GNU gdb (GDB) 7.5.91.20130321-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) q
becomes:
@ruffy2:gdb$ ./gdb
Python Exception <type 'exceptions.ImportError'> No module named gdb:
warning:
Could not load the Python gdb module from `/usr/share/fsf-gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
GNU gdb (GDB) 7.5.91.20130321-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) q
Ok?
2013-03-27 Doug Evans <dje@google.com>
* python/python.c (finish_python_initialization): Provide suggestion
for how to tell gdb to find its python files.
Index: python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.111
diff -u -p -r1.111 python.c
--- python.c 12 Mar 2013 17:39:45 -0000 1.111
+++ python.c 27 Mar 2013 18:48:40 -0000
@@ -1711,9 +1711,13 @@ finish_python_initialization (void)
if (gdb_python_module == NULL)
{
gdbpy_print_stack ();
- warning (_("Could not load the Python gdb module from `%s'."),
+ /* This is passed in one call to warning so that blank lines aren't
+ inserted between each line of text. */
+ warning (_("\n"
+ "Could not load the Python gdb module from `%s'.\n"
+ "Limited Python support is available from the _gdb module.\n"
+ "Suggest passing --data-directory=/path/to/gdb/data-directory.\n"),
gdb_pythondir);
- warning (_("Limited Python support is available from the _gdb module."));
do_cleanups (cleanup);
return;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree.
2013-03-27 20:44 ` Doug Evans
@ 2013-03-28 12:00 ` Joel Brobecker
2013-03-28 19:46 ` Doug Evans
0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2013-03-28 12:00 UTC (permalink / raw)
To: Doug Evans; +Cc: Tom Tromey, gdb-patches
> 2013-03-27 Doug Evans <dje@google.com>
>
> * python/python.c (finish_python_initialization): Provide suggestion
> for how to tell gdb to find its python files.
FWIW, OK for me as well (commenting on the second version).
>
> Index: python.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/python/python.c,v
> retrieving revision 1.111
> diff -u -p -r1.111 python.c
> --- python.c 12 Mar 2013 17:39:45 -0000 1.111
> +++ python.c 27 Mar 2013 18:48:40 -0000
> @@ -1711,9 +1711,13 @@ finish_python_initialization (void)
> if (gdb_python_module == NULL)
> {
> gdbpy_print_stack ();
> - warning (_("Could not load the Python gdb module from `%s'."),
> + /* This is passed in one call to warning so that blank lines aren't
> + inserted between each line of text. */
> + warning (_("\n"
> + "Could not load the Python gdb module from `%s'.\n"
> + "Limited Python support is available from the _gdb module.\n"
> + "Suggest passing --data-directory=/path/to/gdb/data-directory.\n"),
> gdb_pythondir);
> - warning (_("Limited Python support is available from the _gdb module."));
> do_cleanups (cleanup);
> return;
> }
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree.
2013-03-28 12:00 ` Joel Brobecker
@ 2013-03-28 19:46 ` Doug Evans
0 siblings, 0 replies; 5+ messages in thread
From: Doug Evans @ 2013-03-28 19:46 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Tom Tromey, gdb-patches
On Wed, Mar 27, 2013 at 2:54 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> 2013-03-27 Doug Evans <dje@google.com>
>>
>> * python/python.c (finish_python_initialization): Provide suggestion
>> for how to tell gdb to find its python files.
>
> FWIW, OK for me as well (commenting on the second version).
Thanks. Committed to trunk and 7.6 branch.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-28 16:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-27 20:17 [RFA, RFA 7.6] Improve help for, e.g., running gdb in build tree Doug Evans
2013-03-27 20:17 ` Tom Tromey
2013-03-27 20:44 ` Doug Evans
2013-03-28 12:00 ` Joel Brobecker
2013-03-28 19:46 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox