[Haiku-commits] r31223 - in haiku/trunk: headers/private/kernel/arch src/system/kernel/arch/m68k src/system/kernel/arch/ppc src/system/kernel/arch/x86 src/system/kernel/debug src/system/kernel/scheduler
bonefish at mail.berlios.de
bonefish at mail.berlios.de
Wed Jun 24 13:49:38 CEST 2009
Author: bonefish
Date: 2009-06-24 13:49:35 +0200 (Wed, 24 Jun 2009)
New Revision: 31223
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31223&view=rev
Modified:
haiku/trunk/headers/private/kernel/arch/debug.h
haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp
haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp
haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp
haiku/trunk/src/system/kernel/debug/user_debugger.cpp
haiku/trunk/src/system/kernel/scheduler/scheduler_tracing.h
Log:
* arch_debug_get_interrupt_pc() does now optionally return whether the iframe
is a syscall iframe.
* User debugger support: Don't to call BreakpointManager::PrepareToContinue(),
if the thread returns from a syscall. We don't want to skip breakpoints in
that case.
Modified: haiku/trunk/headers/private/kernel/arch/debug.h
===================================================================
--- haiku/trunk/headers/private/kernel/arch/debug.h 2009-06-24 09:00:22 UTC (rev 31222)
+++ haiku/trunk/headers/private/kernel/arch/debug.h 2009-06-24 11:49:35 UTC (rev 31223)
@@ -23,7 +23,7 @@
void *arch_debug_get_caller(void);
int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
int32 skipIframes, int32 skipFrames, bool userOnly);
-void *arch_debug_get_interrupt_pc();
+void* arch_debug_get_interrupt_pc(bool* _isSyscall);
bool arch_debug_contains_call(struct thread *thread, const char *symbol,
addr_t start, addr_t end);
void arch_debug_save_registers(int *);
Modified: haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp 2009-06-24 09:00:22 UTC (rev 31222)
+++ haiku/trunk/src/system/kernel/arch/m68k/arch_debug.cpp 2009-06-24 11:49:35 UTC (rev 31223)
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2008, Haiku Inc. All rights reserved.
+ * Copyright 2003-2009, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -360,7 +360,7 @@
void*
-arch_debug_get_interrupt_pc()
+arch_debug_get_interrupt_pc(bool* _isSyscall)
{
// TODO: Implement!
return NULL;
Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2009-06-24 09:00:22 UTC (rev 31222)
+++ haiku/trunk/src/system/kernel/arch/ppc/arch_debug.cpp 2009-06-24 11:49:35 UTC (rev 31223)
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2008, Haiku Inc. All rights reserved.
+ * Copyright 2003-2009, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -296,7 +296,7 @@
void*
-arch_debug_get_interrupt_pc()
+arch_debug_get_interrupt_pc(bool* _isSyscall)
{
// TODO: Implement!
return NULL;
Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-06-24 09:00:22 UTC (rev 31222)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp 2009-06-24 11:49:35 UTC (rev 31223)
@@ -1,4 +1,5 @@
/*
+ * Copyright 2009, Ingo Weinhold, ingo_weinhold at gmx.de.
* Copyright 2002-2008, Axel Dörfler, axeld at pinc-software.de.
* Distributed under the terms of the MIT License.
*
@@ -980,16 +981,21 @@
/*! Returns the program counter of the currently debugged (respectively this)
- thread where the innermost interrupts happened. Returns \c NULL, if there's
- none or a problem occurred retrieving it.
+ thread where the innermost interrupts happened. \a _isSyscall, if specified,
+ is set to whether this interrupt frame was created by a syscall. Returns
+ \c NULL, if there's no such frame or a problem occurred retrieving it;
+ \a _isSyscall won't be set in this case.
*/
void*
-arch_debug_get_interrupt_pc()
+arch_debug_get_interrupt_pc(bool* _isSyscall)
{
struct iframe* frame = get_current_iframe(debug_get_debugged_thread());
if (frame == NULL)
return NULL;
+ if (_isSyscall != NULL)
+ *_isSyscall = frame->vector == 99;
+
return (void*)(addr_t)frame->eip;
}
Modified: haiku/trunk/src/system/kernel/debug/user_debugger.cpp
===================================================================
--- haiku/trunk/src/system/kernel/debug/user_debugger.cpp 2009-06-24 09:00:22 UTC (rev 31222)
+++ haiku/trunk/src/system/kernel/debug/user_debugger.cpp 2009-06-24 11:49:35 UTC (rev 31223)
@@ -798,8 +798,10 @@
prepare_debugger_change(team, debugChangeCondition);
if (team->debug_info.breakpoint_manager != NULL) {
- team->debug_info.breakpoint_manager->PrepareToContinue(
- arch_debug_get_interrupt_pc());
+ bool isSyscall;
+ void* pc = arch_debug_get_interrupt_pc(&isSyscall);
+ if (pc != NULL && !isSyscall)
+ team->debug_info.breakpoint_manager->PrepareToContinue(pc);
}
finish_debugger_change(team);
@@ -1316,7 +1318,7 @@
if (debugInfo.profile.last_image_event < imageEvent
|| debugInfo.profile.flush_threshold - sampleCount < stackDepth) {
- if (!IS_KERNEL_ADDRESS(arch_debug_get_interrupt_pc())) {
+ if (!IS_KERNEL_ADDRESS(arch_debug_get_interrupt_pc(NULL))) {
flushBuffer = true;
return true;
}
@@ -1353,7 +1355,7 @@
for (int32 i = count; i < stackDepth; i++)
returnAddresses[i] = 0;
} else
- *returnAddresses = (addr_t)arch_debug_get_interrupt_pc();
+ *returnAddresses = (addr_t)arch_debug_get_interrupt_pc(NULL);
debugInfo.profile.sample_count += stackDepth;
}
Modified: haiku/trunk/src/system/kernel/scheduler/scheduler_tracing.h
===================================================================
--- haiku/trunk/src/system/kernel/scheduler/scheduler_tracing.h 2009-06-24 09:00:22 UTC (rev 31222)
+++ haiku/trunk/src/system/kernel/scheduler/scheduler_tracing.h 2009-06-24 11:49:35 UTC (rev 31223)
@@ -1,5 +1,5 @@
/*
- * Copyright 2008, Ingo Weinhold, ingo_weinhold at gmx.de.
+ * Copyright 2008-2009, Ingo Weinhold, ingo_weinhold at gmx.de.
* Copyright 2002-2007, Axel Dörfler, axeld at pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@@ -99,7 +99,7 @@
#if SCHEDULER_TRACING >= 2
if (fPreviousState == B_THREAD_READY)
- fPreviousPC = arch_debug_get_interrupt_pc();
+ fPreviousPC = arch_debug_get_interrupt_pc(NULL);
else
#endif
fPreviousWaitObject = previous->wait.object;
More information about the Haiku-commits
mailing list