[Lldb-commits] [lldb] [lldb] Fix type lookup in DWARF .o files via debug map (PR #87177)

2024-03-30 Thread Marc Auberer via lldb-commits

marcauberer wrote:

@pabusse Hi, thanks for the patch!
Please remove the semicolons from the python code to make the formatting check 
pass.

https://github.com/llvm/llvm-project/pull/87177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix type lookup in DWARF .o files via debug map (PR #87177)

2024-03-31 Thread Marc Auberer via lldb-commits

https://github.com/marcauberer approved this pull request.


https://github.com/llvm/llvm-project/pull/87177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Remove duplicate disjunction in CumulativeSystemTimeIsValid (PR #89680)

2024-04-22 Thread Marc Auberer via lldb-commits

https://github.com/marcauberer created 
https://github.com/llvm/llvm-project/pull/89680

Resolves #89674

>From d5bd3f32fa0d87c3bed1024857c3fae412702567 Mon Sep 17 00:00:00 2001
From: Marc Auberer 
Date: Tue, 23 Apr 2024 00:05:53 +0200
Subject: [PATCH] [lldb] Remove duplicate disjunction in
 ProcessInstanceInfo::CumulativeSystemTimeIsValid

---
 lldb/include/lldb/Utility/ProcessInfo.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/include/lldb/Utility/ProcessInfo.h 
b/lldb/include/lldb/Utility/ProcessInfo.h
index e9fe71e1b851d1..85489c0ef0a199 100644
--- a/lldb/include/lldb/Utility/ProcessInfo.h
+++ b/lldb/include/lldb/Utility/ProcessInfo.h
@@ -233,8 +233,7 @@ class ProcessInstanceInfo : public ProcessInfo {
   }
 
   bool CumulativeSystemTimeIsValid() const {
-return m_cumulative_system_time.tv_sec > 0 ||
-   m_cumulative_system_time.tv_sec > 0;
+return m_cumulative_system_time.tv_sec > 0;
   }
 
   void Dump(Stream &s, UserIDResolver &resolver) const;

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Remove duplicate disjunction in CumulativeSystemTimeIsValid (PR #89680)

2024-04-22 Thread Marc Auberer via lldb-commits

https://github.com/marcauberer updated 
https://github.com/llvm/llvm-project/pull/89680

>From b626dc5e116fc6c566f8a3be50fac173aa5df653 Mon Sep 17 00:00:00 2001
From: Marc Auberer 
Date: Tue, 23 Apr 2024 00:05:53 +0200
Subject: [PATCH] [lldb] Fix typo in CumulativeSystemTimeIsValid check

---
 lldb/include/lldb/Utility/ProcessInfo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/include/lldb/Utility/ProcessInfo.h 
b/lldb/include/lldb/Utility/ProcessInfo.h
index e9fe71e1b851d1..54ac000dc7fc28 100644
--- a/lldb/include/lldb/Utility/ProcessInfo.h
+++ b/lldb/include/lldb/Utility/ProcessInfo.h
@@ -234,7 +234,7 @@ class ProcessInstanceInfo : public ProcessInfo {
 
   bool CumulativeSystemTimeIsValid() const {
 return m_cumulative_system_time.tv_sec > 0 ||
-   m_cumulative_system_time.tv_sec > 0;
+   m_cumulative_system_time.tv_usec > 0;
   }
 
   void Dump(Stream &s, UserIDResolver &resolver) const;

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typo in CumulativeSystemTimeIsValid check (PR #89680)

2024-04-22 Thread Marc Auberer via lldb-commits

https://github.com/marcauberer edited 
https://github.com/llvm/llvm-project/pull/89680
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typo in CumulativeSystemTimeIsValid check (PR #89680)

2024-04-25 Thread Marc Auberer via lldb-commits

https://github.com/marcauberer updated 
https://github.com/llvm/llvm-project/pull/89680

>From efa805079552cf8f247a499d9b26cfc0ff03db72 Mon Sep 17 00:00:00 2001
From: Marc Auberer 
Date: Tue, 23 Apr 2024 00:05:53 +0200
Subject: [PATCH 1/2] [lldb] Fix typo in CumulativeSystemTimeIsValid check

---
 lldb/include/lldb/Utility/ProcessInfo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/include/lldb/Utility/ProcessInfo.h 
b/lldb/include/lldb/Utility/ProcessInfo.h
index e9fe71e1b851d1..54ac000dc7fc28 100644
--- a/lldb/include/lldb/Utility/ProcessInfo.h
+++ b/lldb/include/lldb/Utility/ProcessInfo.h
@@ -234,7 +234,7 @@ class ProcessInstanceInfo : public ProcessInfo {
 
   bool CumulativeSystemTimeIsValid() const {
 return m_cumulative_system_time.tv_sec > 0 ||
-   m_cumulative_system_time.tv_sec > 0;
+   m_cumulative_system_time.tv_usec > 0;
   }
 
   void Dump(Stream &s, UserIDResolver &resolver) const;

>From c028b104a45b70fb68a3aba79a6d78521cdd593c Mon Sep 17 00:00:00 2001
From: Marc Auberer 
Date: Fri, 26 Apr 2024 00:58:40 +0200
Subject: [PATCH 2/2] Add tests for Cumulative[User|System]TimeIsValid

---
 lldb/unittests/Host/HostTest.cpp | 21 +
 1 file changed, 21 insertions(+)

diff --git a/lldb/unittests/Host/HostTest.cpp b/lldb/unittests/Host/HostTest.cpp
index 5e01a6835c03dc..a1d8a3b7f485a3 100644
--- a/lldb/unittests/Host/HostTest.cpp
+++ b/lldb/unittests/Host/HostTest.cpp
@@ -7,6 +7,7 @@
 
//===--===//
 
 #include "lldb/Host/Host.h"
+#include "lldb/Utility/ProcessInfo.h"
 #include "gtest/gtest.h"
 
 using namespace lldb_private;
@@ -25,3 +26,23 @@ TEST(Host, GetEnvironment) {
   ASSERT_EQ("Host::GetEnvironment",
 Host::GetEnvironment().lookup("LLDB_TEST_ENVIRONMENT_VAR"));
 }
+
+TEST(Host, ProcessInstanceInfoCumulativeUserTimeIsValid) {
+  ProcessInstanceInfo info;
+  info.SetCumulativeUserTime(ProcessInstanceInfo::timespec{0, 0});
+  EXPECT_FALSE(info.CumulativeUserTimeIsValid());
+  info.SetCumulativeUserTime(ProcessInstanceInfo::timespec{0, 1});
+  EXPECT_TRUE(info.CumulativeUserTimeIsValid());
+  info.SetCumulativeUserTime(ProcessInstanceInfo::timespec{1, 0});
+  EXPECT_TRUE(info.CumulativeUserTimeIsValid());
+}
+
+TEST(Host, ProcessInstanceInfoCumulativeSystemTimeIsValid) {
+  ProcessInstanceInfo info;
+  info.SetCumulativeSystemTime(ProcessInstanceInfo::timespec{0, 0});
+  EXPECT_FALSE(info.CumulativeSystemTimeIsValid());
+  info.SetCumulativeSystemTime(ProcessInstanceInfo::timespec{0, 1});
+  EXPECT_TRUE(info.CumulativeSystemTimeIsValid());
+  info.SetCumulativeSystemTime(ProcessInstanceInfo::timespec{1, 0});
+  EXPECT_TRUE(info.CumulativeSystemTimeIsValid());
+}
\ No newline at end of file

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fix typo in CumulativeSystemTimeIsValid check (PR #89680)

2024-04-26 Thread Marc Auberer via lldb-commits

https://github.com/marcauberer closed 
https://github.com/llvm/llvm-project/pull/89680
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits