[lldb][Process/FreeBSDKernel] Print unread message buffer on start (#178027) This is equivalent of kgdb_dmesg() in fbsd-kvm.c in FreeBSD kgdb(1) port. Unread kernel messages is only printed in interactive mode (i.e. not in batch mode) to mimic KGDB's behaviour. Example output: ``` ➜ sudo ./build/bin/lldb /boot/kernel/kernel -c /var/crash/vmcore.last (lldb) target create "/boot/kernel/kernel" --core "/var/crash/vmcore.last" Unread portion of the kernel message buffer: panic: kdb_sysctl_panic cpuid = 1 time = 1769364579 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01b435fa20 vpanic() at vpanic+0x136/frame 0xfffffe01b435fb50 panic() at panic+0x43/frame 0xfffffe01b435fbb0 kdb_sysctl_panic() at kdb_sysctl_panic+0x63/frame 0xfffffe01b435fbe0 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame 0xfffffe01b435fc30 sysctl_root() at sysctl_root+0x22f/frame 0xfffffe01b435fcb0 userland_sysctl() at userland_sysctl+0x196/frame 0xfffffe01b435fd50 sys___sysctl() at sys___sysctl+0x65/frame 0xfffffe01b435fe00 amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe01b435ff30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01b435ff30 --- syscall (202, FreeBSD ELF64, __sysctl), rip = 0x3f67cad1c8da, rsp = 0x3f67c80261d8, rbp = 0x3f67c8026220 --- KDB: enter: panic Core file '/var/crash/vmcore.last' (x86_64) was loaded. (lldb) ``` --------- Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.