From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: [patch] ada: Fix rashes on gdbarch garbage
Date: Mon, 21 Mar 2011 10:46:00 -0000 [thread overview]
Message-ID: <20110320203350.GA30841@host1.jankratochvil.net> (raw)
Hi Joel,
for gdb.ada/str_ref_cmp.exp on x86_64-fedora15-linux-gnu it turns:
(gdb) print String_Var (1 .. 3) = "Hel"
ERROR: Process no longer exists
UNRESOLVED: gdb.ada/str_ref_cmp.exp: print String_Var (1 .. 3) = "Hel"
->
(gdb) print String_Var (1 .. 3) = "Hel"
$1 = false
(gdb) FAIL: gdb.ada/str_ref_cmp.exp: print String_Var (1 .. 3) = "Hel"
GDB crashes the former way without this fix on:
gcc-gnat-4.6.0-0.14.fc15.x86_64
gcc-gnat-4.5.1-4.fc14.x86_64
I cannot test FSF gcc <=4.5 myself as its Ada build errors out for me on:
uintp.adb:242:22: expect type "Hnum" defined at line 91
GDB PASSes on these GNATs even without this fix but that is not the point:
GNAT 4.7.0 20110320 (experimental)
GNAT 4.6.0 20110320 (prerelease)
This is only a suggestion, I do not know much about the ada-* code.
Thanks,
Jan
gdb/
2011-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* ada-lang.c (replace_operator_with_call): Copy also GDBARCH.
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3661,6 +3661,7 @@ replace_operator_with_call (struct expression **expp, int pc, int nargs,
newexp->nelts = exp->nelts + 7 - oplen;
newexp->language_defn = exp->language_defn;
+ newexp->gdbarch = exp->gdbarch;
memcpy (newexp->elts, exp->elts, EXP_ELEM_TO_BYTES (pc));
memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen,
EXP_ELEM_TO_BYTES (exp->nelts - pc - oplen));
next reply other threads:[~2011-03-20 20:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 10:46 Jan Kratochvil [this message]
2011-03-21 15:06 ` Joel Brobecker
2011-03-21 15:39 ` Jan Kratochvil
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=20110320203350.GA30841@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--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