Quantcast
Channel: LLDB - Swift Forums
Viewing all articles
Browse latest Browse all 40

LLDB: Print valued returned by a function

$
0
0

LLDB supports printing the return value of a function. Here's an example in Xcode, on a simple C project:

It appears that this behaviour isn't available in Swift. I wasn't able to find any related issues on the Swift repo, or Apple's fork of LLVM.

Has this been looked into before? Is there any reason why it can't be done, or would be difficult?.

I find this feature really useful, to prevent needing to write smelly code like:

func add(_ a: Int, _ b: Int) -> Int {
    // I don't actually want this useless variable,
    // but I add it in just for debugging.
	let result = a + b
    return result
}

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 40

Latest Images

Trending Articles



Latest Images