[PATCH v4] Backtrace via call detail

Alexander Monakov amonakov at ispras.ru
Mon May 13 05:28:34 PDT 2013



On Mon, 13 May 2013, José Fonseca wrote:

> BTW, another issue is that the "offset" values on linux are not really the
> offset from start of shared object, but the absolute address. Anyway, I
> think that using glibc backtrace for this is unsustainable long term, as it
> requires executables to be built with -rdynamic, and shared objects not to
> be built with -fvisibility=hidden, the exact opposite of common practice
> these days.  I don't know if there is a better alternative for runtime
> symbol resolution, otherwise I think we'll need to do offline symbol
> resolution on linux by default.

I'm working on replacing glibc backtrace with libbacktrace to address those
issues.  I presume you're OK with importing it to APITrace?

http://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libbacktrace


> One last request -- could you make it so that when one selects a call on
> qapitrace, the default lower pane is the "Details View" (instead of the
> "Backtrace").

diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index e46fce6..2891863 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -121,13 +121,6 @@ void MainWindow::callItemSelected(const QModelIndex &index)
 
     if (event && event->type() == ApiTraceEvent::Call) {
         ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
-        if (!call->backtrace().isNull()) {
-            m_ui.backtraceBrowser->setText(call->backtrace());
-            m_ui.backtraceDock->show();
-        }
-        else {
-            m_ui.backtraceDock->hide();
-        }
         m_ui.detailsDock->setWindowTitle(
             tr("Details View. Frame %1, Call %2")
             .arg(call->parentFrame() ? call->parentFrame()->number : 0)
@@ -157,6 +150,8 @@ void MainWindow::callItemSelected(const QModelIndex &index)
                 }
             }
         }
+        m_ui.backtraceBrowser->setText(call->backtrace());
+        m_ui.backtraceDock->setVisible(!call->backtrace().isNull());
         m_ui.vertexDataDock->setVisible(call->hasBinaryData());
         m_selectedEvent = call;
     } else {


More information about the apitrace mailing list