003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
source
/
Plugins
/
Language
/
ObjC
/
📁
..
📄
CF.cpp
(8.75 KB)
📄
CF.h
(1.25 KB)
📄
CFBasicHash.cpp
(2.8 KB)
📄
CFBasicHash.h
(2.19 KB)
📄
Cocoa.cpp
(34.64 KB)
📄
Cocoa.h
(4.61 KB)
📄
CoreMedia.cpp
(3.03 KB)
📄
CoreMedia.h
(884 B)
📄
NSArray.cpp
(25.25 KB)
📄
NSDictionary.cpp
(37.47 KB)
📄
NSDictionary.h
(2.78 KB)
📄
NSError.cpp
(6.72 KB)
📄
NSException.cpp
(6.69 KB)
📄
NSIndexPath.cpp
(8.73 KB)
📄
NSSet.cpp
(24 KB)
📄
NSSet.h
(1.35 KB)
📄
NSString.cpp
(14.48 KB)
📄
NSString.h
(1.51 KB)
📄
ObjCLanguage.cpp
(45.73 KB)
📄
ObjCLanguage.h
(5.08 KB)
Editing: CoreMedia.cpp
//===-- CoreMedia.cpp -----------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "CoreMedia.h" #include "lldb/Utility/Flags.h" #include "lldb/Utility/Log.h" #include "lldb/Symbol/TypeSystem.h" #include "lldb/Target/Target.h" #include <inttypes.h> using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; bool lldb_private::formatters::CMTimeSummaryProvider( ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) { CompilerType type = valobj.GetCompilerType(); if (!type.IsValid()) return false; auto type_system_or_err = valobj.GetExecutionContextRef() .GetTargetSP() ->GetScratchTypeSystemForLanguage(lldb::eLanguageTypeC); if (auto err = type_system_or_err.takeError()) { LLDB_LOG_ERROR( lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS), std::move(err), "Failed to get scratch type system"); return false; } // fetch children by offset to compensate for potential lack of debug info auto int64_ty = type_system_or_err->GetBuiltinTypeForEncodingAndBitSize( eEncodingSint, 64); auto int32_ty = type_system_or_err->GetBuiltinTypeForEncodingAndBitSize( eEncodingSint, 32); auto value_sp(valobj.GetSyntheticChildAtOffset(0, int64_ty, true)); auto timescale_sp(valobj.GetSyntheticChildAtOffset(8, int32_ty, true)); auto flags_sp(valobj.GetSyntheticChildAtOffset(12, int32_ty, true)); if (!value_sp || !timescale_sp || !flags_sp) return false; auto value = value_sp->GetValueAsUnsigned(0); auto timescale = (int32_t)timescale_sp->GetValueAsUnsigned( 0); // the timescale specifies the fraction of a second each unit in the // numerator occupies auto flags = Flags(flags_sp->GetValueAsUnsigned(0) & 0x00000000000000FF); // the flags I need sit in the LSB const unsigned int FlagPositiveInf = 4; const unsigned int FlagNegativeInf = 8; const unsigned int FlagIndefinite = 16; if (flags.AnySet(FlagIndefinite)) { stream.Printf("indefinite"); return true; } if (flags.AnySet(FlagPositiveInf)) { stream.Printf("+oo"); return true; } if (flags.AnySet(FlagNegativeInf)) { stream.Printf("-oo"); return true; } if (timescale == 0) return false; switch (timescale) { case 0: return false; case 1: stream.Printf("%" PRId64 " seconds", value); return true; case 2: stream.Printf("%" PRId64 " half seconds", value); return true; case 3: stream.Printf("%" PRId64 " third%sof a second", value, value == 1 ? " " : "s "); return true; default: stream.Printf("%" PRId64 " %" PRId32 "th%sof a second", value, timescale, value == 1 ? " " : "s "); return true; } }
Upload File
Create Folder