This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make "backtrace" doesn't print python stack if init python dir get fail

On Tue, 14 Jan 2014, Tom Tromey wrote:

> >>>>> "Hui" == Tom Tromey <> writes:
> I've appended my current patch.  It arranges to clear
> gdb_python_initialized if the second stage of initialization fails.
> And, it adds a check on gdb_python_initialized in a couple of spots that
> we missed before.
> However, it still isn't quite right, due to this code in
> finish_python_initialization:
>   if (gdb_python_module == NULL)
>     {
>       gdbpy_print_stack ();
>       /* 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);
>       do_cleanups (cleanup);
>       return;
>     }
> The question is -- what should we really do here?
> One option is to set gdb_python_initialized = 0.
> I think this makes the warning text obsolete, though, since the
> "limited" support would not actually be available at all (e.g., the
> "python" command wouldn't work at all).

I think the suggestion in the warning text is still good though?

> I lean toward the simpler solution of changing the warning message and
> clearing the flag.

I think so too, it makes things simpler for the user.  But in this
patch you deleted the warning, so not sure if the patch you posted is
your preferred solution?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]