summaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2010-05-14 21:25:50 +0000
committerMichael Snyder <msnyder@specifix.com>2010-05-14 21:25:50 +0000
commit849e4de3f5a7651baf776d13e7c93cfe7f96cd56 (patch)
tree1664213f48ec648bea62ca4a7a31920853df8f06 /gdb/infcall.c
parentf14dc0aa828b0af6b18341cc6b3c031244eac8d3 (diff)
downloadgdb-849e4de3f5a7651baf776d13e7c93cfe7f96cd56.tar.gz
2010-05-14 Michael Snyder <msnyder@vmware.com>
* infcall.c: White space. * inf-child.c: White space. * infcmd.c: White space. * inferior.c: White space. * inf-loop.c: White space. * inflow.c: White space. * inline-frame.c: White space. * interps.c: White space.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 979d3eed2f6..0c9a3af7b88 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -268,10 +268,12 @@ find_function_addr (struct value *function, struct type **retval_type)
{
/* Handle function descriptors lacking debug info. */
int found_descriptor = 0;
+
funaddr = 0; /* pacify "gcc -Werror" */
if (VALUE_LVAL (function) == lval_memory)
{
CORE_ADDR nfunaddr;
+
funaddr = value_as_address (value_addr (function));
nfunaddr = funaddr;
funaddr = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
@@ -321,6 +323,7 @@ get_function_name (CORE_ADDR funaddr, char *buf, int buf_size)
{
{
struct symbol *symbol = find_pc_function (funaddr);
+
if (symbol)
return SYMBOL_PRINT_NAME (symbol);
}
@@ -328,6 +331,7 @@ get_function_name (CORE_ADDR funaddr, char *buf, int buf_size)
{
/* Try the minimal symbols. */
struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (funaddr);
+
if (msymbol)
return SYMBOL_PRINT_NAME (msymbol);
}
@@ -335,6 +339,7 @@ get_function_name (CORE_ADDR funaddr, char *buf, int buf_size)
{
char *tmp = xstrprintf (_(RAW_FUNCTION_ADDRESS_FORMAT),
hex_string (funaddr));
+
gdb_assert (strlen (tmp) + 1 <= buf_size);
strcpy (buf, tmp);
xfree (tmp);
@@ -483,6 +488,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
/* Ensure that the initial SP is correctly aligned. */
{
CORE_ADDR old_sp = get_frame_sp (frame);
+
if (gdbarch_frame_align_p (gdbarch))
{
sp = gdbarch_frame_align (gdbarch, old_sp);
@@ -641,6 +647,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
{
int i;
+
for (i = nargs - 1; i >= 0; i--)
{
int prototyped;
@@ -675,6 +682,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
if (struct_return || lang_struct_return)
{
int len = TYPE_LENGTH (values_type);
+
if (gdbarch_inner_than (gdbarch, 1, 2))
{
/* Stack grows downward. Align STRUCT_ADDR and SP after
@@ -737,6 +745,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
{
struct breakpoint *bpt;
struct symtab_and_line sal;
+
init_sal (&sal); /* initialize to zeroes */
sal.pspace = current_program_space;
sal.pc = bp_addr;