[haiku-commits] haiku: hrev50159 - in src/apps/debugger: user_interface/gui/expression_eval_window arch/x86_64/disasm arch/x86/disasm debug_info src/apps

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 19 Mar 2016 21:33:30 +0100 (CET)

hrev50159 adds 5 changesets to branch 'master'
old head: 26c7e032ec916870139b3f91184be6f1abeea0f9
new head: 20122a6a7786a3d9402606d01ecf674c517ad01a
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=20122a6a7786+%5E26c7e032ec91

----------------------------------------------------------------------------

6e97df31a0a1: Debugger: Add team event handling to expression window.
  
  ExpressionEvaluationWindow:
  - Add team listener hooks for the various thread state changes.
  - Implement these to react accordingly and keep the thread/frame menus
    up to date with running program changes, whether due to user interaction
    in the main team window, or background activities of the debugged app.
    Previously the evaluation window needed to be closed and reopened to
    refresh these appropriately.

06c2f877e657: Debugger: Fix udis86 usage for resolving target address.
  
  DisassemblerX86{64}:
  - Fix problematic usage of udis86 that was broken during an update.
    Rather than calling the appropriate udis86 function to retrieve the
    operand, we were accessing it directly on the ud struct, which was
    fully filled in implicitly in previous versions of the library. However,
    in the updated version of udis86, the operands are only lazily decoded on
    request, and as such this data was invalid, leading to us not resolving
    target addresses properly. This primarily affected determining the location
    of return values.

4f21e03d0956: Debugger: Avoid unnecessary work in ThreadHandler.
  
  ThreadHandler:
  - When stepping over a function call, ensure that we actually have a valid
    value for the stepped over function address before adding a return value
    info entry. While this had no visible adverse effect, it did result in
    unnecessary work when creating the list of variables to display later,
    since such entries would have no valid function to resolve to, and thus
    had to be ignored/thrown away.

b679d8afa066: Debugger: Fix #12693.
  
  DwarfImageDebugInfo:
  - When resolving the address of a PIC function that a value was
    returned by, check if the resulting address actually belongs to
    the same image as the caller. If not, find the appropriate image
    for the new address. Combined with the previous commits, this fixes
    the issue that functions called indirectly by PLT entry that jumped
    to another image entirely wouldn't be mapped back to their
    corresponding FunctionDebugInfo instance, and thus would be skipped
    since we  couldn't determine a type to associate the return value with.

20122a6a7786: LegacyPackageInstaller: Fix x86_64 build.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

8 files changed, 264 insertions(+), 51 deletions(-)
build/jam/images/definitions/regular             |   2 +-
.../debugger/arch/x86/disasm/DisassemblerX86.cpp |  22 +-
.../arch/x86_64/disasm/DisassemblerX8664.cpp     |  38 ++--
src/apps/debugger/controllers/ThreadHandler.cpp  |   6 +-
.../debugger/debug_info/DwarfImageDebugInfo.cpp  |  12 +-
.../ExpressionEvaluationWindow.cpp               | 214 +++++++++++++++++--
.../ExpressionEvaluationWindow.h                 |  19 +-
src/apps/packageinstaller/UninstallView.cpp      |   2 +-

############################################################################

Commit:      6e97df31a0a18dc0ca522a0b8b4aae250e102760
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6e97df31a0a1
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Sun Nov 29 04:53:11 2015 UTC

Debugger: Add team event handling to expression window.

ExpressionEvaluationWindow:
- Add team listener hooks for the various thread state changes.
- Implement these to react accordingly and keep the thread/frame menus
  up to date with running program changes, whether due to user interaction
  in the main team window, or background activities of the debugged app.
  Previously the evaluation window needed to be closed and reopened to
  refresh these appropriately.

----------------------------------------------------------------------------

diff --git 
a/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.cpp
 
b/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.cpp
index b1877c4..e182a34 100644
--- 
a/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.cpp
+++ 
b/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2014-2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 #include "ExpressionEvaluationWindow.h"
@@ -10,7 +10,9 @@
 #include <String.h>
 #include <TextControl.h>
 
-#include "AutoLocker.h"
+#include <AutoDeleter.h>
+#include <AutoLocker.h>
+
 #include "CppLanguage.h"
 #include "FunctionDebugInfo.h"
 #include "FunctionInstance.h"
