summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBFunction.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2015-07-29 00:42:47 +0000
committerJason Molenda <jmolenda@apple.com>2015-07-29 00:42:47 +0000
commit6ab659a922bf919764dc5dd7a6c47e61b35bbde5 (patch)
tree580953d5861477e1209e9c83e4d40fc77ae764fd /lldb/source/API/SBFunction.cpp
parentff244c1d9754b0632401a2bd36612afb7392cf44 (diff)
downloadbcm5719-llvm-6ab659a922bf919764dc5dd7a6c47e61b35bbde5.tar.gz
bcm5719-llvm-6ab659a922bf919764dc5dd7a6c47e61b35bbde5.zip
First part of an attempt to indicate to the user when they are
debugging optimized code. Adds new methods on Function/SBFunction to query whether a given function is optimized. Adds a new function.is-optimized format entity and changes the default frame-format to append "[opt]" if the function was built with optimization. The only indication that a binary was built with optimization that we have right now is the presence of the DW_AT_APPLE_optimized attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit. The absence of this flag may mean that the compile_unit was not compiled with optimization, or it may mean that the producer does not generate this attribute. Currently this only works for dSYM debugging. When we create the CompileUnit with dwarf-in-.o-file debugging we don't have the attribute value yet so it's not set. I need to find the flag value when we do start to read the .o file DWARF and set the CompileUnit's status at that point - but haven't done it yet. I'm also going to add a mechanism for issuing warnings to users such that they're only issued once in a debug session and there is away for users to suppress these warnings altogether via .lldbinit file settings. But I want to get this changeset committed now that it's at a useful state. <rdar://problem/19281172> llvm-svn: 243508
Diffstat (limited to 'lldb/source/API/SBFunction.cpp')
-rw-r--r--lldb/source/API/SBFunction.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp
index 2ec6072b51e..795a726a183 100644
--- a/lldb/source/API/SBFunction.cpp
+++ b/lldb/source/API/SBFunction.cpp
@@ -258,4 +258,13 @@ SBFunction::GetLanguage ()
return lldb::eLanguageTypeUnknown;
}
-
+bool
+SBFunction::GetIsOptimized ()
+{
+ if (m_opaque_ptr)
+ {
+ if (m_opaque_ptr->GetCompileUnit())
+ return m_opaque_ptr->GetCompileUnit()->GetIsOptimized();
+ }
+ return false;
+}
OpenPOWER on IntegriCloud