[llvm-dev] Debugging LowerTypeTests in LLVM Using GDB

via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 30 12:55:39 PDT 2019


`clang` is the driver not the compiler.

Run this to get the compiler invocation: (“path/to/clang” “-cc1” ….), then debug that instead.
"clang -flto -fsanitize=cfi-icall indirect.c -o indirect -###"

-Yuanfang

From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Shishir V Jessu via llvm-dev
Sent: Monday, September 30, 2019 12:42 PM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] Debugging LowerTypeTests in LLVM Using GDB

Hi,

I am looking into Control-Flow Integrity for indirect function calls, implemented with jump tables. I want to step through the code that produces these jump tables in GDB. I have built clang and opt from source with debugging symbols. I believe this code lives in llvm/lib/Transforms/LowerTypeTests.cpp, but when I try to debug opt by running the command "run -lowertypetests cfi-icall.bc > /dev/null", I am never able to reach this file.

Also, I have tried to debug the command "clang -flto -fsanitize=cfi-icall indirect.c -o indirect" (where indirect.c is a C file containing an indirect call), and am able to see the CFI jump tables in the resulting assembly, but I cannot reach the code that produces these jump tables in GDB. Am I targeting the wrong code for these changes, or is there something more I need in order to run through this code in GDB? Thanks for your help!

Shishir Jessu
[https://my-email-signature.link/signature.gif?u=452460&e=69832799&v=6efa26dd8b7b5e591d1b31d3c4a3519873f620bdba0e97b50ce1fae745e580e7]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190930/6f7518b1/attachment.html>


More information about the llvm-dev mailing list