Skip to content

Rename GetLanguageInfo to GetLanguageSpecificData #117012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/include/lldb/API/SBFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class LLDB_API SBFrame {
/// Language plugins can use this API to report language-specific
/// runtime information about this compile unit, such as additional
/// language version details or feature flags.
SBStructuredData GetLanguageInfo();
SBStructuredData GetLanguageSpecificData();

/// Gets the lexical block that defines the stack frame. Another way to think
/// of this is it will return the block that contains all of the variables
Expand Down
2 changes: 1 addition & 1 deletion lldb/include/lldb/Target/LanguageRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class LanguageRuntime : public Runtime, public PluginInterface {
/// Language runtime plugins can use this API to report
/// language-specific runtime information about this compile unit,
/// such as additional language version details or feature flags.
virtual StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc);
virtual StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc);

protected:
// The static GetRuntimeUnwindPlan method above is only implemented in the
Expand Down
2 changes: 1 addition & 1 deletion lldb/include/lldb/Target/StackFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class StackFrame : public ExecutionContextScope,
/// Language plugins can use this API to report language-specific
/// runtime information about this compile unit, such as additional
/// language version details or feature flags.
StructuredData::ObjectSP GetLanguageInfo();
StructuredData::ObjectSP GetLanguageSpecificData();

/// Get the frame's demangled name.
///
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/API/SBFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
return expr_result;
}

SBStructuredData SBFrame::GetLanguageInfo() {
SBStructuredData SBFrame::GetLanguageSpecificData() {
LLDB_INSTRUMENT_VA(this);

SBStructuredData sb_data;
Expand All @@ -1165,7 +1165,7 @@ SBStructuredData SBFrame::GetLanguageInfo() {
if (!frame)
return sb_data;

StructuredData::ObjectSP data(frame->GetLanguageInfo());
StructuredData::ObjectSP data(frame->GetLanguageSpecificData());
sb_data.m_impl_up->SetObjectSP(data);
return sb_data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3398,7 +3398,8 @@ std::optional<uint64_t> AppleObjCRuntimeV2::GetSharedCacheImageHeaderVersion() {
return std::nullopt;
}

StructuredData::ObjectSP AppleObjCRuntimeV2::GetLanguageInfo(SymbolContext sc) {
StructuredData::ObjectSP
AppleObjCRuntimeV2::GetLanguageSpecificData(SymbolContext sc) {
auto dict_up = std::make_unique<StructuredData::Dictionary>();
dict_up->AddItem("Objective-C runtime version",
std::make_unique<StructuredData::UnsignedInteger>(2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime {

std::optional<uint64_t> GetSharedCacheImageHeaderVersion();

StructuredData::ObjectSP GetLanguageInfo(SymbolContext sc) override;
StructuredData::ObjectSP GetLanguageSpecificData(SymbolContext sc) override;

protected:
lldb::BreakpointResolverSP
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Target/LanguageRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ LanguageRuntime::GetRuntimeUnwindPlan(Thread &thread, RegisterContext *regctx,
return UnwindPlanSP();
}

StructuredData::ObjectSP LanguageRuntime::GetLanguageInfo(SymbolContext sc) {
StructuredData::ObjectSP
LanguageRuntime::GetLanguageSpecificData(SymbolContext sc) {
return {};
}

Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Target/StackFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,14 +1231,14 @@ bool StackFrame::IsHidden() {
return false;
}

StructuredData::ObjectSP StackFrame::GetLanguageInfo() {
StructuredData::ObjectSP StackFrame::GetLanguageSpecificData() {
auto process_sp = CalculateProcess();
SourceLanguage language = GetLanguage();
if (!language)
return {};
if (auto runtime_sp =
process_sp->GetLanguageRuntime(language.AsLanguageType()))
return runtime_sp->GetLanguageInfo(
return runtime_sp->GetLanguageSpecificData(
GetSymbolContext(eSymbolContextFunction));
return {};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ def test_imp_ivar_type(self):
self.build()
target, process, thread, bkpt = lldbutil.run_to_name_breakpoint(self, "main")
frame = thread.GetFrameAtIndex(0)
lang_info = frame.GetLanguageInfo()
lang_info = frame.GetLanguageSpecificData()
version = lang_info.GetValueForKey("Objective-C runtime version")
self.assertEqual(version.GetIntegerValue(), 2)
Loading