From: JBWeeN <jbween@gmail.com>
To: gdb@sourceware.org
Subject: Problem Assining Values to Arrays in GDB 4.17
Date: Wed, 02 Apr 2008 16:32:00 -0000 [thread overview]
Message-ID: <a0c090600804020931y23b119c5n9b47bf1a6f4a0bcc@mail.gmail.com> (raw)
In-Reply-To: <a0c090600804020928v7e2ae98ey1a359889c5b1abc1@mail.gmail.com>
First of all, thanks for read my message.
I am having the following problem:
I am using GDB 4.17, I would like to upgrade it to a modern
version, but I am obliged.
In modern GDB releases I can assign directly values to an array
using the following sintax:
(gdb) set var myArray = {1.0, 2.0, 3.0, 4.0, 5.0,6.0}
But in this release (GDB 4.17) If I use the same command, I get the
following error:
(gdb) set var myArray = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}
Invalid Cast
Looking for information about the problem I found that I could
solve the problem doing a direct cast:
(gdb) set var myArray = {double *} {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}
I do not why, but this solution only works sometimes. Other times,
it appears the following error:
Cannot access memory at address 0x545f98.
It seems that GDB tries to modify myArray pointing to a new memory
address, but it is very strange that this new address not exists.
I know that I have another solution
(gdb) set myArray[0] = ...
(gdb) set myArray[1] = ...
(gdb) set myArray[2] = ...
(gdb) set myArray[3] = ...
But I have a lot of GDB scripts with a lot of arrays assignments
that use this syntax and I have to migrate them to GDB 4.17.
Is there any other way to assign array values directly?
Is there my only option to assing one by one? (I hope it is not)
Thanks for all,
Best Regards
next parent reply other threads:[~2008-04-02 16:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a0c090600804020928v7e2ae98ey1a359889c5b1abc1@mail.gmail.com>
2008-04-02 16:32 ` JBWeeN [this message]
2008-04-02 18:09 ` Michael Snyder
2008-04-03 5:33 ` JBWeeN
2008-04-03 21:48 ` Michael Snyder
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=a0c090600804020931y23b119c5n9b47bf1a6f4a0bcc@mail.gmail.com \
--to=jbween@gmail.com \
--cc=gdb@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