|
From: <sv...@va...> - 2005-09-20 17:24:36
|
Author: sewardj
Date: 2005-09-20 18:24:19 +0100 (Tue, 20 Sep 2005)
New Revision: 4704
Log:
Initialise TT/TC after the tool's pre_clo_init is done, so as to
get the correct VG_(details).avg_translation_sizeB.
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-20 13:33:56 UTC (rev 4703=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-20 17:24:19 UTC (rev 4704=
)
@@ -2034,7 +2034,6 @@
VG_(exit)(1);
}
=20
-
//--------------------------------------------------------------
// Start up the address space manager, and determine the
// approximate location of the client's stack
@@ -2124,19 +2123,7 @@
VG_(debugLog_startup)(loglevel, "Stage 2 (second go)");
}
=20
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Can use VG_(malloc)() and VG_(arena_malloc)() only after load_tool=
()
- // -- redzone size is now set. This is checked by vg_malloc2.c.
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- =20
//--------------------------------------------------------------
- // Finalise address space layout
- // p: load_tool() [probably?]
- //--------------------------------------------------------------
- //VG_(debugLog)(1, "main", "Laying out remaining space\n");
- //layout_remaining_space( (Addr) & argc, VG_(tool_info).shadow_ratio =
);
-
- //--------------------------------------------------------------
// Load client executable, finding in $PATH if necessary
// p: pre_process_cmd_line_options() [for 'exec', 'need_help']
// p: layout_remaining_space [so there's space]
@@ -2145,14 +2132,6 @@
load_client(cl_argv, exec, need_help, &info, &initial_client_IP);
=20
//--------------------------------------------------------------
- // Everything in place, remove padding done by stage1
- // p: layout_remaining_space() [everything must be mapped in befor=
e now] =20
- // p: load_client() [ditto]=20
- //--------------------------------------------------------------
- //as_unpad((void *)VG_(shadow_end), (void *)~0, padfile);
- //as_closepadfile(padfile); // no more padding
-
- //--------------------------------------------------------------
// Set up client's environment
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options [for tool]
@@ -2213,8 +2192,27 @@
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
//--------------------------------------------------------------
+ // Init tool part 1: pre_clo_init
+ // p: setup_client_stack() [for 'VG_(client_arg[cv]']
+ // p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
+ // p: parse_procselfmaps [so VG segments are setup so tool c=
an
+ // call VG_(malloc)]
+ //--------------------------------------------------------------
+ {
+ Char* s;
+ Bool ok;
+ VG_(debugLog)(1, "main", "Initialise the tool part 1 (pre_clo_init=
)\n");
+ (VG_(tool_info).tl_pre_clo_init)();
+ ok =3D VG_(sanity_check_needs)( &s );
+ if (!ok) {
+ VG_(tool_panic)(s);
+ }
+ }
+
+ //--------------------------------------------------------------
// Initialise translation table and translation cache
- // p: aspacem
+ // p: aspacem [??]
+ // p: pre_clo_init [for 'VG_(details).avg_translation_sizeB']
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Initialise TT/TC\n");
VG_(init_tt_tc)();
@@ -2237,34 +2235,14 @@
setup_file_descriptors();
=20
//--------------------------------------------------------------
- // Build segment map (Valgrind segments only)
- // p: tl_pre_clo_init() [to setup new_mem_startup tracker]
- //--------------------------------------------------------------
- //VG_(debugLog)(1, "main", "Parse /proc/self/maps (round 1)\n");
- //VG_(parse_procselfmaps) ( build_valgrind_map_callback );
-
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Can use VG_(arena_malloc)() with non-CORE arena after segments set=
up
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-
- //--------------------------------------------------------------
- // Init tool: pre_clo_init, process cmd line, post_clo_init
+ // Init tool part 2: pre_clo_init
// p: setup_client_stack() [for 'VG_(client_arg[cv]']
// p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
// p: parse_procselfmaps [so VG segments are setup so tool c=
an
// call VG_(malloc)]
//--------------------------------------------------------------
- {
- Char* s;
- Bool ok;
- VG_(debugLog)(1, "main", "Initialise the tool\n");
- (VG_(tool_info).tl_pre_clo_init)();
- ok =3D VG_(sanity_check_needs)( &s );
- if (!ok) {
- VG_(tool_panic)(s);
- }
- }
=20
+ VG_(debugLog)(1, "main", "Initialise the tool part 2 (post_clo_init)\=
n");
// If --tool and --help/--help-debug was given, now give the core+too=
l
// help message
if (need_help) {
@@ -2275,21 +2253,6 @@
VG_TDICT_CALL(tool_post_clo_init);
=20
//--------------------------------------------------------------
- // Build segment map (all segments)
- // p: shadow/redzone segments
- // p: setup_client_stack() [for 'sp_at_startup']
- // p: init tool [for 'new_mem_startup']
- //--------------------------------------------------------------
- //VG_(debugLog)(1, "main", "Parse /proc/self/maps (round 2)\n");
- //sp_at_startup___global_arg =3D sp_at_startup;
- //VG_(parse_procselfmaps) ( build_segment_map_callback ); /* everyth=
ing */
- //sp_at_startup___global_arg =3D 0;
-
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Can use VG_(map)() after segments set up
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-
- //--------------------------------------------------------------
// Allow GDB attach
// p: process_cmd_line_options() [for VG_(clo_wait_for_gdb)]
//--------------------------------------------------------------
|