Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix printing frame arguments for COFF debug info
Date: Sat, 23 May 2009 10:37:00 -0000	[thread overview]
Message-ID: <83iqjst89t.fsf@gnu.org> (raw)
In-Reply-To: <20090521170502.GJ16152@adacore.com>

> Date: Thu, 21 May 2009 10:05:02 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
> 
> > > I see that this is addressed in one of your followup messages
> > 
> > Not really, no.  The followup messages deal with a different problem.
> > This issue, i.e. whether common_val_print and/or val_print should be
> > defensive about getting language_auto, still remains.  I'd like to
> > hear your opinion about that.
> 
> Ah yes, of course! We could add guards in the valprint routines,
> I supposed, but I'm not sure it's really worth the effort, now
> that we have fixed the cause.  The error is not crippling, so
> I personally wouldn't bother. But I wouldn't object either, especially
> if it's a small localized change (I think I'd make the change in
> val_print).

How about this:

2009-05-23  Eli Zaretskii  <eliz@gnu.org>

	* valprint.c (val_print): If LANGUAGE is "unknown" or "auto" or
	"local", fall back on current_language.


--- valprint.c~0	2009-03-21 07:03:53.000000000 +0200
+++ valprint.c	2009-05-23 13:33:14.062500000 +0300
@@ -257,6 +257,14 @@ val_print (struct type *type, const gdb_
       return (0);
     }
 
+  /* If the LANGUAGE argument we received is one of the placeholder
+     ``languages'', its la_val_print method will throw an error.  To
+     avoiding that, try falling back on current_language.  */
+  if ((language->la_language == language_unknown
+       || language->la_language == language_auto)
+      && language->la_language != current_language->la_language)
+    language = current_language;
+
   TRY_CATCH (except, RETURN_MASK_ERROR)
     {
       ret = language->la_val_print (type, valaddr, embedded_offset, address,


  reply	other threads:[~2009-05-23 10:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-16 16:51 Eli Zaretskii
2009-05-16 18:00 ` More problems with language in printing symbols Eli Zaretskii
2009-05-17 16:17   ` [RFA] " Eli Zaretskii
2009-05-20 23:07     ` Joel Brobecker
2009-05-23  9:26       ` Eli Zaretskii
2009-05-20 23:07 ` [RFA] Fix printing frame arguments for COFF debug info Joel Brobecker
2009-05-21  3:22   ` Eli Zaretskii
2009-05-21 17:05     ` Joel Brobecker
2009-05-23 10:37       ` Eli Zaretskii [this message]
2009-05-25  6:29         ` Joel Brobecker
2009-05-25 20:41           ` Eli Zaretskii
2009-05-25 22:55             ` Joel Brobecker
2009-05-29 12:07               ` Eli Zaretskii
2009-05-23  9:33   ` Eli Zaretskii

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=83iqjst89t.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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