[nemiver/gtk2-branch] Support user defined assembly syntax
- From: Fabien Parent <fparent src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/gtk2-branch] Support user defined assembly syntax
- Date: Mon, 1 Aug 2011 19:09:28 +0000 (UTC)
commit 482218b53f07497e87a9d4bb83e46d90d7b9debd
Author: Fabien Parent <parent f gmail com>
Date: Wed Jul 13 16:10:44 2011 +0200
Support user defined assembly syntax
* data/schemas/gconf/nemiver-dbgperspective.schemas: Add configuration key
* data/schemas/gsettings/org.nemiver.gschema.xml: Likewise
* src/confmgr/nmv-conf-keys.h: Likewise
* src/confmgr/nmv-gconf-keys-defs.cc: Likewise
* src/confmgr/nmv-gsettings-keys-defs.cc: Likewise
* src/dbgengine/nmv-gdb-engine.cc
(GDBEngine::Priv::launch_gdb_and_set_args): set the disassembly flavor
(GDBEngine::Priv::read_default_config): read the disassembly flavor from
the configuration.
(GDBEngine::Priv::on_conf_key_changed_signal): change the disassembly flavor
in case of change in the configuration.
data/schemas/gconf/nemiver-dbgperspective.schemas | 11 +++++++++++
data/schemas/gsettings/org.nemiver.gschema.xml | 6 ++++++
src/confmgr/nmv-conf-keys.h | 1 +
src/confmgr/nmv-gconf-keys-defs.cc | 2 ++
src/confmgr/nmv-gsettings-keys-defs.cc | 1 +
src/dbgengine/nmv-gdb-engine.cc | 10 ++++++++++
6 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/data/schemas/gconf/nemiver-dbgperspective.schemas b/data/schemas/gconf/nemiver-dbgperspective.schemas
index b5fdc2e..61e7cae 100644
--- a/data/schemas/gconf/nemiver-dbgperspective.schemas
+++ b/data/schemas/gconf/nemiver-dbgperspective.schemas
@@ -213,6 +213,17 @@
</locale>
</schema>
<schema>
+ <key>/schemas/apps/nemiver/dbgperspective/disassembly-flavor</key>
+ <applyto>/apps/nemiver/dbgperspective/disassembly-flavor</applyto>
+ <owner>nemiver</owner>
+ <type>string</type>
+ <default>att</default>
+ <locale name="C">
+ <short>Which instruction set to use for the assembly</short>
+ <long>Can be either att or intel (Apply only for the x86 family CPU)</long>
+ </locale>
+ </schema>
+ <schema>
<key>/schemas/apps/nemiver/dbgperspective/callstack-expansion-chunk</key>
<applyto>/apps/nemiver/dbgperspective/callstack-expansion-chunk</applyto>
<owner>nemiver</owner>
diff --git a/data/schemas/gsettings/org.nemiver.gschema.xml b/data/schemas/gsettings/org.nemiver.gschema.xml
index 836da13..ff491bb 100644
--- a/data/schemas/gsettings/org.nemiver.gschema.xml
+++ b/data/schemas/gsettings/org.nemiver.gschema.xml
@@ -114,6 +114,12 @@
<description>If a fork happens, follow the parent parent process if the key is set to 'parent', or follow the child process if the key is set to 'child'.</description>
</key>
+ <key name="disassembly-flavor" type="s">
+ <default>'att'</default>
+ <summary>Which instruction set to use for the assembly</summary>
+ <description>Can be either att or intel (Apply only for the x86 family CPU)</description>
+ </key>
+
<key name="callstack-expansion-chunk" type="i">
<default>25</default>
<summary>The size of the call stack to display</summary>
diff --git a/src/confmgr/nmv-conf-keys.h b/src/confmgr/nmv-conf-keys.h
index 7e38f98..d885377 100644
--- a/src/confmgr/nmv-conf-keys.h
+++ b/src/confmgr/nmv-conf-keys.h
@@ -55,6 +55,7 @@ extern const char* CONF_KEY_ASM_STYLE_PURE;
extern const char* CONF_KEY_GDB_BINARY;
extern const char* CONF_KEY_DEFAULT_NUM_ASM_INSTRS;
extern const char* CONF_KEY_FOLLOW_FORK_MODE;
+extern const char* CONF_KEY_DISASSEMBLY_FLAVOR;
extern const char* CONF_KEY_CONTEXT_PANE_LOCATION;
extern const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK;
diff --git a/src/confmgr/nmv-gconf-keys-defs.cc b/src/confmgr/nmv-gconf-keys-defs.cc
index 167de6c..38af25f 100644
--- a/src/confmgr/nmv-gconf-keys-defs.cc
+++ b/src/confmgr/nmv-gconf-keys-defs.cc
@@ -74,6 +74,8 @@ const char* CONF_KEY_GDB_BINARY =
"/apps/nemiver/dbgperspective/gdb-binary";
const char* CONF_KEY_FOLLOW_FORK_MODE =
"/apps/nemiver/dbgperspective/follow-fork-mode";
+const char* CONF_KEY_DISASSEMBLY_FLAVOR =
+ "/apps/nemiver/dbgperspective/disassembly-flavor";
const char* CONF_KEY_CONTEXT_PANE_LOCATION =
"/apps/nemiver/dbgperspective/context-pane-location";
const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK =
diff --git a/src/confmgr/nmv-gsettings-keys-defs.cc b/src/confmgr/nmv-gsettings-keys-defs.cc
index 6017f5f..cf0e184 100644
--- a/src/confmgr/nmv-gsettings-keys-defs.cc
+++ b/src/confmgr/nmv-gsettings-keys-defs.cc
@@ -56,6 +56,7 @@ const char* CONF_KEY_ASM_STYLE_PURE = "asm-style-pure";
const char* CONF_KEY_DEFAULT_NUM_ASM_INSTRS = "default-num-asm-instrs";
const char* CONF_KEY_GDB_BINARY = "gdb-binary";
const char* CONF_KEY_FOLLOW_FORK_MODE = "follow-fork-mode";
+const char* CONF_KEY_DISASSEMBLY_FLAVOR = "disassembly-flavor";
const char* CONF_KEY_CONTEXT_PANE_LOCATION = "context-pane-location";
const char* CONF_KEY_NEMIVER_CALLSTACK_EXPANSION_CHUNK =
"callstack-expansion-chunk";
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index de8871f..a849ae3 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -64,6 +64,7 @@ NEMIVER_BEGIN_NAMESPACE (nemiver)
extern const char* CONF_KEY_GDB_BINARY;
extern const char* CONF_KEY_FOLLOW_FORK_MODE;
+extern const char* CONF_KEY_DISASSEMBLY_FLAVOR;
// Helper function to handle escaping the arguments
static UString
@@ -216,6 +217,7 @@ public:
ILangTraitSafePtr lang_trait;
UString debugger_full_path;
UString follow_fork_mode;
+ UString disassembly_flavor;
GDBMIParser gdbmi_parser;
sigc::signal<void> gdb_died_signal;
sigc::signal<void, const UString& > master_pty_signal;
@@ -538,6 +540,7 @@ public:
cur_frame_level (0),
cur_thread_num (1),
follow_fork_mode ("parent"),
+ disassembly_flavor ("att"),
gdbmi_parser (GDBMIParser::BROKEN_MODE)
{
gdb_stdout_signal.connect (sigc::mem_fun
@@ -795,6 +798,7 @@ public:
if (!args.empty ())
issue_command (Command ("set args " + args));
set_debugger_parameter ("follow-fork-mode", follow_fork_mode);
+ set_debugger_parameter ("disassembly-flavor", disassembly_flavor);
return true;
}
@@ -888,6 +892,8 @@ public:
{
get_conf_mgr ()->get_key_value (CONF_KEY_FOLLOW_FORK_MODE,
follow_fork_mode);
+ get_conf_mgr ()->get_key_value (CONF_KEY_DISASSEMBLY_FLAVOR,
+ disassembly_flavor);
}
/// Lists the frames which numbers are in a given range.
@@ -1154,6 +1160,10 @@ public:
&& conf_mgr->get_key_value (a_key, follow_fork_mode, a_namespace)) {
set_debugger_parameter ("follow-fork-mode", follow_fork_mode);
}
+ else if (a_key == CONF_KEY_DISASSEMBLY_FLAVOR && conf_mgr->get_key_value
+ (a_key, disassembly_flavor, a_namespace)) {
+ set_debugger_parameter ("disassembly-flavor", disassembly_flavor);
+ }
NEMIVER_CATCH_NOX
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]