[patch][commit] Fix Small Bug in Dynamic Configuration

Dave Brolley <[email protected]>
Newsgroups gmane.comp.emulators.sid.devel
Message-ID <[email protected]>
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
sid-dynamic-config.ChangeLog (text/plain, 171 B)
2006-05-10  Dave Brolley  <[email protected]>

	* compConfig.cxx (function_jump_pin_handler): Assume a local branch if
	the function is already on the top of the stack.
sid-dynamic-config.patch.txt (text/plain, 1.4 KB)
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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.