Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org, Andreas Schwab <schwab@linux-m68k.org>
Subject: [patch] varobj.c: Reset string_print  [Re: [obv] varobj.c: Fix GCC false warning]
Date: Sun, 17 Oct 2010 11:54:00 -0000	[thread overview]
Message-ID: <20101017115358.GA15234@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <m21v7p6stb.fsf@whitebox.home>

On Sun, 17 Oct 2010 12:02:08 +0200, Andreas Schwab wrote:
> What happens if string_print is set but gdbpy_extract_lazy_string was
> not called?

I agree.

BTW this is unrelated to the [obv] fix, in fact GCC warned on a falsely
uninitialized value <! HAVE_PYTHON> and GCC missed a real uninitialized value
<HAVE_PYTHON>.

I guess this patch should fix it.
No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu.


Thanks,
Jan


gdb/
2010-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* varobj.c (value_get_print_value): Reset STRING_PRINT if STR_ADDR is
	not set.

--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -2557,9 +2557,14 @@ value_get_print_value (struct value *value, enum varobj_display_formats format,
 			make_cleanup (xfree, thevalue);
 		      }
 		    else
-		      gdbpy_print_stack ();
+		      {
+			gdbpy_print_stack ();
+			string_print = 0;
+		      }
 		  }
 	      }
+	    else
+	      string_print = 0;
 	    if (replacement)
 	      value = replacement;
 	  }


      reply	other threads:[~2010-10-17 11:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17  8:45 [obv] varobj.c: Fix GCC false warning Jan Kratochvil
2010-10-17 10:02 ` Andreas Schwab
2010-10-17 11:54   ` Jan Kratochvil [this message]

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=20101017115358.GA15234@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@linux-m68k.org \
    --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