@@ -26,6 +28,9 @@
 
 
 enum {
+       MSG_THREAD_ADDED                                = 'thad',
+       MSG_THREAD_REMOVED                              = 'thar',
+
        MSG_THREAD_SELECTION_CHANGED    = 'thsc',
        MSG_FRAME_SELECTION_CHANGED             = 'frsc'
 };
@@ -144,6 +149,38 @@ ExpressionEvaluationWindow::MessageReceived(BMessage* 
message)
                        break;
                }
 
+               case MSG_THREAD_ADDED:
+               {
+                       int32 threadID;
+                       if (message->FindInt32("thread", &threadID) == B_OK)
+                               _HandleThreadAdded(threadID);
+                       break;
+               }
+
+               case MSG_THREAD_REMOVED:
+               {
+                       int32 threadID;
+                       if (message->FindInt32("thread", &threadID) == B_OK)
+                               _HandleThreadRemoved(threadID);
+                       break;
+               }
+
+               case MSG_THREAD_STATE_CHANGED:
+               {
+                       int32 threadID;
+                       if (message->FindInt32("thread", &threadID) == B_OK)
+                               _HandleThreadStateChanged(threadID);
+                       break;
+               }
+
+               case MSG_THREAD_STACK_TRACE_CHANGED:
+               {
+                       int32 threadID;
+                       if (message->FindInt32("thread", &threadID) == B_OK)
+                               _HandleThreadStackTraceChanged(threadID);
+                       break;
+               }
+
                default:
                        BWindow::MessageReceived(message);
                        break;
@@ -153,6 +190,43 @@ ExpressionEvaluationWindow::MessageReceived(BMessage* 
message)
 
 
 void
