* 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31223 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -23,7 +23,7 @@ status_t arch_debug_init(kernel_args *args);
|
|||||||
void *arch_debug_get_caller(void);
|
void *arch_debug_get_caller(void);
|
||||||
int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
|
int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
|
||||||
int32 skipIframes, int32 skipFrames, bool userOnly);
|
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,
|
bool arch_debug_contains_call(struct thread *thread, const char *symbol,
|
||||||
addr_t start, addr_t end);
|
addr_t start, addr_t end);
|
||||||
void arch_debug_save_registers(int *);
|
void arch_debug_save_registers(int *);
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -360,7 +360,7 @@ arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
|
|||||||
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
arch_debug_get_interrupt_pc()
|
arch_debug_get_interrupt_pc(bool* _isSyscall)
|
||||||
{
|
{
|
||||||
// TODO: Implement!
|
// TODO: Implement!
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -296,7 +296,7 @@ arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
|
|||||||
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
arch_debug_get_interrupt_pc()
|
arch_debug_get_interrupt_pc(bool* _isSyscall)
|
||||||
{
|
{
|
||||||
// TODO: Implement!
|
// TODO: Implement!
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2002-2008, Axel Dörfler, [email protected].
|
* Copyright 2002-2008, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
@@ -980,16 +981,21 @@ arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
|
|||||||
|
|
||||||
|
|
||||||
/*! Returns the program counter of the currently debugged (respectively this)
|
/*! Returns the program counter of the currently debugged (respectively this)
|
||||||
thread where the innermost interrupts happened. Returns \c NULL, if there's
|
thread where the innermost interrupts happened. \a _isSyscall, if specified,
|
||||||
none or a problem occurred retrieving it.
|
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*
|
void*
|
||||||
arch_debug_get_interrupt_pc()
|
arch_debug_get_interrupt_pc(bool* _isSyscall)
|
||||||
{
|
{
|
||||||
struct iframe* frame = get_current_iframe(debug_get_debugged_thread());
|
struct iframe* frame = get_current_iframe(debug_get_debugged_thread());
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (_isSyscall != NULL)
|
||||||
|
*_isSyscall = frame->vector == 99;
|
||||||
|
|
||||||
return (void*)(addr_t)frame->eip;
|
return (void*)(addr_t)frame->eip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -798,8 +798,10 @@ thread_hit_debug_event(debug_debugger_message event, const void *message,
|
|||||||
prepare_debugger_change(team, debugChangeCondition);
|
prepare_debugger_change(team, debugChangeCondition);
|
||||||
|
|
||||||
if (team->debug_info.breakpoint_manager != NULL) {
|
if (team->debug_info.breakpoint_manager != NULL) {
|
||||||
team->debug_info.breakpoint_manager->PrepareToContinue(
|
bool isSyscall;
|
||||||
arch_debug_get_interrupt_pc());
|
void* pc = arch_debug_get_interrupt_pc(&isSyscall);
|
||||||
|
if (pc != NULL && !isSyscall)
|
||||||
|
team->debug_info.breakpoint_manager->PrepareToContinue(pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_debugger_change(team);
|
finish_debugger_change(team);
|
||||||
@@ -1316,7 +1318,7 @@ profiling_do_sample(bool& flushBuffer)
|
|||||||
|
|
||||||
if (debugInfo.profile.last_image_event < imageEvent
|
if (debugInfo.profile.last_image_event < imageEvent
|
||||||
|| debugInfo.profile.flush_threshold - sampleCount < stackDepth) {
|
|| 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;
|
flushBuffer = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1353,7 +1355,7 @@ profiling_do_sample(bool& flushBuffer)
|
|||||||
for (int32 i = count; i < stackDepth; i++)
|
for (int32 i = count; i < stackDepth; i++)
|
||||||
returnAddresses[i] = 0;
|
returnAddresses[i] = 0;
|
||||||
} else
|
} else
|
||||||
*returnAddresses = (addr_t)arch_debug_get_interrupt_pc();
|
*returnAddresses = (addr_t)arch_debug_get_interrupt_pc(NULL);
|
||||||
|
|
||||||
debugInfo.profile.sample_count += stackDepth;
|
debugInfo.profile.sample_count += stackDepth;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008, Ingo Weinhold, [email protected].
|
* Copyright 2008-2009, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2002-2007, Axel Dörfler, [email protected].
|
* Copyright 2002-2007, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
|
|
||||||
#if SCHEDULER_TRACING >= 2
|
#if SCHEDULER_TRACING >= 2
|
||||||
if (fPreviousState == B_THREAD_READY)
|
if (fPreviousState == B_THREAD_READY)
|
||||||
fPreviousPC = arch_debug_get_interrupt_pc();
|
fPreviousPC = arch_debug_get_interrupt_pc(NULL);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
fPreviousWaitObject = previous->wait.object;
|
fPreviousWaitObject = previous->wait.object;
|
||||||
|
|||||||
Reference in New Issue
Block a user