From: Pierre Muller <pierre@idefix.wisa.be>
To: gdb@sourceware.cygnus.com
Subject: [RFC] cygwin GDB "long long" return value error
Date: Wed, 03 Oct 2001 16:17:00 -0000 [thread overview]
Message-ID: <3.0.6.32.20011004012430.010f56b0@idefix.wisa.be> (raw)
The return value of a long long functions
in value_being_returned (called in finish command)
relies on the EXTRACT_RETURN_VALUE macro.
This macro has a correct implementation in config/i386/tm-i386.h
where 64bit integers are taken from the edx:eax pair.
But config/i386/tm-i386v.h overwrites this macro
by using memcpy on the register buffer, which then leads to
using ecx:eax as return value.
As cygwin version relies on tm-i386v.h,
the 64bit integers are wrong.
Do really some targets use ecx:eax, or is it just that
64bit was not considered at the time this macro was written?
Anyhow STORE_RETURN_VALUE in config/i386/tm-i386.h
suffers from the same error, the "long long" value will be copied
into ecx:eax instead of edx:eax
Simple test program :
long long
getval ()
{
return 0x030000524f;
}
int
main ()
{
long long i = getval ();
return 0;
}
Just put a break inside getval function
and use 'finish' or 'return 0x300000000'
to test if rading and writing works correctly.
The display of the return value might be
correct as it depends on the value contained in the ecx register.
Several other i386 targets seem to include tm-i386v.h
or use other function that also don't handle 64 bit
return value correctly (unless these targets use ecx:eax).
next reply other threads:[~2001-10-03 16:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pierre>
[not found] ` <Muller's>
[not found] ` <message>
[not found] ` <of>
[not found] ` <Thu,>
[not found] ` <04>
[not found] ` <Oct>
[not found] ` <2001>
[not found] ` <01:24:30>
[not found] ` <+0200>
2001-10-03 16:17 ` Pierre Muller [this message]
2001-10-04 12:08 ` Mark Kettenis
2001-10-05 3:12 ` [RFC/RFA] fix " Pierre Muller
2001-10-10 19:09 ` Christopher Faylor
2001-10-10 19:50 ` Stan Shebs
2001-10-11 21:33 ` Christopher Faylor
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=3.0.6.32.20011004012430.010f56b0@idefix.wisa.be \
--to=pierre@idefix.wisa.be \
--cc=gdb@sourceware.cygnus.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