Break up VG_(show_BB_profile)(), and move half of it into m_main. This
removes m_transtab's dependence on m_translate (breaking a circular
dependence) and m_debuginfo, hooray.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4035 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
index 0f66a57..253f278 100644
--- a/coregrind/m_redir.c
+++ b/coregrind/m_redir.c
@@ -203,7 +203,9 @@
return ok;
}
-// Resolve a redir using any SegInfo if possible.
+// Resolve a redir using any SegInfo if possible. This is called whenever
+// a new sym-to-addr redir is created. It covers the case where a
+// replacement function is loaded after its replacee.
static Bool resolve_redir_with_existing_seginfos(CodeRedirect *redir)
{
const SegInfo *si;
@@ -219,7 +221,8 @@
}
// Resolve as many unresolved redirs as possible with this SegInfo. This
-// should be called when a new SegInfo symtab is loaded.
+// should be called when a new SegInfo symtab is loaded. It covers the case
+// where a replacee function is loaded after its replacement function.
void VG_(resolve_existing_redirs_with_seginfo)(SegInfo *si)
{
CodeRedirect **prevp = &unresolved_redirs;
@@ -287,7 +290,9 @@
TRACE_REDIR("REDIR sym to addr: %s:%s to %p", from_lib, from_sym, to_addr);
// Check against all existing segments to see if this redirection
- // can be resolved immediately. Then add it to the appropriate list.
+ // can be resolved immediately (as will be the case when the replacement
+ // function is loaded after the replacee). Then add it to the
+ // appropriate list.
if (resolve_redir_with_existing_seginfos(redir)) {
add_redir_to_resolved_list(redir);
} else {