mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:52:45 +00:00 
			
		
		
		
	Kernel: Use kernelputstr instead of dbgln when printing backtraces
This will allow us to eventually switch dbgln in the kernel to an allocation-free (although length-bounded) formatter.
This commit is contained in:
		
							parent
							
								
									0142f33ddc
								
							
						
					
					
						commit
						309d71a66b
					
				
					 2 changed files with 18 additions and 4 deletions
				
			
		|  | @ -27,6 +27,7 @@ | |||
| #include <Kernel/Thread.h> | ||||
| #include <Kernel/ThreadTracer.h> | ||||
| #include <Kernel/TimerQueue.h> | ||||
| #include <Kernel/kstdio.h> | ||||
| #include <LibC/signal_numbers.h> | ||||
| 
 | ||||
| namespace Kernel { | ||||
|  | @ -501,8 +502,14 @@ void Thread::finalize() | |||
|         m_join_blocker_set.thread_finalizing(); | ||||
|     } | ||||
| 
 | ||||
|     if (m_dump_backtrace_on_finalization) | ||||
|         dbgln("{}", backtrace()); | ||||
|     if (m_dump_backtrace_on_finalization) { | ||||
|         auto trace_or_error = backtrace(); | ||||
|         if (!trace_or_error.is_error()) { | ||||
|             auto trace = trace_or_error.release_value(); | ||||
|             dbgln("Backtrace:"); | ||||
|             kernelputstr(trace->characters(), trace->length()); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     drop_thread_count(false); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Idan Horowitz
						Idan Horowitz