From 23f8c95a4439767cf9c7dc9d7a35eb55dc78b9d0 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 24 Mar 2014 23:10:19 +0000 Subject: JITed functions can now have debug info and be debugged with debug and source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code llvm-svn: 204682 --- lldb/source/Commands/CommandObjectExpression.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lldb/source/Commands') diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index df97550c31b..2598f3f9fec 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -288,6 +288,12 @@ CommandObjectExpression::EvaluateExpression options.SetTryAllThreads(m_command_options.try_all_threads); options.SetDebug(m_command_options.debug); + // If there is any chance we are going to stop and want to see + // what went wrong with our expression, we should generate debug info + if (!m_command_options.ignore_breakpoints || + !m_command_options.unwind_on_error) + options.SetGenerateDebugInfo(true); + if (m_command_options.timeout > 0) options.SetTimeoutUsec(m_command_options.timeout); else -- cgit v1.2.3