public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Make chained function calls in expressions work
@ 2014-09-26 13:29 Siva Chandra
  2014-10-01  0:42 ` Siva Chandra
  0 siblings, 1 reply; 16+ messages in thread
From: Siva Chandra @ 2014-09-26 13:29 UTC (permalink / raw)
  To: gdb-patches

This patch series enables having chained function calls in
expressions. An example of a chained function call is shown in PR
c++/11606. It has an example of a chain of two function calls. This
patch series enables chains of any number of function calls.

Currently, an inferior function call is handled via
call_function_by_hand. The value returned by the inferior function is
copied into a GDB value whose lval_type is not_lval. Its contents are
stored within the value irrespective of whether the return value is in
inferior memory or in a register. Consequently, any subsequent
function call in the expression which requires this value's address as
an argument throws an error as the value is not in inferior memory.

This patch series keeps most of the current flow intact, except that
the value returned by the inferior function is made to be a new
lval_type called lval_mirrored_on_inferior_stack. These values have a
mirrored value of lval_type lval_memory which reside on the inferior
stack. They reside on the stack only for the duration for which the
expression is evaluated. This enables value_address to return the
address of the stack mirror instead of throwing an error.

Patch 1/2 - Adds new lval_type named lval_mirrored_on_inferior_stack.
Also adds support for values with this lval_type.
Patch 2/2 - Enables chained function calls by mirroring values
returned by inferior functions in the inferior stack.

Patch 2/2 only targets values returned by call_function_by_hand. I
think similar things can done for call_internal_function and
call_xmethod. I will extend the idea to these functions as well after
this patch series is approved (if at all).

Thanks,
Siva Chandra

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-10-23 23:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 13:29 [PATCH 0/2] Make chained function calls in expressions work Siva Chandra
2014-10-01  0:42 ` Siva Chandra
2014-10-01 13:15   ` Ulrich Weigand
2014-10-01 18:05     ` Siva Chandra
2014-10-01 18:26       ` Siva Chandra
2014-10-20 16:01         ` Ulrich Weigand
2014-10-20 19:56           ` Siva Chandra
2014-10-21 11:15             ` Ulrich Weigand
2014-10-21 20:30               ` Siva Chandra
2014-10-21 21:07                 ` Siva Chandra
2014-10-22 17:00                 ` Ulrich Weigand
2014-10-23 15:07                   ` Siva Chandra
2014-10-23 16:09                     ` Ulrich Weigand
2014-10-23 23:31                       ` Siva Chandra
2014-10-09  0:02   ` Siva Chandra
2014-10-15 13:43     ` Siva Chandra

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).