Arch-abstraction:
- removed some x86-specific var/function names
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2843 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/core.h b/coregrind/core.h
index 68f16cc..c440f9e 100644
--- a/coregrind/core.h
+++ b/coregrind/core.h
@@ -1097,7 +1097,7 @@
Bool VG_(cpu_has_feature)(UInt feat);
-extern Int VG_(disBB) ( UCodeBlock* cb, Addr eip0 );
+extern Int VG_(disBB) ( UCodeBlock* cb, Addr ip0 );
/* ---------------------------------------------------------------------
Exports of vg_translate.c
@@ -1122,7 +1122,7 @@
Exports of vg_execontext.c.
------------------------------------------------------------------ */
-/* Records the PC and a bit of the call chain. The first 4 %eip
+/* Records the PC and a bit of the call chain. The first 4 IP
values are used in comparisons do remove duplicate errors, and for
comparing against suppression specifications. The rest are purely
informational (but often important). */
@@ -1183,7 +1183,7 @@
typedef struct _Segment Segment;
extern Bool VG_(is_object_file) ( const void *hdr );
-extern void VG_(mini_stack_dump) ( Addr eips[], UInt n_eips );
+extern void VG_(mini_stack_dump) ( Addr ips[], UInt n_ips );
extern SegInfo * VG_(read_seg_symbols) ( Segment *seg );
extern void VG_(symtab_incref) ( SegInfo * );
extern void VG_(symtab_decref) ( SegInfo *, Addr a, UInt len );
@@ -1238,8 +1238,8 @@
Char* VG_(build_child_VALGRINDCLO) ( Char* exename );
Char* VG_(build_child_exename) ( void );
-/* Determine if %esp adjustment must be noted */
-extern Bool VG_(need_to_handle_esp_assignment) ( void );
+/* Determine if SP adjustment must be noted */
+extern Bool VG_(need_to_handle_SP_assignment) ( void );
/* Called when some unhandleable client behaviour is detected.
Prints a msg and aborts. */
@@ -1333,7 +1333,7 @@
extern void VG_(unpad_address_space)(void);
extern REGPARM(1)
- void VG_(unknown_esp_update) ( Addr new_ESP );
+ void VG_(unknown_SP_update) ( Addr new_SP );
/* ---------------------------------------------------------------------
Exports of vg_proxylwp.c
@@ -1487,8 +1487,8 @@
// ---------------------------------------------------------------------
// For setting up the baseBlock
-extern void VGA_(init_low_baseBlock) ( Addr client_eip, Addr esp_at_startup );
-extern void VGA_(init_high_baseBlock) ( Addr client_eip, Addr esp_at_startup );
+extern void VGA_(init_low_baseBlock) ( Addr client_ip, Addr sp_at_startup );
+extern void VGA_(init_high_baseBlock) ( Addr client_ip, Addr sp_at_startup );
// Register state moving
extern void VGA_(load_state) ( arch_thread_t*, ThreadId tid );
@@ -1526,7 +1526,7 @@
const arch_thread_t* arch );
// Signal stuff
-extern void VGA_(push_signal_frame) ( ThreadId tid, Addr esp_top_of_frame,
+extern void VGA_(push_signal_frame) ( ThreadId tid, Addr sp_top_of_frame,
const vki_ksiginfo_t *siginfo,
void *handler, UInt flags,
const vki_ksigset_t *mask);
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index 4ab53e2..69fa47a 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -136,7 +136,7 @@
Int VG_(fd_soft_limit) = -1;
Int VG_(fd_hard_limit) = -1;
-/* As deduced from esp_at_startup, the client's argc, argv[] and
+/* As deduced from sp_at_startup, the client's argc, argv[] and
envp[] as extracted from the client's stack at startup-time. */
Int VG_(client_argc);
Char** VG_(client_argv);
@@ -913,7 +913,7 @@
| argv |
+-----------------+
| argc |
- lower address +-----------------+ <- esp
+ lower address +-----------------+ <- sp
| undefined |
: :
*/
@@ -2242,7 +2242,7 @@
offsets[i] = VG_(alloc_BaB_1_set)( addrs[i] );
}
-Bool VG_(need_to_handle_esp_assignment)(void)
+Bool VG_(need_to_handle_SP_assignment)(void)
{
return ( VG_(defined_new_mem_stack_4)() ||
VG_(defined_die_mem_stack_4)() ||
@@ -2262,16 +2262,16 @@
// The low/high split is for x86, so that the more common helpers can be
// in the first 128 bytes of the start, which allows the use of a more
// compact addressing mode.
-static void init_baseBlock ( Addr client_eip, Addr esp_at_startup )
+static void init_baseBlock ( Addr client_eip, Addr sp_at_startup )
{
- VGA_(init_low_baseBlock)(client_eip, esp_at_startup);
+ VGA_(init_low_baseBlock)(client_eip, sp_at_startup);
/* Allocate slots for compact helpers */
assign_helpers_in_baseBlock(VG_(n_compact_helpers),
VG_(compact_helper_offsets),
VG_(compact_helper_addrs));
- VGA_(init_high_baseBlock)(client_eip, esp_at_startup);
+ VGA_(init_high_baseBlock)(client_eip, sp_at_startup);
#define REG(kind, size) \
if (VG_(defined_##kind##_mem_stack##size)()) \
@@ -2289,8 +2289,8 @@
REG(die, );
#undef REG
- if (VG_(need_to_handle_esp_assignment)())
- VG_(register_noncompact_helper)((Addr) VG_(unknown_esp_update));
+ if (VG_(need_to_handle_SP_assignment)())
+ VG_(register_noncompact_helper)((Addr) VG_(unknown_SP_update));
VGOFF_(helper_undefined_instruction)
= VG_(alloc_BaB_1_set)( (Addr) & VG_(helper_undefined_instruction));
@@ -2361,7 +2361,7 @@
}
// Global var used to pass local data to callback
-Addr esp_at_startup___global_arg = 0;
+Addr sp_at_startup___global_arg = 0;
static void build_segment_map_callback
( Addr start, UInt size, Char rr, Char ww, Char xx,
@@ -2396,7 +2396,7 @@
VG_TRACK( new_mem_startup, start, size, rr=='r', ww=='w', xx=='x' );
/* If this is the stack segment mark all below %esp as noaccess. */
- r_esp = esp_at_startup___global_arg;
+ r_esp = sp_at_startup___global_arg;
vg_assert(0 != r_esp);
if (is_stack_segment) {
if (0)
@@ -2546,7 +2546,7 @@
ToolInfo *toolinfo = NULL;
void *tool_dlhandle;
Addr client_eip;
- Addr esp_at_startup; /* client's %esp at the point we gained control. */
+ Addr sp_at_startup; /* client's SP at the point we gained control. */
UInt * client_auxv;
VgSchedReturnCode src;
Int exitcode = 0;
@@ -2665,13 +2665,13 @@
//--------------------------------------------------------------
{
void* init_sp = argv - 1;
- esp_at_startup = setup_client_stack(init_sp, cl_argv, env, &info,
- &client_auxv);
+ sp_at_startup = setup_client_stack(init_sp, cl_argv, env, &info,
+ &client_auxv);
}
if (0)
printf("entry=%p client esp=%p vg_argc=%d brkbase=%p\n",
- (void*)client_eip, (void*)esp_at_startup, vg_argc,
+ (void*)client_eip, (void*)sp_at_startup, vg_argc,
(void*)VG_(brk_base));
//==============================================================
@@ -2732,12 +2732,12 @@
//--------------------------------------------------------------
// Build segment map (all segments)
- // p: setup_client_stack() [for 'esp_at_startup']
+ // p: setup_client_stack() [for 'sp_at_startup']
// p: init tool [for 'new_mem_startup']
//--------------------------------------------------------------
- esp_at_startup___global_arg = esp_at_startup;
+ sp_at_startup___global_arg = sp_at_startup;
VG_(parse_procselfmaps) ( build_segment_map_callback ); /* everything */
- esp_at_startup___global_arg = 0;
+ sp_at_startup___global_arg = 0;
//--------------------------------------------------------------
// Protect client trampoline page (which is also sysinfo stuff)
@@ -2766,9 +2766,9 @@
// Set up baseBlock
// p: {pre,post}_clo_init() [for tool helper registration]
// load_client() [for 'client_eip']
- // setup_client_stack() [for 'esp_at_startup']
+ // setup_client_stack() [for 'sp_at_startup']
//--------------------------------------------------------------
- init_baseBlock(client_eip, esp_at_startup);
+ init_baseBlock(client_eip, sp_at_startup);
//--------------------------------------------------------------
// Search for file descriptors that are inherited from our parent
diff --git a/coregrind/vg_memory.c b/coregrind/vg_memory.c
index 629ee8d..bd1e76f 100644
--- a/coregrind/vg_memory.c
+++ b/coregrind/vg_memory.c
@@ -676,7 +676,7 @@
tracked by the tool, and one of the specialised cases (eg. new_mem_stack_4)
isn't used in preference */
REGPARM(1)
-void VG_(unknown_esp_update)(Addr new_SP)
+void VG_(unknown_SP_update)(Addr new_SP)
{
Addr old_SP = VG_(get_archreg)(R_STACK_PTR);
Int delta = (Int)new_SP - (Int)old_SP;
diff --git a/coregrind/vg_translate.c b/coregrind/vg_translate.c
index 54918b3..649bace 100644
--- a/coregrind/vg_translate.c
+++ b/coregrind/vg_translate.c
@@ -1930,7 +1930,7 @@
if (VG_(defined_new_mem_stack)() || \
VG_(defined_die_mem_stack)()) { \
uInstr1(cb, CCALL, 0, TempReg, u->val1); \
- uCCall(cb, (Addr) VG_(unknown_esp_update), \
+ uCCall(cb, (Addr) VG_(unknown_SP_update), \
1, 1, False); \
}
@@ -2536,7 +2536,7 @@
/* Add %ESP-update hooks if the tool requires them */
/* Nb: We don't print out this phase, because it doesn't do much */
- if (VG_(need_to_handle_esp_assignment)()) {
+ if (VG_(need_to_handle_SP_assignment)()) {
VGP_PUSHCC(VgpESPUpdate);
cb = vg_ESP_update_pass ( cb );
VGP_POPCC(VgpESPUpdate);