aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/hw_init.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-06-20 13:32:34 +0000
committerAndrew Cagney <cagney@redhat.com>2003-06-20 13:32:34 +0000
commit601cecf016bc104dc20b12630be28d3a73767ba6 (patch)
treef178ead92957cc6cce09dcd2c34b0fa165ba2ba0 /sim/ppc/hw_init.c
parent8f3bab57754eb34346df536d6b7d5ec4a4255cbc (diff)
downloadgdb-601cecf016bc104dc20b12630be28d3a73767ba6.zip
gdb-601cecf016bc104dc20b12630be28d3a73767ba6.tar.gz
gdb-601cecf016bc104dc20b12630be28d3a73767ba6.tar.bz2
2003-06-20 Andrew Cagney <cagney@redhat.com>
* sim_calls.c (sim_create_inferior): Assert that psim_write_register succeeded. (sim_fetch_register, sim_store_register): Make "regname" constant. Delete Altivec hack. Return result from psim_read_register / psim_write_register. * psim.h (psim_read_register, psim_write_register): Change return type to int. Update comments. * psim.c: Update copyright. (psim_stack): Assert that the psim_read_register worked. (psim_read_register, psim_read_register): Return the register's size. Allocate the cooked buffer dynamically. * hw_register.c: Update copyright. (do_register_init): Check that psim_write_register succeeded. * hw_init.c: Update copyright. (create_ppc_elf_stack_frame, create_ppc_aix_stack_frame): Assert that the register transfer worked.
Diffstat (limited to 'sim/ppc/hw_init.c')
-rw-r--r--sim/ppc/hw_init.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/sim/ppc/hw_init.c b/sim/ppc/hw_init.c
index 86e753c..253ef7c 100644
--- a/sim/ppc/hw_init.c
+++ b/sim/ppc/hw_init.c
@@ -1,6 +1,6 @@
/* This file is part of the program psim.
- Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
+ Copyright 1994, 1997, 2003 Andrew Cagney
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -591,16 +591,16 @@ create_ppc_elf_stack_frame(device *me,
start_argv, start_envp);
/* set up the registers */
- psim_write_register(device_system(me), -1,
- &top_of_stack, "sp", cooked_transfer);
- psim_write_register(device_system(me), -1,
- &argc, "r3", cooked_transfer);
- psim_write_register(device_system(me), -1,
- &start_argv, "r4", cooked_transfer);
- psim_write_register(device_system(me), -1,
- &start_envp, "r5", cooked_transfer);
- psim_write_register(device_system(me), -1,
- &start_aux, "r6", cooked_transfer);
+ ASSERT (psim_write_register(device_system(me), -1,
+ &top_of_stack, "sp", cooked_transfer) > 0);
+ ASSERT (psim_write_register(device_system(me), -1,
+ &argc, "r3", cooked_transfer) > 0);
+ ASSERT (psim_write_register(device_system(me), -1,
+ &start_argv, "r4", cooked_transfer) > 0);
+ ASSERT (psim_write_register(device_system(me), -1,
+ &start_envp, "r5", cooked_transfer) > 0);
+ ASSERT (psim_write_register(device_system(me), -1,
+ &start_aux, "r6", cooked_transfer) > 0);
}
static void
@@ -619,16 +619,16 @@ create_ppc_aix_stack_frame(device *me,
create_ppc_elf_stack_frame(me, bottom_of_stack, argv, envp);
/* extract argument addresses from registers */
- psim_read_register(device_system(me), 0,
- &top_of_stack, "r1", cooked_transfer);
- psim_read_register(device_system(me), 0,
- &core_argc, "r3", cooked_transfer);
- psim_read_register(device_system(me), 0,
- &core_argv, "r4", cooked_transfer);
- psim_read_register(device_system(me), 0,
- &core_envp, "r5", cooked_transfer);
- psim_read_register(device_system(me), 0,
- &core_aux, "r6", cooked_transfer);
+ ASSERT (psim_read_register(device_system(me), 0,
+ &top_of_stack, "r1", cooked_transfer) > 0);
+ ASSERT (psim_read_register(device_system(me), 0,
+ &core_argc, "r3", cooked_transfer) > 0);
+ ASSERT (psim_read_register(device_system(me), 0,
+ &core_argv, "r4", cooked_transfer) > 0);
+ ASSERT (psim_read_register(device_system(me), 0,
+ &core_envp, "r5", cooked_transfer) > 0);
+ ASSERT (psim_read_register(device_system(me), 0,
+ &core_aux, "r6", cooked_transfer) > 0);
/* extract arguments from registers */
device_error(me, "Unfinished procedure create_ppc_aix_stack_frame\n");