jasonmolenda wrote:

I have two criticisms of the patch as-is.  We read the LC_SYMTAB load command 
into `symtab_load_command` which has six fields, the first two being the usual 
`cmd` and `cmdsize`.  We use all of the next four: `ncmds`, `strsize`, 
`symoff`, `stroff`.  I'm taking the uses of two of these fields out of 
`symtab_load_command`, and putting them in 64-bit locals.  But I think the 
smarter move is probably to read the load command into a temporary object, and 
then create four local variables with the resized fields as needed, or have a 
locally defined struct with the resized fields. 

The second criticism is that I don't have a good way to test it.  I have a 
request to have ProcessMachCore treat an LC_SEGMENT that has a virtual address 
& size, but no file size as an all-zeroes segment.  In which case it would be 
possible to create a mach-o corefile that is larger than 4GB in size, but 
actually only uses a couple hundred kb on disk (and doesn't fill the CI 
filesystems), and then we'd have to hand-write a mach-o file with a LINKEDIT 
4GB away from the TEXT segment.  There's a couple pieces that don't exist to do 
all of this right now, though.

https://github.com/llvm/llvm-project/pull/117832
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to