* Added vm_debug_copy_page_memory() which copies memory from a potentially not

mapped page.
* debug_{mem,strl}cpy():
  - Added "team" parameter for specifying the address space the address are
    to be interpreted in.
  - When the standard memcpy() (with fault handler) fails, fall back to
    vm_debug_copy_page_memory().
* Added debug_is_debugged_team(): Predicate returning true, if the supplied
  team_id refers to the same team debug_get_debugged_thread() belongs to.
* Added DebuggedThreadSetter class for scope-based debug_set_debugged_thread().
  Made use of it in several debugger functions.
* print_demangled_call() (x86): Fixed unsafe memory access.

Allows KDL stack traces to work correctly again, even if the page daemon has
already unmapped the concerned pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36230 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-04-13 17:40:15 +00:00
parent ca4dd26afd
commit c3676b54bf
10 changed files with 377 additions and 86 deletions
+29 -3
View File
@@ -132,8 +132,10 @@ extern bool debug_is_kernel_memory_accessible(addr_t address, size_t size,
uint32 protection);
extern int debug_call_with_fault_handler(jmp_buf jumpBuffer,
void (*function)(void*), void* parameter);
extern status_t debug_memcpy(void* to, const void* from, size_t size);
extern ssize_t debug_strlcpy(char* to, const char* from, size_t size);
extern status_t debug_memcpy(team_id teamID, void* to, const void* from,
size_t size);
extern ssize_t debug_strlcpy(team_id teamID, char* to, const char* from,
size_t size);
extern char kgetc(void);
extern void kputs(const char *string);
@@ -172,8 +174,9 @@ extern status_t debug_get_next_demangled_argument(uint32* _cookie,
extern struct thread* debug_set_debugged_thread(struct thread* thread);
extern struct thread* debug_get_debugged_thread();
extern struct arch_debug_registers* debug_get_debug_registers(int32 cpu);
extern bool debug_is_debugged_team(team_id teamID);
extern struct arch_debug_registers* debug_get_debug_registers(int32 cpu);
extern status_t _user_kernel_debugger(const char *message);
extern void _user_debug_output(const char *userString);
@@ -182,4 +185,27 @@ extern void _user_debug_output(const char *userString);
}
#endif
#ifdef __cplusplus
struct DebuggedThreadSetter {
DebuggedThreadSetter(struct thread* thread)
:
fPreviousThread(debug_set_debugged_thread(thread))
{
}
~DebuggedThreadSetter()
{
debug_set_debugged_thread(fPreviousThread);
}
private:
struct thread* fPreviousThread;
};
#endif // __cplusplus
#endif /* _KERNEL_DEBUG_H */