[PATCH] 665498 - Assertion failure on program launch



I couldn't reproduce this bug on my system, but from the logs provided
by the reported, it have the impression that something in his
environment make the configuration manager to return a zero value for
the configuration key org.nemiver.default-num-asm-instrs.

This patch blindly makes sure that in cases like that, we fallback to
the proper default value, instead of wrongly using the value zero
value.

Tested on my system (not very useful as I didn't have the issue
locally) and applied to master.

commit 28dc0dbee155741cf18cc073f77c55dafc50cfc3
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sat Feb 18 22:59:29 2012 +0100

    665498 - Assertion failure on program launch
    
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc
    	(DBGPerspective::read_default_config):  Ensure that
    	m_priv->num_instr_to_disassemble is not zero.

diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 54c6544..4163cd8 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -4650,6 +4650,11 @@ DBGPerspective::read_default_config ()
                             m_priv->use_launch_terminal);
     conf_mgr.get_key_value (CONF_KEY_DEFAULT_NUM_ASM_INSTRS,
                             m_priv->num_instr_to_disassemble);
+    // m_priv->num_instr_to_disassemble should never be 0.  If it is,
+    // then something is wrong with the local configuration manager
+    // setup.
+    if (m_priv->num_instr_to_disassemble == 0)
+        m_priv->num_instr_to_disassemble = NUM_INSTR_TO_DISASSEMBLE;
     conf_mgr.get_key_value (CONF_KEY_ASM_STYLE_PURE,
                             m_priv->asm_style_pure);
     conf_mgr.get_key_value (CONF_KEY_PRETTY_PRINTING,

-- 
		Dodji


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]