This is the mail archive of the
sid@sourceware.org
mailing list for the SID project.
[patch][commit] Fix Small Bug in Dynamic Configuration
- From: Dave Brolley <brolley at redhat dot com>
- To: sid at sources dot redhat dot com
- Date: Wed, 10 May 2006 16:39:04 -0400
- Subject: [patch][commit] Fix Small Bug in Dynamic Configuration
Hi,
I've committed the attached patch which fixes a small problem in the
tracking of the call stack during dynamic configuration. In
function_jump_pin_handler, if the target function is already on the top
of the stack, then it is a local branch.
This code is not used by any public ports yet, but the bug was exposed
by an internal port here at Red Hat.
Dave
2006-05-10 Dave Brolley <brolley@redhat.com>
* compConfig.cxx (function_jump_pin_handler): Assume a local branch if
the function is already on the top of the stack.
Index: sid/component/cfgroot/compConfig.cxx
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/component/cfgroot/compConfig.cxx,v
retrieving revision 1.86
diff -c -p -r1.86 compConfig.cxx
*** sid/component/cfgroot/compConfig.cxx 12 Mar 2006 20:56:23 -0000 1.86
--- sid/component/cfgroot/compConfig.cxx 5 May 2006 22:55:47 -0000
*************** dynamic_configurator_component::function
*** 1613,1620 ****
function_address_pin.drive (addr);
string function = loader->attribute_value("current-function");
! // If the current function is on the stack, then assume we're
! // returning to it, otherwise assume we're calling it.
for (vector < pair<string,unsigned> >::const_iterator it = config_stack.begin ();
it != config_stack.end ();
++it)
--- 1613,1626 ----
function_address_pin.drive (addr);
string function = loader->attribute_value("current-function");
! // If the current function is on top of the stack, then assume
! // a local branch.
! assert (config_stack.size () >= 1);
! if (config_stack.back ().first == function)
! return;
!
! // Otherwise, if the current function is not on the stack, then assume we're
! // calling it. Otherwise assume we're returning to it.
for (vector < pair<string,unsigned> >::const_iterator it = config_stack.begin ();
it != config_stack.end ();
++it)