public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Hui Zhu <hui_zhu@mentor.com>,
	gdb-patches ml <gdb-patches@sourceware.org>,
	       Phil Muldoon <pmuldoon@redhat.com>
Subject: Re: [PATCH] Make "backtrace" doesn't print python stack if init python dir get fail
Date: Tue, 14 Jan 2014 21:32:00 -0000	[thread overview]
Message-ID: <20140114213218.GA24832@localhost.localdomain> (raw)
In-Reply-To: <87ha96wje5.fsf@fleche.redhat.com>

On Tue, 14 Jan 2014, Tom Tromey wrote:

> >>>>> "Hui" == Tom Tromey <tromey@redhat.com> 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?

Cheers,

Phil

  reply	other threads:[~2014-01-14 21:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 17:35 Hui Zhu
2013-12-02 16:05 ` Tom Tromey
2013-12-03  7:30   ` Hui Zhu
2013-12-03 20:27     ` Tom Tromey
2013-12-04  7:41       ` Hui Zhu
2013-12-11 17:07         ` Tom Tromey
2013-12-13 11:49           ` Hui Zhu
2014-01-14 16:09             ` Tom Tromey
2014-01-14 17:41               ` Tom Tromey
2014-01-14 21:32                 ` Phil Muldoon [this message]
2014-01-15 20:06                   ` Tom Tromey

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=20140114213218.GA24832@localhost.localdomain \
    --to=pmuldoon@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hui_zhu@mentor.com \
    --cc=tromey@redhat.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).