+ExpressionEvaluationWindow::ThreadAdded(const Team::ThreadEvent& event)
+{
+       BMessage message(MSG_THREAD_ADDED);
+       message.AddInt32("thread", event.GetThread()->ID());
+       PostMessage(&message);
+}
+
+
+void
+ExpressionEvaluationWindow::ThreadRemoved(const Team::ThreadEvent& event)
+{
+       BMessage message(MSG_THREAD_REMOVED);
+       message.AddInt32("thread", event.GetThread()->ID());
+       PostMessage(&message);
+}
+
+
+void
+ExpressionEvaluationWindow::ThreadStateChanged(const Team::ThreadEvent& event)
+{
+       BMessage message(MSG_THREAD_STATE_CHANGED);
+       message.AddInt32("thread", event.GetThread()->ID());
+       PostMessage(&message);
+}
+
+
+void
+ExpressionEvaluationWindow::ThreadStackTraceChanged(
+       const Team::ThreadEvent& event)
+{
+       BMessage message(MSG_THREAD_STACK_TRACE_CHANGED);
+       message.AddInt32("thread", event.GetThread()->ID());
+       PostMessage(&message);
+}
+
+
+void
 ExpressionEvaluationWindow::ValueNodeValueRequested(CpuState* cpuState,
        ValueNodeContainer* container, ValueNode* valueNode)
 {
@@ -240,6 +314,12 @@ 
ExpressionEvaluationWindow::_HandleThreadSelectionChanged(int32 threadID)
        fSelectedThread = fTeam->ThreadByID(threadID);
        if (fSelectedThread != NULL)
                fSelectedThread->AcquireReference();
+       else if (fThreadList->Menu()->FindMarked() == NULL) {
+               // if the selected thread was cleared due to a thread event
+               // rather than user selection, we need to reset the marked item
+               // to reflect the new state.
+               fThreadList->Menu()->ItemAt(0)->SetMarked(true);
+       }
 
        _UpdateFrameList();
 
@@ -287,6 +367,93 @@ 
ExpressionEvaluationWindow::_HandleFrameSelectionChanged(int32 index)
 
 
 void
+ExpressionEvaluationWindow::_HandleThreadAdded(int32 threadID)
+{
+       AutoLocker< ::Team> teamLocker(fTeam);
+       ::Thread* thread = fTeam->ThreadByID(threadID);
+       if (thread == NULL)
+               return;
+
+       if (thread->State() != THREAD_STATE_STOPPED)
+               return;
+
+       BMenuItem* item = NULL;
+       if (_CreateThreadMenuItem(thread, item) != B_OK)
+               return;
+
+       BMenu* threadMenu = fThreadList->Menu();
+       int32 index = 1;
+       // find appropriate insertion index to keep menu sorted in thread order.
+       for (; index < threadMenu->CountItems(); index++) {
+               BMenuItem* threadItem = threadMenu->ItemAt(index);
+               BMessage* message = threadItem->Message();
+               if (message->FindInt32("thread") > threadID)
+                       break;
+       }
+
+       bool added = false;
+       if (index == threadMenu->CountItems())
+               added = threadMenu->AddItem(item);
+       else
+               added = threadMenu->AddItem(item, index);
+
+       if (!added)
+               delete item;
+}
+
+
+void
+ExpressionEvaluationWindow::_HandleThreadRemoved(int32 threadID)
+{
+       BMenu* threadMenu = fThreadList->Menu();
+       for (int32 i = 0; i < threadMenu->CountItems(); i++) {
+               BMenuItem* item = threadMenu->ItemAt(i);
+               BMessage* message = item->Message();
+               if (message->FindInt32("thread") == threadID) {
+                       threadMenu->RemoveItem(i);
+                       delete item;
+                       break;
+               }
+       }
+
+       if (fSelectedThread != NULL && threadID == fSelectedThread->ID())
+               _HandleThreadSelectionChanged(-1);
+}
+
+
+void
+ExpressionEvaluationWindow::_HandleThreadStateChanged(int32 threadID)
+{
+       AutoLocker< ::Team> teamLocker(fTeam);
+
+       ::Thread* thread = fTeam->ThreadByID(threadID);
+       if (thread == NULL)
+               return;
+
+       if (thread->State() == THREAD_STATE_STOPPED)
+               _HandleThreadAdded(threadID);
+       else
+               _HandleThreadRemoved(threadID);
+}
+
+
+void
+ExpressionEvaluationWindow::_HandleThreadStackTraceChanged(int32 threadID)
+{
+       AutoLocker< ::Team> teamLocker(fTeam);
+
+       ::Thread* thread = fTeam->ThreadByID(threadID);
+       if (thread == NULL)
+               return;
+
+       if (thread != fSelectedThread)
+               return;
+
+       _UpdateFrameList();
+}
+
+
+void
 ExpressionEvaluationWindow::_UpdateThreadList()
 {
        AutoLocker< ::Team> teamLocker(fTeam);
@@ -305,25 +472,15 @@ ExpressionEvaluationWindow::_UpdateThreadList()
                if (thread->State() != THREAD_STATE_STOPPED)
                        continue;
 
-               BString nameString;
-               nameString.SetToFormat("%" B_PRId32 ": %s", thread->ID(),
-                       thread->Name());
-
-               BMessage* message = new(std::nothrow) BMessage(
-                       MSG_THREAD_SELECTION_CHANGED);
-               if (message == NULL)
-                       return;
-
-               message->AddInt32("thread", thread->ID());
-
-               BMenuItem* item = new(std::nothrow) BMenuItem(nameString,
-                       message);
-               if (item == NULL)
+               BMenuItem* item = NULL;
+               if (_CreateThreadMenuItem(thread, item) != B_OK)
                        return;
 
+               ObjectDeleter<BMenuItem> itemDeleter(item);
                if (!threadMenu->AddItem(item))
                        return;
 
+               itemDeleter.Detach();
                if (fSelectedThread == NULL) {
                        item->SetMarked(true);
                        _HandleThreadSelectionChanged(thread->ID());
@@ -380,3 +537,28 @@ ExpressionEvaluationWindow::_UpdateFrameList()
                }
        }
 }
+
+
+status_t
+ExpressionEvaluationWindow::_CreateThreadMenuItem(::Thread* thread,
+       BMenuItem*& _item) const
+{
+       BString nameString;
+       nameString.SetToFormat("%" B_PRId32 ": %s", thread->ID(),
+               thread->Name());
+
+       BMessage* message = new(std::nothrow) BMessage(
+               MSG_THREAD_SELECTION_CHANGED);
+       if (message == NULL)
+               return B_NO_MEMORY;
+
+       ObjectDeleter<BMessage> messageDeleter(message);
+       message->AddInt32("thread", thread->ID());
+       _item = new(std::nothrow) BMenuItem(nameString,
+               message);
+       if (_item == NULL)
+               return B_NO_MEMORY;
+
+       messageDeleter.Detach();
+       return B_OK;
+}
diff --git 
a/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.h
 
b/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.h
index f104f21..c95ea6b 100644
--- 
a/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.h
+++ 
b/src/apps/debugger/user_interface/gui/expression_eval_window/ExpressionEvaluationWindow.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2014-2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 #ifndef EXPRESSION_EVALUATION_WINDOW_H
@@ -41,6 +41,15 @@ public:
 
        virtual void                            MessageReceived(BMessage* 
message);
 
