[lldb-dev] LLDB Evolution - Final Form

Ted Woodward via lldb-dev lldb-dev at lists.llvm.org
Tue Sep 20 13:37:36 PDT 2016


From: lldb-dev [mailto:lldb-dev-bounces at lists.llvm.org] On Behalf Of Zachary Turner via lldb-dev
Sent: Tuesday, September 20, 2016 12:47 PM

> This kind of philisophical debate is probably worthy of a separate thread :)  That being said, I think asserts are typically used in places where the assert firing means "You're going to crash *anyway*"

This is emphatically NOT the case.

One of the first tasks I was given when I started at Qualcomm was to fix the disassembler for Hexagon. It was a mess - it would assert if the disassembly tables couldn't identify an opcode. Maybe that's fine for an assembler, assert if you can't generate an opcode, but an unidentified opcode should print a warning and move on. It's not a fatal error to disassemble data!

There are other instances of this in llvm. I agree with Greg - libraries shouldn't assert.  Send an error back to the caller, and let the caller handle it. A typo in my expression that lldb sends to clang shouldn't crash my debug session.

--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project




More information about the lldb-dev mailing list