This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tdep/1444: Return-value struct convention doesn't work with finish or return


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]