[nemiver/follow-fork-mode: 31/35] Support BP setting to an address



commit 92ef80d671f9e3dc6655710f386bf95c0af6dd5f
Author: Dodji Seketeli <dodji gnome org>
Date:   Tue Apr 27 15:42:06 2010 +0200

    Support BP setting to an address
    
    	* src/persp/dbgperspective/glade/setbreakpointdialog.glade:
    	Add UI to set a breakpoint to a binary address.
    	* src/persp/dbgperspective/nmv-set-breakpoint-dialog.h:
    	(enum SetBreakpointDialog::Mode)<MODE_BINARY_ADDRESS>: New enum
    	member.
    	(SetBreakpointDialog::address): Declare accessor for the binary address.
    	* src/persp/dbgperspective/nmv-set-breakpoint-dialog.cc
    	(SetBreakpointDialog::Priv::Priv): Initialize the new
    	address entry and binary address radio button widgets of the
    	breakpoint setting dialog.
    	(SetBreakpointDialog::Priv::update_ok_button_sensitivity):
    	Handle the new MODE_BINARY_ADDRESS.
    	(SetBreakpointDialog::Priv::on_radiobutton_changed): Update
    	sensitivity for the address entry widget whenever the state of
    	one of the radio buttons changes. Remove useless code.
    	(SetBreakpointDialog::Priv::mode): Handle the new
    	MODE_BINARY_ADDRESS.
    	(SetBreakpointDialog::address): Define new accessors.
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc
    	(DBGPerspective::set_breakpoint_from_dialog): Handle setting a
    	breakpoint to an address.

 .../dbgperspective/glade/setbreakpointdialog.glade |  763 +++++++++++++-------
 src/persp/dbgperspective/nmv-dbg-perspective.cc    |   14 +-
 .../dbgperspective/nmv-set-breakpoint-dialog.cc    |   81 ++-
 .../dbgperspective/nmv-set-breakpoint-dialog.h     |    6 +
 4 files changed, 580 insertions(+), 284 deletions(-)
---
diff --git a/src/persp/dbgperspective/glade/setbreakpointdialog.glade b/src/persp/dbgperspective/glade/setbreakpointdialog.glade
index 48386fb..667b040 100644
--- a/src/persp/dbgperspective/glade/setbreakpointdialog.glade
+++ b/src/persp/dbgperspective/glade/setbreakpointdialog.glade
@@ -1,268 +1,499 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
+
 <glade-interface>
-  <widget class="GtkDialog" id="setbreakpointdialog">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Set Breakpoint</property>
-    <property name="modal">True</property>
-    <property name="default_width">300</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox">
-        <property name="visible">True</property>
-        <property name="spacing">6</property>
-        <child>
-          <widget class="GtkVBox" id="vbox3">
-            <property name="visible">True</property>
-            <property name="border_width">6</property>
-            <property name="spacing">6</property>
-            <child>
-              <widget class="GtkLabel" id="label7">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Set a Breakpoint:&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkAlignment" id="alignment2">
-                <property name="visible">True</property>
-                <child>
-                  <widget class="GtkTable" id="table4">
-                    <property name="visible">True</property>
-                    <property name="n_rows">8</property>
-                    <property name="n_columns">2</property>
-                    <property name="column_spacing">6</property>
-                    <property name="row_spacing">6</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <widget class="GtkEntry" id="conditionentry">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                      </widget>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">7</property>
-                        <property name="bottom_attach">8</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="label1">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Condition:</property>
-                      </widget>
-                      <packing>
-                        <property name="top_attach">7</property>
-                        <property name="bottom_attach">8</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkComboBox" id="combo_event">
-                        <property name="visible">True</property>
-                        <property name="items" translatable="yes"></property>
-                      </widget>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkRadioButton" id="eventradio">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="label" translatable="yes">_Event:</property>
-                        <property name="use_underline">True</property>
-                        <property name="response_id">0</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">functionnameradio</property>
-                      </widget>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">5</property>
-                        <property name="bottom_attach">6</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkEntry" id="lineentry">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="activates_default">True</property>
-                      </widget>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="label_line">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Line:</property>
-                        <property name="mnemonic_widget">lineentry</property>
-                      </widget>
-                      <packing>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkEntry" id="filenameentry">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="activates_default">True</property>
-                      </widget>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="label_filename">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Filename:</property>
-                        <property name="mnemonic_widget">filenameentry</property>
-                      </widget>
-                      <packing>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkRadioButton" id="sourcelocationradio">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="label" translatable="yes">_Source Location</property>
-                        <property name="use_underline">True</property>
-                        <property name="response_id">0</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">functionnameradio</property>
-                      </widget>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkEntry" id="functionentry">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="activates_default">True</property>
-                      </widget>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="label_function">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Function:</property>
-                        <property name="mnemonic_widget">filenameentry</property>
-                      </widget>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkRadioButton" id="functionnameradio">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="label" translatable="yes">F_unction Name:</property>
-                        <property name="use_underline">True</property>
-                        <property name="response_id">0</property>
-                        <property name="draw_indicator">True</property>
-                      </widget>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="cancelbutton">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-cancel</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-6</property>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkButton" id="okbutton">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-5</property>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
+
+<widget class="GtkDialog" id="setbreakpointdialog">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Set Breakpoint</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">True</property>
+  <property name="default_width">300</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">6</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox3">
+	  <property name="border_width">6</property>
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label7">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Set a Breakpoint:&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkAlignment" id="alignment2">
+	      <property name="visible">True</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xscale">1</property>
+	      <property name="yscale">1</property>
+	      <property name="top_padding">0</property>
+	      <property name="bottom_padding">0</property>
+	      <property name="left_padding">0</property>
+	      <property name="right_padding">0</property>
+
+	      <child>
+		<widget class="GtkTable" id="table4">
+		  <property name="visible">True</property>
+		  <property name="n_rows">10</property>
+		  <property name="n_columns">2</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">6</property>
+		  <property name="column_spacing">6</property>
+
+		  <child>
+		    <widget class="GtkEntry" id="lineentry">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â??</property>
+		      <property name="activates_default">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">4</property>
+		      <property name="bottom_attach">5</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkEntry" id="filenameentry">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â??</property>
+		      <property name="activates_default">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkEntry" id="functionentry">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â??</property>
+		      <property name="activates_default">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label8">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Condition:</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">1</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">conditionentry</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">9</property>
+		      <property name="bottom_attach">10</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkEntry" id="conditionentry">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â??</property>
+		      <property name="activates_default">False</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">9</property>
+		      <property name="bottom_attach">10</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkComboBox" id="combo_event">
+		      <property name="visible">True</property>
+		      <property name="items" translatable="yes"></property>
+		      <property name="add_tearoffs">False</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">8</property>
+		      <property name="bottom_attach">9</property>
+		      <property name="x_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="eventradio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Event:</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">7</property>
+		      <property name="bottom_attach">8</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkEntry" id="addressentry">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text" translatable="yes"></property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">â??</property>
+		      <property name="activates_default">False</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">6</property>
+		      <property name="bottom_attach">7</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="binarylocationradio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Binary Location:</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">eventradio</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">5</property>
+		      <property name="bottom_attach">6</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="sourcelocationradio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Source Location:</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">eventradio</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="functionnameradio">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">F_unction Name:</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">eventradio</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label9">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Address:</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">1</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">addressentry</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">6</property>
+		      <property name="bottom_attach">7</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label_filename">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Filename:</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">1</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">filenameentry</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label_function">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Function:</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">1</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">functionentry</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label_line">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Line:</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">1</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">lineentry</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">4</property>
+		      <property name="bottom_attach">5</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 7304d86..48950a0 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -7400,10 +7400,22 @@ DBGPerspective::set_breakpoint_from_dialog (SetBreakpointDialog &a_dialog)
             {
                 UString function = a_dialog.function ();
                 THROW_IF_FAIL (function != "");
+                LOG_DD ("setting breakpoint at function: " << function);
                 set_breakpoint (function, a_dialog.condition ());
                 break;
             }
 
+        case SetBreakpointDialog::MODE_BINARY_ADDRESS:
+            {
+                Address address = a_dialog.address ();
+                if (!address.empty ()) {
+                    LOG_DD ("setting breakpoint at address: "
+                            << address);
+                    set_breakpoint (address);
+                }
+                break;
+            }
+
         case SetBreakpointDialog::MODE_EVENT:
             {
                 UString event = a_dialog.event ();
@@ -7463,7 +7475,7 @@ DBGPerspective::set_breakpoint_using_dialog ()
         dialog.function (function_name);
     }
 
-    // Phiew. Enough set up for now. Time to launch the dialog and get the
+    // Pheew. Enough set up for now. Time to launch the dialog and get the
     // ball rolling.
     int result = dialog.run ();
     if (result != Gtk::RESPONSE_OK) {
diff --git a/src/persp/dbgperspective/nmv-set-breakpoint-dialog.cc b/src/persp/dbgperspective/nmv-set-breakpoint-dialog.cc
index 2cfe86e..b85a9d9 100644
--- a/src/persp/dbgperspective/nmv-set-breakpoint-dialog.cc
+++ b/src/persp/dbgperspective/nmv-set-breakpoint-dialog.cc
@@ -31,14 +31,14 @@
 #include <gtkmm/dialog.h>
 #include "common/nmv-exception.h"
 #include "common/nmv-env.h"
-#include "common/nmv-ustring.h"
+#include "common/nmv-str-utils.h"
 #include "nmv-set-breakpoint-dialog.h"
 #include "nmv-ui-utils.h"
 
 using namespace std;
 using namespace nemiver::common;
 
-namespace nemiver {
+NEMIVER_BEGIN_NAMESPACE (nemiver)
 
 class EventComboModelColumns
     : public Gtk::TreeModel::ColumnRecord
@@ -61,9 +61,11 @@ public:
     Gtk::Entry *entry_filename;
     Gtk::Entry *entry_line;
     Gtk::Entry *entry_function;
+    Gtk::Entry *entry_address;
     Gtk::Entry *entry_condition;
     Gtk::RadioButton *radio_source_location;
     Gtk::RadioButton *radio_function_name;
+    Gtk::RadioButton *radio_binary_location;
     Gtk::RadioButton *radio_event;
     Gtk::Button *okbutton;
 
@@ -74,8 +76,10 @@ public:
         entry_filename (0),
         entry_line (0),
         entry_function (0),
+        entry_address (0),
         radio_source_location (0),
         radio_function_name (0),
+        radio_binary_location (0),
         radio_event (0),
         okbutton (0)
     {
@@ -123,6 +127,13 @@ public:
                 (*this, &Priv::on_text_changed_signal));
         entry_function->set_activates_default ();
 
+        entry_address =
+            ui_utils::get_widget_from_glade<Gtk::Entry>
+                (a_glade, "addressentry");
+        entry_address->signal_changed ().connect (sigc::mem_fun
+              (*this, &Priv::on_text_changed_signal));
+        entry_address->set_activates_default ();
+
         entry_condition = ui_utils::get_widget_from_glade<Gtk::Entry>
                 (a_glade, "conditionentry");
         entry_condition->signal_changed ().connect (sigc::mem_fun
@@ -141,6 +152,12 @@ public:
         radio_function_name->signal_clicked ().connect (sigc::mem_fun
                 (*this, &Priv::on_radiobutton_changed));
 
+        radio_binary_location =
+            ui_utils::get_widget_from_glade<Gtk::RadioButton>
+                (a_glade, "binarylocationradio");
+        radio_binary_location->signal_clicked ().connect (sigc::mem_fun
+              (*this, &Priv::on_radiobutton_changed));
+
         radio_event =
             ui_utils::get_widget_from_glade<Gtk::RadioButton>
             (a_glade, "eventradio");
@@ -182,6 +199,15 @@ public:
                     okbutton->set_sensitive (false);
                 }
                 break;
+            case MODE_BINARY_ADDRESS: {
+                bool address_is_valid = false;
+                UString address = entry_address->get_text ();
+                // Validate the address
+                if (str_utils::string_is_number (address))
+                    address_is_valid = true;
+                okbutton->set_sensitive (address_is_valid);
+            }
+                break;
             default:
                 okbutton->set_sensitive (true);
                 break;
@@ -203,26 +229,16 @@ public:
         THROW_IF_FAIL (entry_filename);
         THROW_IF_FAIL (entry_line);
         THROW_IF_FAIL (entry_function);
+        THROW_IF_FAIL (entry_address);
 
         SetBreakpointDialog::Mode a_mode = mode ();
 
         entry_function->set_sensitive (a_mode == MODE_FUNCTION_NAME);
         entry_filename->set_sensitive (a_mode == MODE_SOURCE_LOCATION);
         entry_line->set_sensitive (a_mode == MODE_SOURCE_LOCATION);
+        entry_address->set_sensitive (a_mode == MODE_BINARY_ADDRESS);
         combo_event->set_sensitive (a_mode == MODE_EVENT);
         entry_condition->set_sensitive (a_mode != MODE_EVENT);
-
-        switch (a_mode) {
-            case MODE_SOURCE_LOCATION:
-            LOG_DD ("Setting Sensitivity for SOURCE_LOCATION");
-            break;
-        case MODE_FUNCTION_NAME:
-            LOG_DD ("Setting Sensitivity for FUNCTION_NAME");
-            break;
-        case MODE_EVENT:
-            LOG_DD ("Setting Sensitivity for EVENT");
-            break;
-        }
         update_ok_button_sensitivity ();
         NEMIVER_CATCH
     }
@@ -236,6 +252,7 @@ public:
         THROW_IF_FAIL (entry_line);
         THROW_IF_FAIL (entry_filename);
         THROW_IF_FAIL (entry_function);
+        THROW_IF_FAIL (entry_address);
 
         switch (a_mode) {
             case MODE_SOURCE_LOCATION:
@@ -248,6 +265,11 @@ public:
                 radio_function_name->set_active ();
                 entry_function->grab_focus ();
                 break;
+            case MODE_BINARY_ADDRESS:
+                LOG_DD ("Changing Mode to BINARY_ADDRESS");
+                radio_binary_location->set_active ();
+                entry_address->grab_focus ();
+                break;
             case MODE_EVENT:
                 LOG_DD ("Changing Mode to EVENT");
                 radio_event->set_active ();
@@ -279,8 +301,12 @@ public:
             return MODE_SOURCE_LOCATION;
         } else if (radio_event->get_active ()) {
             return MODE_EVENT;
-        } else {
+        } else if (radio_function_name->get_active ()) {
             return MODE_FUNCTION_NAME;
+        } else if (radio_binary_location->get_active ()) {
+            return MODE_BINARY_ADDRESS;
+        } else {
+            THROW ("Unreachable code reached");
         }
     }
 };//end class SetBreakpointDialog::Priv
