@@ -618,20 +618,16 @@ static bool DumpRegister(Stream &s, StackFrame *frame, RegisterKind reg_kind,
618
618
static ValueObjectSP ExpandIndexedExpression (ValueObject *valobj, size_t index,
619
619
bool deref_pointer) {
620
620
Log *log = GetLog (LLDBLog::DataFormatters);
621
- const char *ptr_deref_format = " [%d]" ;
622
- std::string ptr_deref_buffer (10 , 0 );
623
- ::sprintf (&ptr_deref_buffer[0 ], ptr_deref_format, index);
624
- LLDB_LOGF (log, " [ExpandIndexedExpression] name to deref: %s" ,
625
- ptr_deref_buffer.c_str ());
621
+ std::string name_to_deref = llvm::formatv (" [{0}]" , index);
622
+ LLDB_LOG (log, " [ExpandIndexedExpression] name to deref: {0}" , name_to_deref);
626
623
ValueObject::GetValueForExpressionPathOptions options;
627
624
ValueObject::ExpressionPathEndResultType final_value_type;
628
625
ValueObject::ExpressionPathScanEndReason reason_to_stop;
629
626
ValueObject::ExpressionPathAftermath what_next =
630
627
(deref_pointer ? ValueObject::eExpressionPathAftermathDereference
631
628
: ValueObject::eExpressionPathAftermathNothing);
632
629
ValueObjectSP item = valobj->GetValueForExpressionPath (
633
- ptr_deref_buffer.c_str (), &reason_to_stop, &final_value_type, options,
634
- &what_next);
630
+ name_to_deref, &reason_to_stop, &final_value_type, options, &what_next);
635
631
if (!item) {
636
632
LLDB_LOGF (log,
637
633
" [ExpandIndexedExpression] ERROR: why stopping = %d,"
0 commit comments