[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bochs-cvs
Subject:    [Bochs-cvs] SF.net SVN: bochs:[11127] trunk/bochs
From:       vruppert () users ! sourceforge ! net
Date:       2012-04-06 13:15:27
Message-ID: E1SG90h-0003Iz-AP () sfp-svn-5 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 11127
          http://bochs.svn.sourceforge.net/bochs/?rev=11127&view=rev
Author:   vruppert
Date:     2012-04-06 13:15:27 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
- apply 'log actions by device' to the existing modules before editing them
  in the config interface. Applied settings are marked as 'done' with the value
  -1 to avoid unwanted modification. NOTE: Not all Bochs modules exist when
  running the start menu / dialog.

Modified Paths:
--------------
    trunk/bochs/bochs.h
    trunk/bochs/config.cc
    trunk/bochs/gui/siminterface.cc
    trunk/bochs/gui/siminterface.h
    trunk/bochs/gui/textconfig.cc
    trunk/bochs/gui/win32dialog.cc
    trunk/bochs/gui/wxdialog.cc
    trunk/bochs/main.cc

Modified: trunk/bochs/bochs.h
===================================================================
--- trunk/bochs/bochs.h	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/bochs.h	2012-04-06 13:15:27 UTC (rev 11127)
@@ -118,6 +118,7 @@
 int  bx_read_configuration(const char *rcfile);
 int  bx_write_configuration(const char *rcfile, int overwrite);
 void bx_reset_options(void);
+void bx_set_log_actions_by_device(bx_bool panic_flag);
 // special config parameter and options functions for plugins
 void bx_init_std_nic_options(const char *name, bx_list_c *menu);
 void bx_init_usb_options(const char *usb_name, const char *pname, int maxports);

Modified: trunk/bochs/config.cc
===================================================================
--- trunk/bochs/config.cc	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/config.cc	2012-04-06 13:15:27 UTC (rev 11127)
@@ -1984,7 +1984,7 @@
         if (mparam != NULL) {
           mparam->set(action);
         } else {
-          mparam = new bx_param_num_c(base, module, "", "", 0, BX_MAX_BIT32U, \
action); +          mparam = new bx_param_num_c(base, module, "", "", -1, \
BX_MAX_BIT32U, action);  if (mparam == NULL) {
             PARSE_ERR(("%s: %s: failed to add log module.", context, params[0]));
           }

Modified: trunk/bochs/gui/siminterface.cc
===================================================================
--- trunk/bochs/gui/siminterface.cc	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/gui/siminterface.cc	2012-04-06 13:15:27 UTC (rev 11127)
@@ -101,6 +101,9 @@
   virtual void set_default_log_action(int level, int action) {
     logfunctions::set_default_action(level, action);
   }
+  virtual void apply_log_actions_by_device() {
+    bx_set_log_actions_by_device(0);
+  }
   virtual const char *get_log_level_name(int level);
   virtual int get_max_log_level() { return N_LOGLEV; }
   virtual void quit_sim(int code);

Modified: trunk/bochs/gui/siminterface.h
===================================================================
--- trunk/bochs/gui/siminterface.h	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/gui/siminterface.h	2012-04-06 13:15:27 UTC (rev 11127)
@@ -610,6 +610,7 @@
   virtual void set_log_action(int mod, int level, int action) {}
   virtual int get_default_log_action(int level) {return -1;}
   virtual void set_default_log_action(int level, int action) {}
+  virtual void apply_log_actions_by_device() {}
   virtual const char *get_action_name(int action) {return 0;}
   virtual const char *get_log_level_name(int level) {return 0;}
   virtual int get_max_log_level() {return -1;}

Modified: trunk/bochs/gui/textconfig.cc
===================================================================
--- trunk/bochs/gui/textconfig.cc	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/gui/textconfig.cc	2012-04-06 13:15:27 UTC (rev 11127)
@@ -589,6 +589,7 @@
 
 void bx_log_options(int individual)
 {
+  SIM->apply_log_actions_by_device(); // settings from bochsrc
   if (individual) {
     int done = 0;
     while (!done) {

Modified: trunk/bochs/gui/win32dialog.cc
===================================================================
--- trunk/bochs/gui/win32dialog.cc	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/gui/win32dialog.cc	2012-04-06 13:15:27 UTC (rev 11127)
@@ -398,7 +398,7 @@
     for (level=0; level<N_LOGLEV; level++) {
       idx = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETCURSEL, 0, 0);
       value = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETITEMDATA, idx, \
                0);
-      SIM->set_log_action (mod, level, value);
+      SIM->set_log_action(mod, level, value);
     }
     EnableWindow(GetDlgItem(hDlg, IDDEVLIST), TRUE);
   } else {
@@ -425,6 +425,7 @@
   switch (msg) {
     case WM_INITDIALOG:
       advanced = (BOOL)lParam;
+      SIM->apply_log_actions_by_device(); // settings from bochsrc
       InitLogOptionsDialog(hDlg, advanced);
       changed = FALSE;
       EnableWindow(GetDlgItem(hDlg, IDAPPLY), FALSE);

Modified: trunk/bochs/gui/wxdialog.cc
===================================================================
--- trunk/bochs/gui/wxdialog.cc	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/gui/wxdialog.cc	2012-04-06 13:15:27 UTC (rev 11127)
@@ -304,7 +304,9 @@
   Center();
 }
 
-void AdvancedLogOptionsDialog::CopyParamToGui() {
+void AdvancedLogOptionsDialog::CopyParamToGui()
+{
+  SIM->apply_log_actions_by_device(); // settings from bochsrc
   bx_param_string_c *logfile = SIM->get_param_string(BXPN_LOG_FILENAME);
   SetLogfile(wxString(logfile->getptr(), wxConvUTF8));
   // copy log action settings from siminterface to gui

Modified: trunk/bochs/main.cc
===================================================================
--- trunk/bochs/main.cc	2012-04-06 09:41:58 UTC (rev 11126)
+++ trunk/bochs/main.cc	2012-04-06 13:15:27 UTC (rev 11127)
@@ -1044,9 +1044,9 @@
   DEV_after_restore_state();
 }
 
-void bx_set_log_action_by_device()
+void bx_set_log_actions_by_device(bx_bool panic_flag)
 {
-  int id, l, m;
+  int id, l, m, val;
   bx_list_c *loglev, *level;
   bx_param_num_c *action;
 
@@ -1056,10 +1056,15 @@
     for (m = 0; m < level->get_size(); m++) {
       action = (bx_param_num_c*) level->get(m);
       id = SIM->get_logfn_id(action->get_name());
+      val = action->get();
       if (id < 0) {
-        BX_PANIC(("unknown log function module '%s'", action->get_name()));
-      } else {
-        SIM->set_log_action(id, l, action->get());
+        if (panic_flag) {
+          BX_PANIC(("unknown log function module '%s'", action->get_name()));
+        }
+      } else if (val >= 0) {
+        SIM->set_log_action(id, l, val);
+        // mark as 'done'
+        action->set(-1);
       }
     }
   }
@@ -1272,7 +1277,7 @@
       SIM->get_param_bool(BXPN_RESTORE_FLAG)->set(0);
     }
   } else {
-    bx_set_log_action_by_device();
+    bx_set_log_actions_by_device(1);
   }
 
   // will enable A20 line and reset CPU and devices

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic