[nemiver] Show frame obj name when there is no debug info
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver] Show frame obj name when there is no debug info
- Date: Wed, 8 Sep 2010 08:19:25 +0000 (UTC)
commit 1c66291ba6f3f394680d53f0d36542bfefaee898
Author: Dodji Seketeli <dodji redhat com>
Date: Wed Sep 8 00:02:10 2010 +0200
Show frame obj name when there is no debug info
* src/dbgengine/nmv-gdbmi-parser.cc
(GDBMIParser::parse_call_stack): Get the name of the library the
frame comes from. Stick it into Frame::library.
* src/persp/dbgperspective/nmv-call-stack.cc
(CallStackCols::Index): Reorganize the members of this enum.
(CallStack::Priv::build_widget): Add a "binary" column that
contains the name of the binary the frame symbol comes from. This
is only set if when no debug info is present. Make the columns
be resizable and reorderable.
(CallStack::Priv::append_frames_to_tree_view): Set the "binary"
column to the Frame::library() content.
src/dbgengine/nmv-gdbmi-parser.cc | 4 ++-
src/persp/dbgperspective/nmv-call-stack.cc | 53 +++++++++++++++------------
2 files changed, 32 insertions(+), 25 deletions(-)
---
diff --git a/src/dbgengine/nmv-gdbmi-parser.cc b/src/dbgengine/nmv-gdbmi-parser.cc
index 29f39c6..20dbc9e 100644
--- a/src/dbgengine/nmv-gdbmi-parser.cc
+++ b/src/dbgengine/nmv-gdbmi-parser.cc
@@ -2641,7 +2641,9 @@ GDBMIParser::parse_call_stack (const UString::size_type a_from,
frame.line (atol (value.c_str ()));
} else if ((*frame_part_iter)->variable () == "level") {
frame.level (atol (value.c_str ()));
- }
+ } else if ((*frame_part_iter)->variable () == "from") {
+ frame.library (value.c_str ());
+ }
}
THROW_IF_FAIL (frame.has_empty_address () != true);
stack.push_back (frame);
diff --git a/src/persp/dbgperspective/nmv-call-stack.cc b/src/persp/dbgperspective/nmv-call-stack.cc
index 6999e84..bbe001f 100644
--- a/src/persp/dbgperspective/nmv-call-stack.cc
+++ b/src/persp/dbgperspective/nmv-call-stack.cc
@@ -59,23 +59,29 @@ typedef SafePtr<Glib::Object, GObjectMMRef, GObjectMMUnref> GObjectMMSafePtr;
struct CallStackCols : public Gtk::TreeModelColumnRecord {
Gtk::TreeModelColumn<Glib::ustring> location;
Gtk::TreeModelColumn<Glib::ustring> address;
+ Gtk::TreeModelColumn<Glib::ustring> binary;
Gtk::TreeModelColumn<Glib::ustring> function_name;
Gtk::TreeModelColumn<Glib::ustring> function_args;
Gtk::TreeModelColumn<Glib::ustring> frame_index_caption;
Gtk::TreeModelColumn<int> frame_index;
Gtk::TreeModelColumn<bool> is_expansion_row;
+ /// Keep the enum in an order compatible with the how the diffent
+ /// columns are appended in CallStack::Priv::build_widget.
enum Index {
- LOCATION=0,
- ADDRESS,
- FUNCTION_NAME,
- FUNCTION_ARGS
+ FRAME_INDEX = 0,
+ FUNCTION_NAME_INDEX,
+ FUNCTION_ARGUMENTS_INDEX,
+ LOCATION_INDEX,
+ ADDRESS_INDEX,
+ BINARY_INDEX
};
CallStackCols ()
{
add (location);
add (address);
+ add (binary);
add (function_name);
add (function_args);
add (frame_index_caption);
@@ -529,44 +535,42 @@ struct CallStack::Priv {
Gtk::TreeView *tree_view = new Gtk::TreeView (store);
THROW_IF_FAIL (tree_view);
widget.reset (tree_view);
+ int nb_cols = 0;
tree_view->append_column (_("Frame"), columns ().frame_index_caption);
tree_view->append_column (_("Function"), columns ().function_name);
tree_view->append_column (_("Arguments"), columns ().function_args);
tree_view->append_column (_("Location"), columns ().location);
tree_view->append_column (_("Address"), columns ().address);
+ nb_cols = tree_view->append_column (_("Binary"), columns ().binary);
+ Gtk::TreeViewColumn *col = 0;
+ for (int i = 0; i < nb_cols; ++i) {
+ col = tree_view->get_column (i);
+ col->set_resizable ();
+ col->set_clickable ();
+ }
+
+ THROW_IF_FAIL (col = tree_view->get_column (CallStackCols::BINARY_INDEX));
+ col->get_first_cell_renderer ()->set_sensitive ();
+
tree_view->set_headers_visible (true);
+ tree_view->columns_autosize ();
tree_view->get_selection ()->set_mode (Gtk::SELECTION_SINGLE);
on_selection_changed_connection =
tree_view->get_selection ()->signal_changed ().connect
(sigc::mem_fun (*this,
&CallStack::Priv::on_selection_changed_signal));
+
tree_view->signal_row_activated ().connect
(sigc::hide (sigc::hide
- (sigc::mem_fun (*this,
- &CallStack::Priv::on_row_activated_signal))));
+ (sigc::mem_fun (*this,
+ &CallStack::Priv::on_row_activated_signal))));
tree_view->signal_expose_event ().connect_notify
(sigc::mem_fun (this, &Priv::on_expose_event_signal));
tree_view->add_events (Gdk::EXPOSURE_MASK);
- Gtk::TreeViewColumn* column =
- tree_view->get_column (CallStackCols::FUNCTION_NAME);
- THROW_IF_FAIL (column);
- column->set_clickable (false);
- column->set_reorderable (false);
-
- THROW_IF_FAIL (column = tree_view->get_column
- (CallStackCols::LOCATION));
- column->set_clickable (false);
- column->set_reorderable (false);
-
- THROW_IF_FAIL (column = tree_view->get_column
- (CallStackCols::FUNCTION_ARGS));
- column->set_clickable (false);
- column->set_reorderable (false);
-
tree_view->signal_button_press_event ().connect_notify
(sigc::mem_fun (*this,
&Priv::on_call_stack_button_press_signal));
@@ -662,14 +666,15 @@ struct CallStack::Priv {
store_iter = store->append ();
(*store_iter)[columns ().is_expansion_row] = false;
(*store_iter)[columns ().function_name] =
- a_frames[i].function_name ();
+ a_frames[i].function_name ();
if (!a_frames[i].file_name ().empty ()) {
(*store_iter)[columns ().location] =
a_frames[i].file_name () + ":"
+ UString::from_int (a_frames[i].line ());
}
(*store_iter)[columns ().address] =
- a_frames[i].address ().to_string ();
+ a_frames[i].address ().to_string ();
+ (*store_iter)[columns ().binary] = a_frames[i].library ();
(*store_iter)[columns ().frame_index] = a_frames[i].level ();
(*store_iter)[columns ().frame_index_caption] =
UString::from_int (a_frames[i].level ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]