jasonmolenda wrote:
I don't want to derail the conversation about this PR, but I've been wanting to
overhaul our Target::ReadMemory and Process::ReadMemory API in lldb for months
now, and haven't put together a coherent proposal for it yet. I need to clear
a few things off my task list and ge
@@ -174,6 +177,86 @@ struct StatisticsOptions {
std::optional m_include_transcript;
};
+/// A class that represents statistics about a TypeSummaryProviders invocations
+class SummaryStatistics {
+public:
+ explicit SummaryStatistics(std::string name, std::string impl_type)
@@ -174,6 +177,86 @@ struct StatisticsOptions {
std::optional m_include_transcript;
};
+/// A class that represents statistics about a TypeSummaryProviders invocations
+class SummaryStatistics {
+public:
+ explicit SummaryStatistics(std::string name, std::string impl_type)
@@ -0,0 +1,35 @@
+// Test that the lldb command `statistics` works.
Jlalond wrote:
Sounds good, any sample test cases of multi threaded access I can steal the
homework of?
https://github.com/llvm/llvm-project/pull/102708
https://github.com/clayborg requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/102708
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -174,6 +177,86 @@ struct StatisticsOptions {
std::optional m_include_transcript;
};
+/// A class that represents statistics about a TypeSummaryProviders invocations
+class SummaryStatistics {
+public:
+ explicit SummaryStatistics(std::string name, std::string impl_type)
@@ -201,3 +216,12 @@ std::string ScriptSummaryFormat::GetDescription() {
}
return std::string(sstr.GetString());
}
+
+std::string ScriptSummaryFormat::GetName() { return m_script_formatter_name; }
+
+std::string ScriptSummaryFormat::GetSummaryKindName() {
+ if (!m_python_s
@@ -615,7 +615,16 @@ bool ValueObject::GetSummaryAsCString(TypeSummaryImpl
*summary_ptr,
m_synthetic_value->UpdateValueIfNeeded(); // the summary might depend on
// the synthetic children being
@@ -408,3 +410,21 @@ llvm::json::Value DebuggerStats::ReportStatistics(
return std::move(global_stats);
}
+
+llvm::json::Value SummaryStatistics::ToJSON() const {
+ return json::Object{{
+ {"name", GetName()},
+ {"type", GetSummaryKindName()},
+ {"invocationC
https://github.com/Jlalond updated
https://github.com/llvm/llvm-project/pull/102708
>From c0a7286b0107d3161b18de8f05d4d016150e96a5 Mon Sep 17 00:00:00 2001
From: Jacob Lalonde
Date: Thu, 8 Aug 2024 08:58:52 -0700
Subject: [PATCH 01/10] Initial attempt at new classes Summary statistics in
Summa
@@ -201,3 +216,12 @@ std::string ScriptSummaryFormat::GetDescription() {
}
return std::string(sstr.GetString());
}
+
+std::string ScriptSummaryFormat::GetName() { return m_script_formatter_name; }
+
+std::string ScriptSummaryFormat::GetSummaryKindName() {
+ if (!m_python_s
@@ -408,3 +410,21 @@ llvm::json::Value DebuggerStats::ReportStatistics(
return std::move(global_stats);
}
+
+llvm::json::Value SummaryStatistics::ToJSON() const {
+ return json::Object{{
+ {"name", GetName()},
+ {"type", GetSummaryKindName()},
+ {"invocationC
@@ -174,6 +177,83 @@ struct StatisticsOptions {
std::optional m_include_transcript;
};
+/// A class that represents statistics about a TypeSummaryProviders invocations
+class SummaryStatistics {
+public:
+ explicit SummaryStatistics(std::string name, std::string impl_type)
https://github.com/boredhuman created
https://github.com/llvm/llvm-project/pull/104398
Singular warning I noticed when compiling lldb.
>From 70bff417af642a6232264b3ef51584ef089afa2b Mon Sep 17 00:00:00 2001
From: Daniel
Date: Thu, 15 Aug 2024 00:09:25 -0400
Subject: [PATCH] [LLDB][OSX] Removed
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be
notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Daniel Wedzicha (boredhuman)
Changes
Singular warning I noticed when compiling lldb.
---
Full diff: https://github.com/llvm/llvm-project/pull/104398.diff
1 Files Affected:
- (modified) lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm (+1
https://github.com/walter-erquinigo approved this pull request.
https://github.com/llvm/llvm-project/pull/104398
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Author: Daniel Wedzicha
Date: 2024-08-15T00:23:40-04:00
New Revision: b4dc9869381f91af419ec170837ac324d09525e5
URL:
https://github.com/llvm/llvm-project/commit/b4dc9869381f91af419ec170837ac324d09525e5
DIFF:
https://github.com/llvm/llvm-project/commit/b4dc9869381f91af419ec170837ac324d09525e5.dif
https://github.com/walter-erquinigo closed
https://github.com/llvm/llvm-project/pull/104398
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
walter-erquinigo wrote:
Thank you!
https://github.com/llvm/llvm-project/pull/104398
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
github-actions[bot] wrote:
@boredhuman Congratulations on having your first Pull Request (PR) merged into
the LLVM Project!
Your changes will be combined with recent changes from other authors, then
tested
by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with
a bui
DmT021 wrote:
Could you please explain to me why we use different rules in symbol lookups?
Namely:
-
[ClangExpressionDeclMap::GetSymbolAddress](https://github.com/llvm/llvm-project/pull/102835/files#diff-5d2da8306a4f4991885836925979f188658789adc8041c37811c243f2cdca24c)
doesn't search in the Mo
clayborg wrote:
> Could you please explain to me why we use different rules in symbol lookups?
> Namely:
>
> *
> [ClangExpressionDeclMap::GetSymbolAddress](https://github.com/llvm/llvm-project/pull/102835/files#diff-5d2da8306a4f4991885836925979f188658789adc8041c37811c243f2cdca24c)
> doesn't s
@@ -174,6 +177,83 @@ struct StatisticsOptions {
std::optional m_include_transcript;
};
+/// A class that represents statistics about a TypeSummaryProviders invocations
+class SummaryStatistics {
+public:
+ explicit SummaryStatistics(std::string name, std::string impl_type)
@@ -174,6 +177,83 @@ struct StatisticsOptions {
std::optional m_include_transcript;
};
+/// A class that represents statistics about a TypeSummaryProviders invocations
+class SummaryStatistics {
+public:
+ explicit SummaryStatistics(std::string name, std::string impl_type)
https://github.com/clayborg requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/104317
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -1085,6 +1085,19 @@ std::string
VariableDescription::GetResult(llvm::StringRef context) {
return description.trim().str();
}
+lldb::addr_t GetMemoryReference(lldb::SBValue v) {
+ if (!v.GetType().IsPointerType() && !v.GetType().IsArrayType()) {
+return LLDB_INVALID_
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object
&request) {
response.try_emplace("body", std::move(body));
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+
+// "ReadMemoryRequest": {
+// "allOf": [ { "$ref": "#/definitions/Request" },
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object
&request) {
response.try_emplace("body", std::move(body));
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+
+// "ReadMemoryRequest": {
+// "allOf": [ { "$ref": "#/definitions/Request" },
@@ -1085,6 +1085,19 @@ std::string
VariableDescription::GetResult(llvm::StringRef context) {
return description.trim().str();
}
+lldb::addr_t GetMemoryReference(lldb::SBValue v) {
clayborg wrote:
If we return a `std::optional` it will clean up the call sit
@@ -3600,8 +3617,12 @@ void request_setVariable(const llvm::json::Object
&request) {
if (variable.MightHaveChildren())
newVariablesReference = g_dap.variables.InsertExpandableVariable(
variable, /*is_permanent=*/false);
-
body.try_emplace("vari
@@ -1411,6 +1422,10 @@ void request_evaluate(const llvm::json::Object &request)
{
} else {
body.try_emplace("variablesReference", (int64_t)0);
}
+ if (lldb::addr_t addr = GetMemoryReference(value);
+ addr != LLDB_INVALID_ADDRESS) {
+bo
@@ -1253,6 +1274,10 @@ llvm::json::Value CreateVariable(lldb::SBValue v,
int64_t variablesReference,
else
object.try_emplace("variablesReference", (int64_t)0);
+ if (lldb::addr_t addr = GetMemoryReference(v); addr != LLDB_INVALID_ADDRESS)
{
+object.try_emplace("me
@@ -411,6 +411,12 @@ struct VariableDescription {
std::string GetResult(llvm::StringRef context);
};
+/// Get the corresponding `memoryReference` for a value.
+///
+/// According to the DAP documentation, the `memoryReference` should
+/// refer to the pointee, not to the add
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object
&request) {
response.try_emplace("body", std::move(body));
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+
+// "ReadMemoryRequest": {
+// "allOf": [ { "$ref": "#/definitions/Request" },
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object
&request) {
response.try_emplace("body", std::move(body));
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+
+// "ReadMemoryRequest": {
+// "allOf": [ { "$ref": "#/definitions/Request" },
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object
&request) {
response.try_emplace("body", std::move(body));
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+
+// "ReadMemoryRequest": {
+// "allOf": [ { "$ref": "#/definitions/Request" },
@@ -4028,6 +4049,154 @@ void request_disassemble(const llvm::json::Object
&request) {
response.try_emplace("body", std::move(body));
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+
+// "ReadMemoryRequest": {
+// "allOf": [ { "$ref": "#/definitions/Request" },
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
return error;
}
+std::optional
+ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) {
+ ELFLinuxPrPsInfo prpsinfo{};
+ prpsinfo.pr_pid = process_sp->GetID();
+ ProcessInstanceInfo in
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
return error;
}
+std::optional
+ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) {
+ ELFLinuxPrPsInfo prpsinfo{};
+ prpsinfo.pr_pid = process_sp->GetID();
+ ProcessInstanceInfo in
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
return error;
}
+std::optional
+ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) {
+ ELFLinuxPrPsInfo prpsinfo{};
+ prpsinfo.pr_pid = process_sp->GetID();
+ ProcessInstanceInfo in
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
return error;
}
+std::optional
+ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) {
+ ELFLinuxPrPsInfo prpsinfo{};
+ prpsinfo.pr_pid = process_sp->GetID();
+ ProcessInstanceInfo in
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
return error;
}
+std::optional
+ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) {
+ ELFLinuxPrPsInfo prpsinfo{};
+ prpsinfo.pr_pid = process_sp->GetID();
+ ProcessInstanceInfo in
@@ -318,6 +318,32 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data,
return error;
}
+static struct compat_timeval
+copy_timespecs(const ProcessInstanceInfo::timespec &oth) {
+ using sec_t = decltype(compat_timeval::tv_sec);
+ using usec_t = decltype(compat_timev
@@ -394,6 +420,107 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
return error;
}
+std::optional
+ELFLinuxPrPsInfo::Populate(const lldb::ProcessSP &process_sp) {
+ ELFLinuxPrPsInfo prpsinfo{};
+ prpsinfo.pr_pid = process_sp->GetID();
+ ProcessInstanceInfo in
@@ -318,6 +318,32 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data,
return error;
}
+static struct compat_timeval
+copy_timespecs(const ProcessInstanceInfo::timespec &oth) {
+ using sec_t = decltype(compat_timeval::tv_sec);
+ using usec_t = decltype(compat_timev
@@ -29,10 +29,10 @@
ThreadPlanSingleThreadTimeout::ThreadPlanSingleThreadTimeout(
: ThreadPlan(ThreadPlan::eKindSingleThreadTimeout, "Single thread timeout",
thread, eVoteNo, eVoteNoOpinion),
m_info(info), m_state(State::WaitTimeout) {
- // TODO: re
https://github.com/clayborg approved this pull request.
https://github.com/llvm/llvm-project/pull/104041
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
101 - 148 of 148 matches
Mail list logo