+       // Team::Listener
+       virtual void                            ThreadAdded(const 
Team::ThreadEvent& event);
+       virtual void                            ThreadRemoved(const 
Team::ThreadEvent& event);
+
+       virtual void                            ThreadStateChanged(
+                                                                       const 
Team::ThreadEvent& event);
+       virtual void                            ThreadStackTraceChanged(
+                                                                       const 
Team::ThreadEvent& event);
+
        // VariablesView::Listener
        virtual void                            
ValueNodeValueRequested(CpuState* cpuState,
                                                                        
ValueNodeContainer* container,
@@ -62,9 +71,17 @@ private:
                        void                            
_HandleThreadSelectionChanged(int32 threadID);
                        void                            
_HandleFrameSelectionChanged(int32 index);
 
+                       void                            
_HandleThreadAdded(int32 threadID);
+                       void                            
_HandleThreadRemoved(int32 threadID);
+                       void                            
_HandleThreadStateChanged(int32 threadID);
+                       void                            
_HandleThreadStackTraceChanged(int32 threadID);
+
                        void                            _UpdateThreadList();
                        void                            _UpdateFrameList();
 
+                       status_t                        
_CreateThreadMenuItem(::Thread* thread,
+                                                                       
BMenuItem*& _item) const;
+
 private:
                        BTextControl*           fExpressionInput;
                        BMenuField*                     fThreadList;

############################################################################

Commit:      06c2f877e65742f15b2cd58e35f61ad3c1a1ae3a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=06c2f877e657
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Sat Mar 19 20:12:07 2016 UTC

Debugger: Fix udis86 usage for resolving target address.

DisassemblerX86{64}:
- Fix problematic usage of udis86 that was broken during an update.
  Rather than calling the appropriate udis86 function to retrieve the
  operand, we were accessing it directly on the ud struct, which was
  fully filled in implicitly in previous versions of the library. However,
  in the updated version of udis86, the operands are only lazily decoded on
  request, and as such this data was invalid, leading to us not resolving
  target addresses properly. This primarily affected determining the location
  of return values.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/arch/x86/disasm/DisassemblerX86.cpp 
b/src/apps/debugger/arch/x86/disasm/DisassemblerX86.cpp
index 2d8d50d..bcedc2c 100644
--- a/src/apps/debugger/arch/x86/disasm/DisassemblerX86.cpp
+++ b/src/apps/debugger/arch/x86/disasm/DisassemblerX86.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
  * Copyright 2008, François Revol, revol@xxxxxxx
+ * Copyright 2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -185,36 +186,37 @@ DisassemblerX86::GetInstructionTargetAddress(CpuState* 
state) const
                return 0;
 
        target_addr_t targetAddress = 0;
-       switch (fUdisData->operand[0].type) {
+       const struct ud_operand* op = ud_insn_opr(fUdisData, 0);
+       switch (op->type) {
                case UD_OP_REG:
                {
                        targetAddress = x86State->IntRegisterValue(
-                               
RegisterNumberFromUdisIndex(fUdisData->operand[0].base));
-                       targetAddress += fUdisData->operand[0].offset;
+                               RegisterNumberFromUdisIndex(op->base));
+                       targetAddress += op->offset;
                }
                break;
                case UD_OP_MEM:
                {
                        targetAddress = x86State->IntRegisterValue(
-                               
RegisterNumberFromUdisIndex(fUdisData->operand[0].base));
+                               RegisterNumberFromUdisIndex(op->base));
                        targetAddress += x86State->IntRegisterValue(
-                               
RegisterNumberFromUdisIndex(fUdisData->operand[0].index))
-                               * fUdisData->operand[0].scale;
-                       if (fUdisData->operand[0].offset != 0)
-                               targetAddress += 
fUdisData->operand[0].lval.sdword;
+                               RegisterNumberFromUdisIndex(op->index))
+                               * op->scale;
+                       if (op->offset != 0)
+                               targetAddress += op->lval.sdword;
                }
                break;
                case UD_OP_JIMM:
                {
                        targetAddress = ud_insn_off(fUdisData)
-                               + fUdisData->operand[0].lval.sdword + 
ud_insn_len(fUdisData);
+                               + op->lval.sdword + ud_insn_len(fUdisData);
                }
                break;
 
                case UD_OP_IMM:
                case UD_OP_CONST:
                {
-                       targetAddress = fUdisData->operand[0].lval.udword;
+                       targetAddress = op->lval.udword;
                }
                break;
 
diff --git a/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp 
b/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp
index 3c32a10..b3dcd88 100644
--- a/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp
+++ b/src/apps/debugger/arch/x86_64/disasm/DisassemblerX8664.cpp
@@ -2,6 +2,7 @@
  * Copyright 2012, Alex Smith, alex@xxxxxxxxxxxxxxxx.
  * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
  * Copyright 2008, François Revol, revol@xxxxxxx
+ * Copyright 2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -196,34 +197,35 @@ DisassemblerX8664::GetInstructionTargetAddress(CpuState* 
state) const
                return 0;
 
        target_addr_t targetAddress = 0;
-       switch (fUdisData->operand[0].type) {
+       const struct ud_operand* op = ud_insn_opr(fUdisData, 0);
+       switch (op->type) {
                case UD_OP_REG:
                {
                        targetAddress = x64State->IntRegisterValue(
-                               
RegisterNumberFromUdisIndex(fUdisData->operand[0].base));
-                       targetAddress += fUdisData->operand[0].offset;
+                               RegisterNumberFromUdisIndex(op->base));
+                       targetAddress += op->offset;
                }
                break;
                case UD_OP_MEM:
                {
                        targetAddress = x64State->IntRegisterValue(
-                               
RegisterNumberFromUdisIndex(fUdisData->operand[0].base));
+                               RegisterNumberFromUdisIndex(op->base));
                        targetAddress += x64State->IntRegisterValue(
-                               
RegisterNumberFromUdisIndex(fUdisData->operand[0].index))
-                               * fUdisData->operand[0].scale;
+                               RegisterNumberFromUdisIndex(op->index))
+                               * op->scale;
                        off_t offset = 0;
-                       switch (fUdisData->operand[0].offset) {
+                       switch (op->offset) {
                                case 8:
-                                       offset = 
fUdisData->operand[0].lval.sbyte;
+                                       offset = op->lval.sbyte;
                                        break;
                                case 16:
-                                       offset = 
fUdisData->operand[0].lval.sword;
+                                       offset = op->lval.sword;
                                        break;
                                case 32:
-                                       offset = 
fUdisData->operand[0].lval.sdword;
+                                       offset = op->lval.sdword;
                                        break;
                                case 64:
-                                       offset = 
fUdisData->operand[0].lval.sqword;
+                                       offset = op->lval.sqword;
                                        break;
                        }
                        targetAddress += offset;
@@ -232,20 +234,20 @@ DisassemblerX8664::GetInstructionTargetAddress(CpuState* 
state) const
                case UD_OP_JIMM:
                {
                        targetAddress = ud_insn_off(fUdisData) + 
ud_insn_len(fUdisData);
-                       if (fUdisData->operand[0].size == 32)
-                               targetAddress += 
fUdisData->operand[0].lval.sdword;
+                       if (op->size == 32)
+                               targetAddress += op->lval.sdword;
                        else
-                               targetAddress += 
fUdisData->operand[0].lval.sqword;
+                               targetAddress += op->lval.sqword;
                }
                break;
 
                case UD_OP_IMM:
                case UD_OP_CONST:
                {
-                       if (fUdisData->operand[0].size == 32)
-                               targetAddress = 
fUdisData->operand[0].lval.udword;
-                       else if (fUdisData->operand[0].size == 64)
-                               targetAddress = 
fUdisData->operand[0].lval.uqword;
+                       if (op->size == 32)
+                               targetAddress = op->lval.udword;
+                       else if (op->size == 64)
+                               targetAddress = op->lval.uqword;
                }
                break;
 

############################################################################

Commit:      4f21e03d095684788ee61d98cfbb94dcca7b34dd
URL:         http://cgit.haiku-os.org/haiku/commit/?id=4f21e03d0956
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Sat Mar 19 20:19:08 2016 UTC

Debugger: Avoid unnecessary work in ThreadHandler.

ThreadHandler:
- When stepping over a function call, ensure that we actually have a valid
  value for the stepped over function address before adding a return value
  info entry. While this had no visible adverse effect, it did result in
  unnecessary work when creating the list of variables to display later,
  since such entries would have no valid function to resolve to, and thus
  had to be ignored/thrown away.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/controllers/ThreadHandler.cpp 
b/src/apps/debugger/controllers/ThreadHandler.cpp
index fd5d228..c178a52 100644
--- a/src/apps/debugger/controllers/ThreadHandler.cpp
+++ b/src/apps/debugger/controllers/ThreadHandler.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2010-2015, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2010-2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -720,8 +720,8 @@ ThreadHandler::_HandleBreakpointHitStep(CpuState* cpuState)
                                }
                        }
 