@@ -345,6 +371,28 @@ SetBreakpointDialog::function (const UString &a_name)
     m_priv->entry_function->set_text (a_name);
 }
 
+Address
+SetBreakpointDialog::address () const
+{
+    THROW_IF_FAIL (m_priv);
+    THROW_IF_FAIL (m_priv->entry_address);
+
+    Address address;
+
+    UString str = m_priv->entry_address->get_text ();
+    if (str_utils::string_is_number (str))
+        address = str;
+    return address;
+}
+
+void
+SetBreakpointDialog::address (const Address &a)
+{
+    THROW_IF_FAIL (m_priv);
+    THROW_IF_FAIL (m_priv->entry_address);
+    m_priv->entry_address->set_text (a.to_string ());
+}
+
 UString
 SetBreakpointDialog::event () const
 {
@@ -393,5 +441,4 @@ SetBreakpointDialog::mode (Mode a_mode)
     m_priv->mode (a_mode);
 }
 
-}//end namespace nemiver
-
+NEMIVER_END_NAMESPACE (nemiver);
diff --git a/src/persp/dbgperspective/nmv-set-breakpoint-dialog.h b/src/persp/dbgperspective/nmv-set-breakpoint-dialog.h
index ac9fd92..dec234a 100644
--- a/src/persp/dbgperspective/nmv-set-breakpoint-dialog.h
+++ b/src/persp/dbgperspective/nmv-set-breakpoint-dialog.h
@@ -27,6 +27,7 @@
 #define __NEMIVER_SET_BREAKPOINT_DIALOG_H__
 
 #include "common/nmv-safe-ptr-utils.h"
+#include "common/nmv-address.h"
 #include "nmv-dialog.h"
 
 NEMIVER_BEGIN_NAMESPACE (nemiver)
@@ -37,6 +38,7 @@ class UString;
 
 using nemiver::common::UString;
 using nemiver::common::SafePtr;
+using nemiver::common::Address;
 
 class SetBreakpointDialog : public Dialog
 {
@@ -48,6 +50,7 @@ public:
     {
         MODE_SOURCE_LOCATION,
         MODE_FUNCTION_NAME,
+        MODE_BINARY_ADDRESS,
         MODE_EVENT
     };
 
@@ -63,6 +66,9 @@ public:
     UString function () const;
     void function (const UString &a_name);
 
+    Address address () const;
+    void address (const Address &);
+
     UString event () const;
     void event (const UString &a_event);
 



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