From: Elena Zannoni <ezannoni@cygnus.com>
To: Jim Blandy <jimb@cygnus.com>
Cc: Elena Zannoni <ezannoni@cygnus.com>,
Michael Snyder <msnyder@cygnus.com>,
Daniel Jacobowitz <drow@mvista.com>,
gdb-patches@sources.redhat.com
Subject: Re: RFA: tolerate unavailable struct return values
Date: Tue, 18 Dec 2001 09:35:00 -0000 [thread overview]
Message-ID: <15391.22867.927756.592686@localhost.localdomain> (raw)
In-Reply-To: <npbsgx1lzd.fsf@zwingli.cygnus.com>
Jim Blandy writes:
> > Have you looked at the macro VALUE_RETURNED_FROM_STACK ? I defined that
> > long time ago for hppa. It looks like the rs6000-tdep.c tries to deal
> > with the same problem as well.
> >
> > Maybe we should clean up that code, which came in as part of the HP
> > merge :-(.
>
> Looking at the following code in infcmd.c:
>
> /* We cannot determine the contents of the structure because
> it is on the stack, and we don't know where, since we did not
> initiate the call, as opposed to the call_function_by_hand case */
> #ifdef VALUE_RETURNED_FROM_STACK
> value = 0;
> #ifdef UI_OUT
> ui_out_text (uiout, "Value returned has type: ");
> ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
> ui_out_text (uiout, ".");
> ui_out_text (uiout, " Cannot determine contents\n");
> #else /* UI_OUT */
> printf_filtered ("Value returned has type: %s.", TYPE_NAME (value_type));
> printf_filtered (" Cannot determine contents\n");
> #endif /* UI_OUT */
> #else
> value = value_being_returned (value_type, stop_registers, structure_return);
>
> and then at the following code in valops.c:
>
> #ifdef VALUE_RETURNED_FROM_STACK
> if (struct_return)
> return (value_ptr) VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
> #endif
>
> the stuff in infcmd.c looks backwards to me. Wasn't the intention to
> fall back to printing the type when VALUE_RETURNED_FROM_STACK is *not*
> defined?
Not all the times, no, it was meant to be only used by hpux. I didn't
have any way to test other targets when I wrote that, so I didn't want
to touch anything else (whether or not such other targets could
display the structre correctly). It should definitely be cleaned up.
>
> TYPE_NAME is just the structure tag; don't we want to print the
> `struct' or `union' there? The `type_print' function takes care of
> that.
>
Probably.
> Frankly, I don't even think it's that useful to print the type. The
> user knows what function was called, and can use `ptype' or `whatis'
> if they want to know the type.
I wanted it to be more informative, and remind the user of what the
result would have been, w/o them having to do an extra step.
Elena
next prev parent reply other threads:[~2001-12-18 17:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-19 20:48 Jim Blandy
2001-11-29 14:08 ` Jim Blandy
2001-11-29 14:19 ` Michael Snyder
2001-11-19 22:30 ` Michael Snyder
2001-11-29 14:37 ` Daniel Jacobowitz
2001-11-20 7:19 ` Daniel Jacobowitz
2001-11-30 12:48 ` Jim Blandy
2001-11-23 13:51 ` Jim Blandy
2001-11-30 13:33 ` Daniel Jacobowitz
2001-11-24 10:23 ` Daniel Jacobowitz
2001-11-30 13:51 ` Michael Snyder
2001-11-24 23:01 ` Michael Snyder
2001-12-12 11:27 ` Elena Zannoni
2001-12-17 15:09 ` Jim Blandy
2001-12-18 9:35 ` Elena Zannoni [this message]
[not found] ` <87667t2loj.fsf@creche.redhat.com>
2001-11-29 22:41 ` Jim Blandy
2001-11-21 8:07 ` Jim Blandy
2001-11-29 22:46 Jim Blandy
2001-11-21 13:10 ` Jim Blandy
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=15391.22867.927756.592686@localhost.localdomain \
--to=ezannoni@cygnus.com \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@cygnus.com \
--cc=msnyder@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