* [PATCH] Specialize value_cast error message for Ada
@ 2019-06-18 15:00 Tom Tromey
2019-07-10 18:18 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2019-06-18 15:00 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
In Ada, the term for a cast is "type conversion". AdaCore has been
carrying a local patch to specialize the error message in value_cast,
but it seemed fine to me for this to be part of gdb. This also
removes a dead "return" statement.
gdb/ChangeLog
2019-06-18 Tom Tromey <tromey@adacore.com>
* valops.c (value_cast): Specialize error message for Ada.
---
gdb/ChangeLog | 4 ++++
gdb/valops.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/valops.c b/gdb/valops.c
index 948ad89fe92..0b32c5de9ef 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -555,8 +555,9 @@ value_cast (struct type *type, struct value *arg2)
return value_at_lazy (to_type, value_address (arg2));
else
{
+ if (current_language->la_language == language_ada)
+ error (_("Invalid type conversion."));
error (_("Invalid cast."));
- return 0;
}
}
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Specialize value_cast error message for Ada
2019-06-18 15:00 [PATCH] Specialize value_cast error message for Ada Tom Tromey
@ 2019-07-10 18:18 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2019-07-10 18:18 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
Tom> In Ada, the term for a cast is "type conversion". AdaCore has been
Tom> carrying a local patch to specialize the error message in value_cast,
Tom> but it seemed fine to me for this to be part of gdb. This also
Tom> removes a dead "return" statement.
Tom> gdb/ChangeLog
Tom> 2019-06-18 Tom Tromey <tromey@adacore.com>
Tom> * valops.c (value_cast): Specialize error message for Ada.
I'm checking this in now.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-10 18:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 15:00 [PATCH] Specialize value_cast error message for Ada Tom Tromey
2019-07-10 18:18 ` Tom Tromey
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).