Giter Club home page Giter Club logo

Comments (6)

krf avatar krf commented on July 28, 2024

Could you please try attached patch?

diff --git a/launcher/injector/gdbinjector.cpp b/launcher/injector/gdbinjector.cpp
index 7ab88ff..511e060 100644
--- a/launcher/injector/gdbinjector.cpp
+++ b/launcher/injector/gdbinjector.cpp
@@ -104,17 +104,24 @@ bool GdbInjector::startGdb(const QStringList &args)
 bool GdbInjector::injectAndDetach(const QString &probeDll, const QString &probeFunc)
 {
   Q_ASSERT(m_process);
+
+  // load the probe dll
 #ifndef Q_OS_MAC
   execGdbCmd("sha dl");
 #endif
   execGdbCmd(qPrintable(QString::fromLatin1("call (void) dlopen(\"%1\", %2)").
                         arg(probeDll).arg(RTLD_NOW)));
+
+  // call the probe inject function
 #ifndef Q_OS_MAC
+  // try this on non-mac systems, see ddd7c13f1272e72606396b61c910521041dfd2eb
   execGdbCmd(qPrintable(QString::fromLatin1("sha %1").arg(probeDll)));
-#endif
-//  execGdbCmd(qPrintable(QString::fromLatin1("call (void) %1()").arg(probeFunc)));
   execGdbCmd(qPrintable(QString::fromLatin1("print %1").arg(probeFunc)));
   execGdbCmd("call $()");
+#else
+  // try to use call function, see issue #10
+  execGdbCmd(qPrintable(QString::fromLatin1("call (void) %1()").arg(probeFunc)));
+#endif

   if (qgetenv("GAMMARAY_UNITTEST") != "1") {
     execGdbCmd("detach");

Copy this diff to file "diff", then apply with "patch -p1 < diff".

from gammaray.

tfar avatar tfar commented on July 28, 2024

Sorry for the delay but I've tried the patch today on latest source. Now it crashes instead:

Command line output:

$ /Users/tobias/gammaray/bin/gammaray
QProcess: Destroyed while process is still running.
ASSERT: "m_data == sortedProcesses" in file /Users/tobias/dev/rep/GammaRay/launcher/processmodel.cpp, line 102
[1]    9302 abort      /Users/tobias/gammaray/bin/gammaray

Backtrace:

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8653a212 **pthread_kill + 10
1   libsystem_c.dylib               0x00007fff89920b34 pthread_kill + 90
2   libsystem_c.dylib               0x00007fff89964dfa abort + 143
3   QtCore                          0x00000001018ef555 qt_message_output(QtMsgType, char const_) + 149
4   QtCore                          0x00000001018ef70d qt_message(QtMsgType, char const_, __va_list_tag_) + 381
5   QtCore                          0x00000001018ef92d qFatal(char const_, ...) + 141
6   QtCore                          0x00000001018ef97a qt_assert(char const_, char const_, int) + 26
7   gammaray                        0x000000010183b2c8 GammaRay::ProcessModel::mergeProcesses(QList<ProcData> const&) + 1176
8   gammaray                        0x0000000101838932 GammaRay::AttachDialog::updateProcessesFinished() + 194
9   QtCore                          0x00000001019fd201 QMetaObject::activate(QObject_, QMetaObject const_, int, void*_) + 2001
10  QtCore                          0x00000001018e9d06 QFutureWatcherBase::event(QEvent_) + 122
11  QtGui                           0x0000000101c80e98 QApplicationPrivate::notify_helper(QObject_, QEvent_) + 304
12  QtGui                           0x0000000101c81119 QApplication::notify(QObject_, QEvent_) + 603
13  QtCore                          0x00000001019e83d6 QCoreApplication::notifyInternal(QObject_, QEvent_) + 104
14  QtCore                          0x00000001019e87c3 QCoreApplicationPrivate::sendPostedEvents(QObject_, int, QThreadData_) + 557
15  com.apple.CoreFoundation        0x00007fff878a8841 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION** + 17
16  com.apple.CoreFoundation        0x00007fff878a8165 __CFRunLoopDoSources0 + 245
17  com.apple.CoreFoundation        0x00007fff878cb4e5 __CFRunLoopRun + 789
18  com.apple.CoreFoundation        0x00007fff878cadd2 CFRunLoopRunSpecific + 290
19  com.apple.HIToolbox             0x00007fff81bf4774 RunCurrentEventLoopInMode + 209
20  com.apple.HIToolbox             0x00007fff81bf4512 ReceiveNextEventCommon + 356
21  com.apple.HIToolbox             0x00007fff81bf43a3 BlockUntilNextEventMatchingListInMode + 62
22  com.apple.AppKit                0x00007fff88738fa3 _DPSNextEvent + 685
23  com.apple.AppKit                0x00007fff88738862 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
24  QtGui                           0x0000000101c3c9c1 QEventDispatcherMac::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 617
25  QtCore                          0x00000001019e5838 QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 394
26  QtGui                           0x00000001020bb673 QDialog::exec() + 243
27  gammaray                        0x0000000101830947 main + 1255
28  libdyld.dylib                   0x00007fff826247e1 start + 1

from gammaray.

krf avatar krf commented on July 28, 2024

Can anyone of the OSX guys reproduce this?

from gammaray.

winterz avatar winterz commented on July 28, 2024

tfar, ping. any update on this?

from gammaray.

tfar avatar tfar commented on July 28, 2024

K. Just tried most recent GammaRay from git. It built, but when i tried to attach it to a Qt program the command line showed this:

~/gammaray/bin/gammaray
QProcess: Destroyed while process is still running.
/Users/tobias/dev/rep/GammaRay/build/80461: No such file or directory
Unable to call function "gammaray_probe_inject" at 0x1604faaa0: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. 'print (float) fabs (3.0)')

from gammaray.

krf avatar krf commented on July 28, 2024

Closing because of lack of feedback.

from gammaray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.