* 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:
@@ -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 */
|
||||
|
||||
@@ -140,6 +140,9 @@ status_t vm_memcpy_to_physical(addr_t to, const void* from, size_t length,
|
||||
bool user);
|
||||
void vm_memcpy_physical_page(addr_t to, addr_t from);
|
||||
|
||||
status_t vm_debug_copy_page_memory(team_id teamID, void* unsafeMemory,
|
||||
void* buffer, size_t size, bool copyToUnsafe);
|
||||
|
||||
// user syscalls
|
||||
area_id _user_create_area(const char *name, void **address, uint32 addressSpec,
|
||||
size_t size, uint32 lock, uint32 protection);
|
||||
|
||||
Reference in New Issue
Block a user