This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
tdep/1444: Return-value struct convention doesn't work with finish or return
- From: ac131313 at redhat dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 7 Nov 2003 19:05:14 -0000
- Subject: tdep/1444: Return-value struct convention doesn't work with finish or return
- Reply-to: ac131313 at redhat dot com
>Number: 1444
>Category: tdep
>Synopsis: Return-value struct convention doesn't work with finish or return
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 07 19:08:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: ac131313@redhat.com
>Release: generic
>Organization:
>Environment:
>Description:
Functions return values using two different conventions:
- register convention
The value is found in registers.
- struct return convention
The value is found in memory at an address specified by a an extra hidden first parameter.
Note: In the second case, the value isn't necessarially on the stack. Note: Small structures are often returned using the "register convention".
While, for the specific case of a return from an inferior function call, GDB can always knows the return value's location, that is not generally true. In particular, when the "struct-return convention" is used by normal functions, the return value can't typically be located. Consequently "return" and "finish" for such functions are EXPECTED to fail.
More notes:
The expected failures do not include small struct values returned using the register convention. Be careful to differentiate between these cases.
In theory, GDB always knows the return-value location of a function called by GDB and hence for such functions can handle the finish/return correctly. However, it might be easier to adopt the rule that finish/return simply don't work with any "struct-return convention" - it will avoid the mystery of why it works occasionally.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: