mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 02:42:44 +00:00 
			
		
		
		
	 149e382735
			
		
	
	
		149e382735
		
	
	
	
	
		
			
			Provide a function to create an ELF image in a format GDB expects. Outside of ELF platforms this image doesn't make much sense, and in MacOS a Mach-O memory image is required: see https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/diagnostics/gdb-jit.cc#1802 Since GDB requires active runtime addresses for the code, copying the generated code into the image will not help. Instead, `build_gdb_image` writes the runtime addresses of the code into a NOBITS `.text` section.
		
			
				
	
	
		
			14 lines
		
	
	
	
		
			266 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
	
		
			266 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, Jesús Lapastora <cyber.gsuscode@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibJIT/GDB.h>
 | |
| 
 | |
| namespace JIT::GDB {
 | |
| Optional<FixedArray<u8>> build_gdb_image(ReadonlyBytes, StringView, StringView)
 | |
| {
 | |
|     return {};
 | |
| }
 | |
| }
 |