* value to function?
@ 2003-09-28 16:07 Andrew Cagney
2003-09-30 12:13 ` Jim Blandy
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2003-09-28 16:07 UTC (permalink / raw)
To: gdb
Hello,
If the proposal to pass a function value to push_dummy_call is going to
fly there's going to need to be a method that converts an arbitrary
value into a function/method value.
Kind of like find_function_addr() and the oposite of value_coerce_function.
Any way, does anyone have a name for such a function, and the code :-)
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: value to function?
2003-09-28 16:07 value to function? Andrew Cagney
@ 2003-09-30 12:13 ` Jim Blandy
2003-09-30 16:53 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Jim Blandy @ 2003-09-30 12:13 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb
Andrew Cagney <ac131313@redhat.com> writes:
> If the proposal to pass a function value to push_dummy_call is going
> to fly there's going to need to be a method that converts an arbitrary
> value into a function/method value.
A new gdbarch method to be called from where, specifically? This area
is a mess (just try describing the behavior of find_function_addr...),
so I'm not sure what you mean.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: value to function?
2003-09-30 12:13 ` Jim Blandy
@ 2003-09-30 16:53 ` Andrew Cagney
2003-10-01 6:01 ` Jim Blandy
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2003-09-30 16:53 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb
> Andrew Cagney <ac131313@redhat.com> writes:
>
>> If the proposal to pass a function value to push_dummy_call is going
>> to fly there's going to need to be a method that converts an arbitrary
>> value into a function/method value.
>
>
> A new gdbarch method to be called from where, specifically? This area
> is a mess (just try describing the behavior of find_function_addr...),
> so I'm not sure what you mean.
Now I think I'm missing something. What new architecture method? What
mess?
> Kind of like find_function_addr() and the oposite of value_coerce_function.
pre (I guess that value isn't void or NULL);
struct value *foo (struct value *);
post (VALUE_TYPE (foo (value)) == TYPE_CODE_FUNC
|| VALUE_TYPE (foo (value)) == TYPE_CODE_METHOD));
it would be used in relative proximity to push_dummy_call and
return_value (ex, replace find_function_addr).
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: value to function?
2003-09-30 16:53 ` Andrew Cagney
@ 2003-10-01 6:01 ` Jim Blandy
0 siblings, 0 replies; 4+ messages in thread
From: Jim Blandy @ 2003-10-01 6:01 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb
Andrew Cagney <ac131313@redhat.com> writes:
> > Andrew Cagney <ac131313@redhat.com> writes:
> >
> >> If the proposal to pass a function value to push_dummy_call is going
> >> to fly there's going to need to be a method that converts an arbitrary
> >> value into a function/method value.
> > A new gdbarch method to be called from where, specifically? This
> > area
> > is a mess (just try describing the behavior of find_function_addr...),
> > so I'm not sure what you mean.
>
> Now I think I'm missing something. What new architecture method?
> What mess?
Never mind. You said "there's going to need to be a method that
converts..." Since you said "method", I assumed you didn't mean
"function", so I was trying to figure out what sort of method you
meant.
> > Kind of like find_function_addr() and the oposite of value_coerce_function.
>
> pre (I guess that value isn't void or NULL);
> struct value *foo (struct value *);
> post (VALUE_TYPE (foo (value)) == TYPE_CODE_FUNC
> || VALUE_TYPE (foo (value)) == TYPE_CODE_METHOD));
>
> it would be used in relative proximity to push_dummy_call and
> return_value (ex, replace find_function_addr).
Sure, this is just a nicer packaging of find_function_addr, which
seems to be doing two separable jobs:
- coercing various non-function values into callable things, and
- extracting that callable thing's entry point address and return
type.
A function value carries both those data in a handy and obvious way.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-01 6:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-28 16:07 value to function? Andrew Cagney
2003-09-30 12:13 ` Jim Blandy
2003-09-30 16:53 ` Andrew Cagney
2003-10-01 6:01 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).