-                       if (fPreviousFrameAddress != 0 && 
fSteppedOverFunctionAddress
-                                       != cpuState->InstructionPointer()) {
+                       if (fPreviousFrameAddress != 0 && 
fSteppedOverFunctionAddress != 0
+                                       && fSteppedOverFunctionAddress != 
cpuState->InstructionPointer()) {
                                TRACE_CONTROL("STEP_OVER: called function 
address %#" B_PRIx64
                                        ", previous frame address: %#" B_PRIx64 
", frame address: %#"
                                        B_PRIx64 ", adding return info\n", 
fSteppedOverFunctionAddress,

############################################################################

Commit:      b679d8afa0667daa0d2ed68b2445444f1a625efa
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b679d8afa066
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Sat Mar 19 20:21:45 2016 UTC

Ticket:      https://dev.haiku-os.org/ticket/12693

Debugger: Fix #12693.

DwarfImageDebugInfo:
- When resolving the address of a PIC function that a value was
  returned by, check if the resulting address actually belongs to
  the same image as the caller. If not, find the appropriate image
  for the new address. Combined with the previous commits, this fixes
  the issue that functions called indirectly by PLT entry that jumped
  to another image entirely wouldn't be mapped back to their
  corresponding FunctionDebugInfo instance, and thus would be skipped
  since we  couldn't determine a type to associate the return value with.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp 
b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp
index 29fb16f..69765e3 100644
--- a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp
+++ b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2012-2014, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2012-2016, Rene Gollent, rene@xxxxxxxxxxx.
  * Distributed under the terms of the MIT License.
  */
 
@@ -1209,6 +1209,16 @@ 
DwarfImageDebugInfo::_CreateReturnValues(ReturnValueInfoList* returnValueInfos,
                                subroutineAddress, subroutineState, 
subroutineAddress);
                        if (result != B_OK)
                                continue;
+                       if (!targetImage->ContainsAddress(subroutineAddress)) {
+                               // the PLT entry doesn't necessarily point to a 
function
+                               // in the same image; as such we may need to 
try to
+                               // resolve the target address again.
+                               targetImage = image->GetTeam()->ImageByAddress(
+                                       subroutineAddress);
+                               if (targetImage == NULL)
+                                       continue;
+                               imageInfo = targetImage->GetImageDebugInfo();
+                       }
                }
 
                targetFunction = 
imageInfo->FunctionAtAddress(subroutineAddress);

############################################################################

Revision:    hrev50159
Commit:      20122a6a7786a3d9402606d01ecf674c517ad01a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=20122a6a7786
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Sat Mar 19 20:27:45 2016 UTC

LegacyPackageInstaller: Fix x86_64 build.

----------------------------------------------------------------------------

diff --git a/build/jam/images/definitions/regular 
b/build/jam/images/definitions/regular
index 93657d2..ed9774c 100644
--- a/build/jam/images/definitions/regular
+++ b/build/jam/images/definitions/regular
@@ -20,7 +20,7 @@ SYSTEM_APPS += [ FFilterByBuildFeatures
        CodyCam
        GLInfo@mesa
        HaikuDepot
-       Icon-O-Matic@expat Installer LaunchBox LegacyPackageInstaller@x86
+       Icon-O-Matic@expat Installer LaunchBox LegacyPackageInstaller
        Magnify Mail MediaConverter MediaPlayer MidiPlayer
        People PoorMan PowerStatus
        RemoteDesktop
diff --git a/src/apps/packageinstaller/UninstallView.cpp 
b/src/apps/packageinstaller/UninstallView.cpp
index fed2719..d187a96 100644
--- a/src/apps/packageinstaller/UninstallView.cpp
+++ b/src/apps/packageinstaller/UninstallView.cpp
@@ -377,7 +377,7 @@ UninstallView::_ReloadAppList()
 void
 UninstallView::_ClearAppList()
 {
-       while (BListItem* item = fAppList->RemoveItem(0L))
+       while (BListItem* item = fAppList->RemoveItem((int32)0))
                delete item;
 }
 


Other related posts:

  • » [haiku-commits] haiku: hrev50159 - in src/apps/debugger: user_interface/gui/expression_eval_window arch/x86_64/disasm arch/x86/disasm debug_info src/apps - anevilyak