====== CTF implementation and use in the kernel debugger ====== * Student: [[/DanielLovasko|DanielLovasko]] (lovasko@) * Mentor: [[/GeorgeNevilleNeil|GeorgeNevilleNeil]] (gnn@) ===== Project description ===== When somebody compiles the kernel with the ''%%WITH_CDDL%%'' and ''%%WITH_CTF%%'' options, the ''%%ctfconvert%%'' utility is used to convert the DWARF debugging symbols to the CTF data. This is apparently done to enable the D-Trace utility to retrieve the type information data. Since we already have this information inside the kernel at our disposal, it would be a shame not to use it also for other purposes, in our case the kernel on-line debugger DDB. The main idea behind this project is to add the capability of pretty printing data structures contained inside the %%FreeBSD%% kernel source based on the CTF data contained in the ''%%SUNW_ctf%%'' section of the kernel binaries. The following example will illustrate the feature. The names of variables and data structures are fictional for better intuition. ===== The Code ===== [[https://github.com/lovasko/libctf|libctf on github]] \\ [[https://github.com/lovasko/ctfdump|ctfdump on github]] \\ [[https://github.com/lovasko/ctfstats|ctfstats on github]] \\ [[https://github.com/lovasko/ctfquery|ctfquery on github]] \\ [[https://github.com/lovasko/ddb_ctf|ddb ctf-related enhancements]] ===== Useful links ===== [[http://www.smnd.sk/lovasko/FreeBSD_Proposal.pdf|the proposal]] \\ [[http://lovasko.wordpress.com|the blog]] \\ [[https://blogs.oracle.com/levon/entry/reducing_ctf_overhead|reducing ctf overhead]] \\ [[http://dtrace.org/blogs/eschrock/2011/10/26/your-mdb-fell-into-my-dtrace|dtrace print action]] \\ [[http://dtrace.org/blogs/rm/2013/11/14/userland-ctf-in-dtrace|userland ctf in illumos]]