[Lldb-commits] [PATCH] D138407: [LLDB] Add LoongArch register definitions and operations

2022-11-21 Thread Tiezhu Yang via Phabricator via lldb-commits
seehearfeel created this revision.
seehearfeel added reviewers: SixWeining, wangleiat, xen0n, xry111, MaskRay, 
DavidSpickett.
Herald added a subscriber: StephenFan.
Herald added a project: All.
seehearfeel requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Use the same register layout as Linux kernel, implement the
related read and write operations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138407

Files:
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
  lldb/source/Plugins/Process/Utility/CMakeLists.txt
  lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp
  lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h
  lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.cpp
  lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h
  lldb/source/Plugins/Process/Utility/RegisterInfos_loongarch64.h
  lldb/source/Plugins/Process/Utility/lldb-loongarch-register-enums.h
  lldb/source/Utility/LoongArch_DWARF_Registers.h

Index: lldb/source/Utility/LoongArch_DWARF_Registers.h
===
--- /dev/null
+++ lldb/source/Utility/LoongArch_DWARF_Registers.h
@@ -0,0 +1,117 @@
+//===-- LoongArch_DWARF_Registers.h -*- C++ -*-===//
+//
+// 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
+//
+//===--===//
+
+#ifndef LLDB_SOURCE_UTILITY_LOONGARCH_DWARF_REGISTERS_H
+#define LLDB_SOURCE_UTILITY_LOONGARCH_DWARF_REGISTERS_H
+
+#include "lldb/lldb-private.h"
+
+namespace loongarch_dwarf {
+
+enum {
+  dwarf_gpr_r0 = 0,
+  dwarf_gpr_r1,
+  dwarf_gpr_r2,
+  dwarf_gpr_r3,
+  dwarf_gpr_r4,
+  dwarf_gpr_r5,
+  dwarf_gpr_r6,
+  dwarf_gpr_r7,
+  dwarf_gpr_r8,
+  dwarf_gpr_r9,
+  dwarf_gpr_r10,
+  dwarf_gpr_r11,
+  dwarf_gpr_r12,
+  dwarf_gpr_r13,
+  dwarf_gpr_r14,
+  dwarf_gpr_r15,
+  dwarf_gpr_r16,
+  dwarf_gpr_r17,
+  dwarf_gpr_r18,
+  dwarf_gpr_r19,
+  dwarf_gpr_r20,
+  dwarf_gpr_r21,
+  dwarf_gpr_r22,
+  dwarf_gpr_r23,
+  dwarf_gpr_r24,
+  dwarf_gpr_r25,
+  dwarf_gpr_r26,
+  dwarf_gpr_r27,
+  dwarf_gpr_r28,
+  dwarf_gpr_r29,
+  dwarf_gpr_r30,
+  dwarf_gpr_r31 = 31,
+
+  dwarf_gpr_orig_a0,
+  dwarf_gpr_pc,
+  dwarf_gpr_badv,
+
+  dwarf_gpr_reserved0 = 35,
+  dwarf_gpr_reserved1,
+  dwarf_gpr_reserved2,
+  dwarf_gpr_reserved3,
+  dwarf_gpr_reserved4,
+  dwarf_gpr_reserved5,
+  dwarf_gpr_reserved6,
+  dwarf_gpr_reserved7,
+  dwarf_gpr_reserved8,
+  dwarf_gpr_reserved9,
+
+  dwarf_fpr_f0 = 45,
+  dwarf_fpr_f1,
+  dwarf_fpr_f2,
+  dwarf_fpr_f3,
+  dwarf_fpr_f4,
+  dwarf_fpr_f5,
+  dwarf_fpr_f6,
+  dwarf_fpr_f7,
+  dwarf_fpr_f8,
+  dwarf_fpr_f9,
+  dwarf_fpr_f10,
+  dwarf_fpr_f11,
+  dwarf_fpr_f12,
+  dwarf_fpr_f13,
+  dwarf_fpr_f14,
+  dwarf_fpr_f15,
+  dwarf_fpr_f16,
+  dwarf_fpr_f17,
+  dwarf_fpr_f18,
+  dwarf_fpr_f19,
+  dwarf_fpr_f20,
+  dwarf_fpr_f21,
+  dwarf_fpr_f22,
+  dwarf_fpr_f23,
+  dwarf_fpr_f24,
+  dwarf_fpr_f25,
+  dwarf_fpr_f26,
+  dwarf_fpr_f27,
+  dwarf_fpr_f28,
+  dwarf_fpr_f29,
+  dwarf_fpr_f30,
+  dwarf_fpr_f31 = 76,
+
+  dwarf_fpr_fcc0,
+  dwarf_fpr_fcc1,
+  dwarf_fpr_fcc2,
+  dwarf_fpr_fcc3,
+  dwarf_fpr_fcc4,
+  dwarf_fpr_fcc5,
+  dwarf_fpr_fcc6,
+  dwarf_fpr_fcc7,
+  dwarf_fpr_fcsr,
+
+  // register name alias
+  dwarf_gpr_ra = dwarf_gpr_r1,
+  dwarf_gpr_sp = dwarf_gpr_r3,
+  dwarf_gpr_fp = dwarf_gpr_r22,
+
+};
+
+} // namespace loongarch_dwarf
+
+#endif // LLDB_SOURCE_UTILITY_LOONGARCH_DWARF_REGISTERS_H
Index: lldb/source/Plugins/Process/Utility/lldb-loongarch-register-enums.h
===
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/lldb-loongarch-register-enums.h
@@ -0,0 +1,116 @@
+//===-- lldb-loongarch-register-enums.h -*- C++ -*-===//
+//
+// 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
+//
+//===--===//
+
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_LOONGARCH_REGISTER_ENUMS_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_LOONGARCH_REGISTER_ENUMS_H
+
+// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
+
+// Internal codes for all loongarch registers.
+enum {
+  // The same order as user_regs_struct in 
+  // note: these enum values are used as byte_offset
+  gpr_first_loongarch = 0,
+  gpr_r0_loongarch = gpr_first_loongarch,
+  gpr_r1_loongarch,
+  gpr_r2_loongarch,
+  gpr_r3_loongarch,
+  gpr_r4_loongarch,
+  gpr_r5_loongarch,
+  gpr_r6_

[Lldb-commits] [PATCH] D138348: [lldb] Fix SBFileSpec.fullpath

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

cool


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138348/new/

https://reviews.llvm.org/D138348

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


[Lldb-commits] [PATCH] D137983: [lldb] Disable looking at pointee types to find synthetic value for non-ObjC

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Okay, here goes nothing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137983/new/

https://reviews.llvm.org/D137983

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


[Lldb-commits] [PATCH] D137873: [LLDB][Minidump] Use plugin.object-file.pe-coff.abi as minidump process abi when OS is Windows.

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Did you look at the Target::MergeArchitecture function? Is there a suitable 
place where we could insert a call to that function so that the executable 
object file environment is automatically propagated to the target?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137873/new/

https://reviews.llvm.org/D137873

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


[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I have a somewhat high level question. Do we actually want 
(SB)Type::IsTypeComplete to return true for these kinds of types?

For clang's benefit, we have to pretend that the AST objects are complete (and 
empty), but we're not similarly restricted in our own representations of those 
types, so we could theoretically just answer `false` here (and possibly have 
some additional method to indicate that the type is strange in some way).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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


[Lldb-commits] [lldb] 5b6e67a - [lldb] Enable TestTargetVar on non-darwin

2022-11-21 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2022-11-21T13:26:01+01:00
New Revision: 5b6e67a92b3a28605ac6394d2f657847a09548c0

URL: 
https://github.com/llvm/llvm-project/commit/5b6e67a92b3a28605ac6394d2f657847a09548c0
DIFF: 
https://github.com/llvm/llvm-project/commit/5b6e67a92b3a28605ac6394d2f657847a09548c0.diff

LOG: [lldb] Enable TestTargetVar on non-darwin

Added: 


Modified: 
lldb/test/API/functionalities/target_var/TestTargetVar.py

Removed: 




diff  --git a/lldb/test/API/functionalities/target_var/TestTargetVar.py 
b/lldb/test/API/functionalities/target_var/TestTargetVar.py
index db8c92ae01db4..62d93647a1324 100644
--- a/lldb/test/API/functionalities/target_var/TestTargetVar.py
+++ b/lldb/test/API/functionalities/target_var/TestTargetVar.py
@@ -10,7 +10,6 @@
 
 class targetCommandTestCase(TestBase):
 
-@skipUnlessDarwin
 @skipIfDarwinEmbedded   # needs x86_64
 @skipIf(debug_info="gmodules")  # not relevant
 @skipIf(compiler="clang", compiler_version=['<', '7.0'])



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


[Lldb-commits] [PATCH] D138430: [lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform()

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added a reviewer: JDevlieghere.
Herald added a project: All.
labath requested review of this revision.
Herald added a project: LLDB.

Previously, we just used the platform name. This worked mostly OK, but
it required adding special handling for any unusual (and potentially
downstream) platform plugins, as evidenced by the hardcoding of the
qemu-user platform.

The current implementation was added in
D121605 
/21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d 
, which 
this essentially
reverts and goes back to the previous method of retrieving the platform
name from the platform triple (the "OS" field).

The motivation for D121605  was the ability 
to retrieve the process
without constructing an SBDebugger object (which would be necessary in a
world where SBPlatforms are managed by SBDebuggers). However, this world
did not arrive (mainly due to other commitments on my part), and I now
think that if we do want to go in that direction, that we should just
create a dummy/empty SBDebugger object for holding the initial
SBPlatform.

One benefit of D121605  was the unification 
of getPlatform and
getHostPlatform code paths, and I preserve that benefit by unifying them
in the other direction -- using the host SBPlatform for getHostPlatform.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138430

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/lldbplatformutil.py

Index: lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
===
--- lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -98,21 +98,23 @@
 return dictionary
 
 
+def _get_platform_os(p):
+# Use the triple to determine the platform if set.
+triple = p.GetTriple()
+if triple:
+platform = triple.split('-')[2]
+if platform.startswith('freebsd'):
+platform = 'freebsd'
+elif platform.startswith('netbsd'):
+platform = 'netbsd'
+return platform
+
+return ''
+
+
 def getHostPlatform():
 """Returns the host platform running the test suite."""
-# Attempts to return a platform name matching a target Triple platform.
-if sys.platform.startswith('linux'):
-return 'linux'
-elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
-return 'windows'
-elif sys.platform.startswith('darwin'):
-return 'macosx'
-elif sys.platform.startswith('freebsd'):
-return 'freebsd'
-elif sys.platform.startswith('netbsd'):
-return 'netbsd'
-else:
-return sys.platform
+return _get_platform_os(lldb.SBPlatform("host"))
 
 
 def getDarwinOSTriples():
@@ -130,16 +132,7 @@
 platform = 'ios'
 return platform
 
-platform = configuration.lldb_platform_name
-if platform is None:
-platform = "host"
-if platform == "qemu-user":
-platform = "host"
-if platform == "host":
-return getHostPlatform()
-if platform.startswith("remote-"):
-return platform[7:]
-return platform
+return _get_platform_os(lldb.selected_platform)
 
 
 def platformIsDarwin():
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -849,14 +849,14 @@
 skip_msg = "Skipping %s tests, as they are not compatible with remote testing on this platform"
 if lldbplatformutil.platformIsDarwin():
 configuration.skip_categories.append("llgs")
-if configuration.lldb_platform_name:
+if lldb.remote_platform:
 # 
 configuration.skip_categories.append("debugserver")
 if configuration.verbose:
 print(skip_msg%"debugserver");
 else:
 configuration.skip_categories.append("debugserver")
-if configuration.lldb_platform_name and lldbplatformutil.getPlatform() == "windows":
+if lldb.remote_platform and lldbplatformutil.getPlatform() == "windows":
 configuration.skip_categories.append("llgs")
 if configuration.verbose:
 print(skip_msg%"lldb-server");
@@ -891,14 +891,6 @@
 lldb.SBDebugger.Initialize()
 lldb.SBDebugger.PrintStackTraceOnError()
 
-checkLibcxxSupport()
-checkLibstdcxxSupport()
-checkWatchpointSupport()
-checkDebugInfoSupport()
-checkDebugServerSupport()
-checkObjcSupport()
-checkForkVForkSupport()
-
 # Use host platform by default.
 lldb.remote_platform = None
 lldb.selected_platform = lldb.SBPlatform.GetHostPlatform()
@@ -957,8 +949,16 @@
   

[Lldb-commits] [PATCH] D137247: [lldb] Allow plugins to extend DWARF expression parsing for vendor extensions

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Looks ok, module some inline comments.




Comment at: lldb/source/Expression/DWARFExpression.cpp:2580
+llvm::dyn_cast(symbol_file)) {
+  symbol_file = &dwo_symbol_file->GetBaseSymbolFile();
+}

For other methods, we just have the dwo class override the method and call the 
main file instead.



Comment at: lldb/source/Expression/DWARFExpressionList.cpp:93
   const DWARFExpression &expr = m_exprs.GetEntryRef(0).data;
-  return expr.ContainsThreadLocalStorage();
+  return expr.ContainsThreadLocalStorage(*m_dwarf_cu);
 }

DavidSpickett wrote:
> pfaffe wrote:
> > DavidSpickett wrote:
> > > I'm not sure that `m_dwarf_cu` is always non null. It might be in 
> > > practice but for example one use ends up in 
> > > `UpdateValueTypeFromLocationDescription` which checks that it is not null 
> > > before use.
> > > 
> > > Maybe it is reasonable to assume it is never null (and if it is and you 
> > > have the time, a preparatory patch to make it a ref would be great).
> > I think it's worth checking in general. Before 
> > https://reviews.llvm.org/D125509, the DWARFExpression used to be assiciated 
> > with its dwarf_cu. I was considering bringing that back, what do you think? 
> I think you should ask the author of that change :)
> 
> On the surface that change makes sense but I'm no expert. If that's the case 
> then you'll just want to sprinkle some `if not nullptr` around wherever you 
> use it.
> 
> (nullptrs are fine if there is a reason to use the null state)
DWARF expressions are used in contexts where there is no DWARF unit to speak 
of. Our use of DWARF expressions in PDB (the motivation behind that patch) is 
questionable at best, but DWARF expressions are also used in eh_frame for 
instance, which I think would be a good reason to keep DWARFExpression 
DWARFUnit-free. OTOH, some of the DWARF operations cannot be evaluated without 
a DWARFUnit, so I don't know...



Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h:45
 
+  SymbolFileDWARF &GetBaseSymbolFile() const { return m_base_symbol_file; }
+

and then you don't need to make this public.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137247/new/

https://reviews.llvm.org/D137247

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


[Lldb-commits] [lldb] ae7a3e1 - [test][lldb-vscode] Un-realpath coreFile test.

2022-11-21 Thread Jordan Rupprecht via lldb-commits

Author: Jordan Rupprecht
Date: 2022-11-21T08:32:49-08:00
New Revision: ae7a3e1c1d3ed7125c2436b9fd50512f7548acd7

URL: 
https://github.com/llvm/llvm-project/commit/ae7a3e1c1d3ed7125c2436b9fd50512f7548acd7
DIFF: 
https://github.com/llvm/llvm-project/commit/ae7a3e1c1d3ed7125c2436b9fd50512f7548acd7.diff

LOG: [test][lldb-vscode] Un-realpath coreFile test.

TestVSCode_coreFile looks for an exe/core file in the same directory as the 
test. It first calls `realpath`, but I don't think it's necessary. Using 
`realpath` prevents this test from working when run as part of a build system 
that uses content-addressed-storage, i.e. all the files might all be symlinks 
in the same directory pointing to files in different directories elsewhere. If 
some amount of normalization is needed, maybe `os.path.normpath()` would be 
useful, although I wouldn't see why that's needed either.

(This is a fairly trivial patch, but I'm mailing it to see if there is a reason 
we need to keep `realpath`, and if so, if there's some other workaround we can 
do).

Differential Revision: https://reviews.llvm.org/D138345

Added: 


Modified: 
lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py 
b/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
index b9018ab6db501..ee6993953221f 100644
--- a/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
+++ b/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
@@ -17,7 +17,7 @@ class 
TestVSCode_coreFile(lldbvscode_testcase.VSCodeTestCaseBase):
 @skipIfRemote
 @skipIfLLVMTargetMissing("X86")
 def test_core_file(self):
-current_dir = os.path.dirname(os.path.realpath(__file__))
+current_dir = os.path.dirname(__file__)
 exe_file = os.path.join(current_dir, "linux-x86_64.out")
 core_file = os.path.join(current_dir, "linux-x86_64.core")
 
@@ -44,7 +44,7 @@ def test_core_file(self):
 @skipIfLLVMTargetMissing("X86")
 def test_core_file_source_mapping(self):
 ''' Test that sourceMap property is correctly applied when loading a 
core '''
-current_dir = os.path.dirname(os.path.realpath(__file__))
+current_dir = os.path.dirname(__file__)
 exe_file = os.path.join(current_dir, "linux-x86_64.out")
 core_file = os.path.join(current_dir, "linux-x86_64.core")
 



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


[Lldb-commits] [PATCH] D138345: [test][lldb-vscode] Un-realpath coreFile test.

2022-11-21 Thread Jordan Rupprecht via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGae7a3e1c1d3e: [test][lldb-vscode] Un-realpath coreFile test. 
(authored by rupprecht).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138345/new/

https://reviews.llvm.org/D138345

Files:
  lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py


Index: lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
===
--- lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
+++ lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
@@ -17,7 +17,7 @@
 @skipIfRemote
 @skipIfLLVMTargetMissing("X86")
 def test_core_file(self):
-current_dir = os.path.dirname(os.path.realpath(__file__))
+current_dir = os.path.dirname(__file__)
 exe_file = os.path.join(current_dir, "linux-x86_64.out")
 core_file = os.path.join(current_dir, "linux-x86_64.core")
 
@@ -44,7 +44,7 @@
 @skipIfLLVMTargetMissing("X86")
 def test_core_file_source_mapping(self):
 ''' Test that sourceMap property is correctly applied when loading a 
core '''
-current_dir = os.path.dirname(os.path.realpath(__file__))
+current_dir = os.path.dirname(__file__)
 exe_file = os.path.join(current_dir, "linux-x86_64.out")
 core_file = os.path.join(current_dir, "linux-x86_64.core")
 


Index: lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
===
--- lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
+++ lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
@@ -17,7 +17,7 @@
 @skipIfRemote
 @skipIfLLVMTargetMissing("X86")
 def test_core_file(self):
-current_dir = os.path.dirname(os.path.realpath(__file__))
+current_dir = os.path.dirname(__file__)
 exe_file = os.path.join(current_dir, "linux-x86_64.out")
 core_file = os.path.join(current_dir, "linux-x86_64.core")
 
@@ -44,7 +44,7 @@
 @skipIfLLVMTargetMissing("X86")
 def test_core_file_source_mapping(self):
 ''' Test that sourceMap property is correctly applied when loading a core '''
-current_dir = os.path.dirname(os.path.realpath(__file__))
+current_dir = os.path.dirname(__file__)
 exe_file = os.path.join(current_dir, "linux-x86_64.out")
 core_file = os.path.join(current_dir, "linux-x86_64.core")
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D137900: Make only one function that needs to be implemented when searching for types.

2022-11-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Adrian: so it doesn't seem to make sense to try and get rid of all set 
accessors because it really complicates the way the TypeQuery is used. We have 
places where a type query is being create and modified as we parse options from 
a command line command and we need to change the type query. I have gotten rid 
of most of the set accessors and mainly try to use one of 3 or 4 constructors 
now. There is only 1 set accessor now. Let me know what you think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137900/new/

https://reviews.llvm.org/D137900

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


[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D138259#3940689 , @labath wrote:

> I have a somewhat high level question. Do we actually want 
> (SB)Type::IsTypeComplete to return true for these kinds of types?
>
> For clang's benefit, we have to pretend that the AST objects are complete 
> (and empty), but we're not similarly restricted in our own representations of 
> those types, so we could theoretically just answer `false` here (and possibly 
> have some additional method to indicate that the type is strange in some way).

If we have a forward declaration to a type, it is ok for that type to be 
incomplete. So for a variable like "struct Foo; Foo *foo = ...", it is ok for 
"Foo" to not be complete here. But if we have "Foo foo = ...;" then it isn't ok 
for Foo to not be complete. We need to tell the difference between "a type is 
incomplete and it is ok" and "a type should be complete but isn't and you are 
losing information that should have been available for you to debug".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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


[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D138259#3941431 , @clayborg wrote:

> "a type should be complete but isn't and you are losing information that 
> should have been available for you to debug".

I agree, but there are still two (or more) ways to communicate that information.

1. "this type is complete" + "actually, I'm just missing the debug info and 
pretending it's complete"
2. "this type is incomplete" + "it is incomplete because I am missing its debug 
info"

My question is which method would be more useful to the user.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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


[Lldb-commits] [lldb] 8b80e8e - [lldb] Disable looking at pointee types to find synthetic value for non-ObjC

2022-11-21 Thread Arthur Eubanks via lldb-commits

Author: Arthur Eubanks
Date: 2022-11-21T09:30:29-08:00
New Revision: 8b80e8ee1fca660a5ea58cf701c2af8bba0dd89b

URL: 
https://github.com/llvm/llvm-project/commit/8b80e8ee1fca660a5ea58cf701c2af8bba0dd89b
DIFF: 
https://github.com/llvm/llvm-project/commit/8b80e8ee1fca660a5ea58cf701c2af8bba0dd89b.diff

LOG: [lldb] Disable looking at pointee types to find synthetic value for 
non-ObjC

After D134378, we started seeing crashes with incomplete types (in the
context of shared libraries).

When trying to print a `std::vector &` with only debug info for a
declaration, we now try to use the formatter after D134378. With an
incomplete type, this somehow goes into infinite recursion with the
frames

```
lldb_private::ValueObject::Dereference
lldb_private::ValueObjectSynthetic::CreateSynthFilter
lldb_private::ValueObjectSynthetic::ValueObjectSynthetic
lldb_private::ValueObject::CalculateSyntheticValue
lldb_private::ValueObject::HasSyntheticValue
```

This has to do with `FrontEndWantsDereference` that some STL formatters
set, causing recursion between the formatter (which tries to dereference),
and dereferencing (which wants to know if there's a formatter to avoid 
dereferencing).

The reason this only started appearing after D134378 was because
previously with incomplete types, for names with `<`, lldb would attempt
to parse template parameter DIEs, which were empty, then create an empty
`ClassTemplateSpecializationDecl` which overrode the name used to lookup
a formatter in `FormattersMatchData()` to not include template
parameters (e.g. `std::vector<> &`). After D134378 we don't create a
`ClassTemplateSpecializationDecl` when there are no template parameters
and the name to lookup a formatter is the original name (e.g.
`std::vector &`).

The code to try harder with incomplete child compiler types was added in
D79554 for ObjC purposes.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D137983

Added: 
lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp

Modified: 
lldb/source/Core/ValueObject.cpp

Removed: 




diff  --git a/lldb/source/Core/ValueObject.cpp 
b/lldb/source/Core/ValueObject.cpp
index 19d86bee40e1f..081f9c2cf5dcf 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -2673,7 +2673,10 @@ ValueObjectSP ValueObject::Dereference(Status &error) {
 // In case of incomplete child compiler type, use the pointee type and try
 // to recreate a new ValueObjectChild using it.
 if (!m_deref_valobj) {
-  if (HasSyntheticValue()) {
+  // FIXME(#59012): C++ stdlib formatters break with incomplete types (e.g.
+  // `std::vector &`). Remove ObjC restriction once that's resolved.
+  if (Language::LanguageIsObjC(GetPreferredDisplayLanguage()) &&
+  HasSyntheticValue()) {
 child_compiler_type = compiler_type.GetPointeeType();
 
 if (child_compiler_type) {

diff  --git a/lldb/test/API/lang/cpp/incomplete-stl-types/Makefile 
b/lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
new file mode 100644
index 0..2fd1763a62bb6
--- /dev/null
+++ b/lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
@@ -0,0 +1,9 @@
+CXX_SOURCES := main.cpp f.cpp
+
+include Makefile.rules
+
+# Force main.cpp to be built with no debug information
+main.o: CFLAGS = $(CFLAGS_NO_DEBUG)
+
+# And force -flimit-debug-info on the rest.
+f.o: CFLAGS_EXTRAS += $(LIMIT_DEBUG_INFO_FLAGS)

diff  --git 
a/lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py 
b/lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
new file mode 100644
index 0..06d960cd5c9f3
--- /dev/null
+++ b/lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
@@ -0,0 +1,18 @@
+"""
+Test situations where the debug info only has a declaration, no definition, for
+an STL container with a formatter.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestStlIncompleteTypes(TestBase):
+def test(self):
+self.build()
+lldbutil.run_to_source_breakpoint(self, "// break here", 
lldb.SBFileSpec("f.cpp"))
+
+var = self.frame().GetValueForVariablePath("v")
+self.assertIn("set", var.GetDisplayTypeName())

diff  --git a/lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp 
b/lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
new file mode 100644
index 0..af330d7db7709
--- /dev/null
+++ b/lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
@@ -0,0 +1,5 @@
+#include 
+
+void f(std::set &v) {
+  // break here
+}

diff  --git a/lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp 
b/lldb/test/API/lang/cpp/incomplete-stl-types/main

[Lldb-commits] [PATCH] D137983: [lldb] Disable looking at pointee types to find synthetic value for non-ObjC

2022-11-21 Thread Arthur Eubanks via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8b80e8ee1fca: [lldb] Disable looking at pointee types to 
find synthetic value for non-ObjC (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137983/new/

https://reviews.llvm.org/D137983

Files:
  lldb/source/Core/ValueObject.cpp
  lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
  lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
  lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
  lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp


Index: lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp
@@ -0,0 +1,8 @@
+#include 
+
+void f(std::set &v);
+
+int main() {
+  std::set v;
+  f(v);
+}
Index: lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
@@ -0,0 +1,5 @@
+#include 
+
+void f(std::set &v) {
+  // break here
+}
Index: lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
@@ -0,0 +1,18 @@
+"""
+Test situations where the debug info only has a declaration, no definition, for
+an STL container with a formatter.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestStlIncompleteTypes(TestBase):
+def test(self):
+self.build()
+lldbutil.run_to_source_breakpoint(self, "// break here", 
lldb.SBFileSpec("f.cpp"))
+
+var = self.frame().GetValueForVariablePath("v")
+self.assertIn("set", var.GetDisplayTypeName())
Index: lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
@@ -0,0 +1,9 @@
+CXX_SOURCES := main.cpp f.cpp
+
+include Makefile.rules
+
+# Force main.cpp to be built with no debug information
+main.o: CFLAGS = $(CFLAGS_NO_DEBUG)
+
+# And force -flimit-debug-info on the rest.
+f.o: CFLAGS_EXTRAS += $(LIMIT_DEBUG_INFO_FLAGS)
Index: lldb/source/Core/ValueObject.cpp
===
--- lldb/source/Core/ValueObject.cpp
+++ lldb/source/Core/ValueObject.cpp
@@ -2673,7 +2673,10 @@
 // In case of incomplete child compiler type, use the pointee type and try
 // to recreate a new ValueObjectChild using it.
 if (!m_deref_valobj) {
-  if (HasSyntheticValue()) {
+  // FIXME(#59012): C++ stdlib formatters break with incomplete types (e.g.
+  // `std::vector &`). Remove ObjC restriction once that's resolved.
+  if (Language::LanguageIsObjC(GetPreferredDisplayLanguage()) &&
+  HasSyntheticValue()) {
 child_compiler_type = compiler_type.GetPointeeType();
 
 if (child_compiler_type) {


Index: lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/main.cpp
@@ -0,0 +1,8 @@
+#include 
+
+void f(std::set &v);
+
+int main() {
+  std::set v;
+  f(v);
+}
Index: lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/f.cpp
@@ -0,0 +1,5 @@
+#include 
+
+void f(std::set &v) {
+  // break here
+}
Index: lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/TestStlIncompleteTypes.py
@@ -0,0 +1,18 @@
+"""
+Test situations where the debug info only has a declaration, no definition, for
+an STL container with a formatter.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestStlIncompleteTypes(TestBase):
+def test(self):
+self.build()
+lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("f.cpp"))
+
+var = self.frame().GetValueForVariablePath("v")
+self.assertIn("set", var.GetDisplayTypeName())
Index: lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
===
--- /dev/null
+++ lldb/test/API/lang/cpp/incomplete-stl-types/Makefile
@@ -0,0 +1,9 @@
+CXX_SOURCES := main.cpp f.cpp
+
+include Makefile.rules
+
+# Force main.cpp to be built with no debug information
+main.o: CFLAGS = $(CFLAGS_NO_DEBUG)
+
+# And force -flimit-debug-info on the rest.
+f.o: C

[Lldb-commits] [PATCH] D138197: [lldb] Fix bitfield incorrectly printing when field crosses a storage unit

2022-11-21 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

Thanks for working on this. Due to llvm dev and vacation it took me a while to 
get to this.




Comment at: 
lldb/test/API/commands/expression/expr-bitfield-on-boundary/Makefile:3
+
+CXXFLAGS_EXTRAS := -gdwarf-2
+

Add a comment here to explain why we need dwarf v2 specifically.

Which I think is because in v4 the encoding is done such that you won't get a 
negative offset?



Comment at: 
lldb/test/API/commands/expression/expr-bitfield-on-boundary/main.cpp:3
+  unsigned char a : 7;
+  unsigned char b : 4;
+};

Comment here that b is going across the byte boundary.

Maybe on the packed too, iirc without packed it would assign one whole byte to 
each of a and b.



Comment at: 
lldb/test/API/commands/expression/expr-bitfield-on-boundary/main.cpp:9
+  f.a = 1;
+  f.b = 2;
+  return 0; // Break here

`b` is going to be across the boundary, should we use a value that is also 
across the boundary?

Something like 9, so you have `0b1001`. One bit on both sides of the boundary. 
Just in case lldb actually is dropping one side of the value and we aren't 
checking for that.



Comment at: lldb/unittests/Platform/PlatformSiginfoTest.cpp:62
 for (auto field_name : llvm::split(path, '.')) {
-  uint64_t bit_offset;
   ASSERT_NE(field_type.GetIndexOfFieldWithName(field_name.str().c_str(),

Are you reasonably sure you found all these cases? Don't want to loose the sign 
because of an implicit cast.

If not, `-Wconversion` is worth a go though lldb probably has hundreds of those 
already. Perhaps compare the number of those warnings before and after this 
change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138197/new/

https://reviews.llvm.org/D138197

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


[Lldb-commits] [lldb] 82a46cd - [test] Remove named function arguments from TestSBEnvironment

2022-11-21 Thread Jordan Rupprecht via lldb-commits

Author: Jordan Rupprecht
Date: 2022-11-21T10:05:41-08:00
New Revision: 82a46cd247c3980f86443a54fbe0a124beee7d26

URL: 
https://github.com/llvm/llvm-project/commit/82a46cd247c3980f86443a54fbe0a124beee7d26
DIFF: 
https://github.com/llvm/llvm-project/commit/82a46cd247c3980f86443a54fbe0a124beee7d26.diff

LOG: [test] Remove named function arguments from TestSBEnvironment

This is not available in all versions of swig 3.

Added: 


Modified: 
lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py

Removed: 




diff  --git a/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py 
b/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
index dfd919b40eb5d..8144ceeaa62bb 100644
--- a/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
+++ b/lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
@@ -41,25 +41,27 @@ def test_launch_info(self):
 env = launch_info.GetEnvironment()
 env_count = env.GetNumValues()
 
-env.Set("FOO", "bar", overwrite=True)
+env.Set("FOO", "bar", True)
 self.assertEqual(env.GetNumValues(), env_count + 1)
 
 # Make sure we only modify the copy of the launchInfo's environment
 self.assertEqual(launch_info.GetEnvironment().GetNumValues(), 
env_count)
 
-launch_info.SetEnvironment(env, append=True)
+# Note: swig >= 3.0.3 can use named parameters, omit to support <= 
3.0.2.
+# i.e. launch_info.SetEnvironment(env, append=True)
+launch_info.SetEnvironment(env, True)
 self.assertEqual(launch_info.GetEnvironment().GetNumValues(), 
env_count + 1)
 
-env.Set("FOO", "baz", overwrite=True)
-launch_info.SetEnvironment(env, append=True)
+env.Set("FOO", "baz", True)
+launch_info.SetEnvironment(env, True)
 self.assertEqual(launch_info.GetEnvironment().GetNumValues(), 
env_count + 1)
 self.assertEqual(launch_info.GetEnvironment().Get("FOO"), "baz")
 
 # Make sure we can replace the launchInfo's environment
 env.Clear()
-env.Set("BAR", "foo", overwrite=True)
+env.Set("BAR", "foo", True)
 env.PutEntry("X=y")
-launch_info.SetEnvironment(env, append=False)
+launch_info.SetEnvironment(env, False)
 self.assertEqualEntries(launch_info.GetEnvironment(), ["BAR=foo", 
"X=y"])
 
 
@@ -87,8 +89,10 @@ def test_creating_and_modifying_environment(self):
 self.assertEqual(env.Get("BAR"), None)
 
 # We also test empty values
-self.assertTrue(env.Set("FOO", "", overwrite=False))
-env.Set("BAR", "foo", overwrite=False)
+# Note: swig >= 3.0.3 can use named parameters, omit to support <= 
3.0.2.
+# i.e. env.Set("FOO", "", overwrite=False)
+self.assertTrue(env.Set("FOO", "", False))
+env.Set("BAR", "foo", False)
 
 self.assertEqual(env.Get("FOO"), "")
 self.assertEqual(env.Get("BAR"), "foo")
@@ -98,7 +102,7 @@ def test_creating_and_modifying_environment(self):
 self.assertEqualEntries(env, ["FOO=", "BAR=foo"])
 
 # Make sure modifications work
-self.assertFalse(env.Set("FOO", "bar", overwrite=False))
+self.assertFalse(env.Set("FOO", "bar", False))
 self.assertEqual(env.Get("FOO"), "")
 
 env.PutEntry("FOO=bar")
@@ -115,15 +119,15 @@ def test_creating_and_modifying_environment(self):
 entries = lldb.SBStringList()
 entries.AppendList(["X=x", "Y=y"], 2)
 
-env.SetEntries(entries, append=True)
+env.SetEntries(entries, True)
 self.assertEqualEntries(env, ["BAR=foo", "X=x", "Y=y"])
 
-env.SetEntries(entries, append=False)
+env.SetEntries(entries, False)
 self.assertEqualEntries(env, ["X=x", "Y=y"])
 
 entries.Clear()
 entries.AppendList(["X=y", "Y=x"], 2)
-env.SetEntries(entries, append=True)
+env.SetEntries(entries, True)
 self.assertEqualEntries(env, ["X=y", "Y=x"])
 
 # Test clear



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


[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D138259#3941465 , @labath wrote:

> In D138259#3941431 , @clayborg 
> wrote:
>
>> "a type should be complete but isn't and you are losing information that 
>> should have been available for you to debug".
>
> I agree, but there are still two (or more) ways to communicate that 
> information.
>
> 1. "this type is complete" + "actually, I'm just missing the debug info and 
> pretending it's complete"
> 2. "this type is incomplete" + "it is incomplete because I am missing its 
> debug info"
>
> My question is which method would be more useful to the user.

Gotcha. We could change "bool SBType::IsTypeComplete()" to return false, and 
then add a new:

  bool SBType::ShouldBeComplete();

That would return true if IsTypeComplete() returned false because it was 
forcefully completed.

The main issue with doing it this way is if you ask if type if it is complete 
by calling "bool SBType::IsTypeComplete()", you will force the type to complete 
itself to be able to answer the question. Right now if you have a GUI debugger 
and you just show the top level variables, we never need to complete any of the 
types unless the user turns them open in the GUI. The main reason for this API 
in SBType is for GUI debuggers to be able to indicate there is a problem to the 
user, but we don't want it to cause the debugger to realize types when it 
doesn't need to. The current IsTypeForcefullyCompleted() won't need to complete 
the type in order to figure out the result.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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


[Lldb-commits] [lldb] 71b2ff7 - [test] Fix TestSourceManager when the source file is readonly.

2022-11-21 Thread Jordan Rupprecht via lldb-commits

Author: Jordan Rupprecht
Date: 2022-11-21T11:56:02-08:00
New Revision: 71b2ff79043aea637335b28299e978b678fd83bd

URL: 
https://github.com/llvm/llvm-project/commit/71b2ff79043aea637335b28299e978b678fd83bd
DIFF: 
https://github.com/llvm/llvm-project/commit/71b2ff79043aea637335b28299e978b678fd83bd.diff

LOG: [test] Fix TestSourceManager when the source file is readonly.

This test copies main.c to main-copy.c and modifies main-copy.c while 
debugging, but main.c may have come from a readonly location, which means 
writing to main-copy.c will fail because permissions are preserved. Run the 
equivalent of "chmod u+w" before attempting to modify it.

This effect can be seen by attempting to run this test after running `chmod u-w 
lldb/test/API/source-manager/main.c`

Added: 


Modified: 
lldb/test/API/source-manager/TestSourceManager.py

Removed: 




diff  --git a/lldb/test/API/source-manager/TestSourceManager.py 
b/lldb/test/API/source-manager/TestSourceManager.py
index 439366c989875..9f087b91a7f6c 100644
--- a/lldb/test/API/source-manager/TestSourceManager.py
+++ b/lldb/test/API/source-manager/TestSourceManager.py
@@ -9,6 +9,9 @@
   Test the caching mechanism of the source manager.
 """
 
+import os
+import stat
+
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
@@ -220,6 +223,11 @@ def test_modify_source_file_while_debugging(self):
 new_content = original_content.replace('Hello world', 'Hello lldb', 1)
 
 # Modify the source code file.
+# If the source was read only, the copy will also be read only.
+# Run "chmod u+w" on it first so we can modify it.
+statinfo = os.stat(self.file)
+os.chmod(self.file, statinfo.st_mode | stat.S_IWUSR)
+
 with io.open(self.file, 'w', newline='\n') as f:
 time.sleep(1)
 f.write(new_content)



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


[Lldb-commits] [lldb] a59ed8f - [lldb] Fix SBFileSpec.fullpath

2022-11-21 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-11-21T12:09:44-08:00
New Revision: a59ed8fa86036efe66efcaddd5cd3e1d17856563

URL: 
https://github.com/llvm/llvm-project/commit/a59ed8fa86036efe66efcaddd5cd3e1d17856563
DIFF: 
https://github.com/llvm/llvm-project/commit/a59ed8fa86036efe66efcaddd5cd3e1d17856563.diff

LOG: [lldb] Fix SBFileSpec.fullpath

Reimplement `SBFileSpec.fullpath` to (indirectly) use `FileSpec::GetPath`.

Instead of hardcoding a `/` separator, use `GetPath`. This makes use of the
`FileSpec`'s internal style, which for example allows for backslash on Windows
where required.

It's not obvious from looking at the source, but the `fullpath` property is
implemented with `str`, which calls `GetDescription`, which finally calls
`GetPath`.

Differential Revision: https://reviews.llvm.org/D138348

Added: 


Modified: 
lldb/bindings/interface/SBFileSpec.i

Removed: 




diff  --git a/lldb/bindings/interface/SBFileSpec.i 
b/lldb/bindings/interface/SBFileSpec.i
index b549321487ec2..e6f9bb81e2402 100644
--- a/lldb/bindings/interface/SBFileSpec.i
+++ b/lldb/bindings/interface/SBFileSpec.i
@@ -84,18 +84,7 @@ public:
 
 #ifdef SWIGPYTHON
 %pythoncode %{
-def __get_fullpath__(self):
-spec_dir = self.GetDirectory()
-spec_file = self.GetFilename()
-if spec_dir and spec_file:
-return '%s/%s' % (spec_dir, spec_file)
-elif spec_dir:
-return spec_dir
-elif spec_file:
-return spec_file
-return None
-
-fullpath = property(__get_fullpath__, None, doc='''A read only 
property that returns the fullpath as a python string.''')
+fullpath = property(str, None, doc='''A read only property that 
returns the fullpath as a python string.''')
 basename = property(GetFilename, None, doc='''A read only property 
that returns the path basename as a python string.''')
 dirname = property(GetDirectory, None, doc='''A read only property 
that returns the path directory name as a python string.''')
 exists = property(Exists, None, doc='''A read only property that 
returns a boolean value that indicates if the file exists.''')



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


[Lldb-commits] [PATCH] D138348: [lldb] Fix SBFileSpec.fullpath

2022-11-21 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa59ed8fa8603: [lldb] Fix SBFileSpec.fullpath (authored by 
kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138348/new/

https://reviews.llvm.org/D138348

Files:
  lldb/bindings/interface/SBFileSpec.i


Index: lldb/bindings/interface/SBFileSpec.i
===
--- lldb/bindings/interface/SBFileSpec.i
+++ lldb/bindings/interface/SBFileSpec.i
@@ -84,18 +84,7 @@
 
 #ifdef SWIGPYTHON
 %pythoncode %{
-def __get_fullpath__(self):
-spec_dir = self.GetDirectory()
-spec_file = self.GetFilename()
-if spec_dir and spec_file:
-return '%s/%s' % (spec_dir, spec_file)
-elif spec_dir:
-return spec_dir
-elif spec_file:
-return spec_file
-return None
-
-fullpath = property(__get_fullpath__, None, doc='''A read only 
property that returns the fullpath as a python string.''')
+fullpath = property(str, None, doc='''A read only property that 
returns the fullpath as a python string.''')
 basename = property(GetFilename, None, doc='''A read only property 
that returns the path basename as a python string.''')
 dirname = property(GetDirectory, None, doc='''A read only property 
that returns the path directory name as a python string.''')
 exists = property(Exists, None, doc='''A read only property that 
returns a boolean value that indicates if the file exists.''')


Index: lldb/bindings/interface/SBFileSpec.i
===
--- lldb/bindings/interface/SBFileSpec.i
+++ lldb/bindings/interface/SBFileSpec.i
@@ -84,18 +84,7 @@
 
 #ifdef SWIGPYTHON
 %pythoncode %{
-def __get_fullpath__(self):
-spec_dir = self.GetDirectory()
-spec_file = self.GetFilename()
-if spec_dir and spec_file:
-return '%s/%s' % (spec_dir, spec_file)
-elif spec_dir:
-return spec_dir
-elif spec_file:
-return spec_file
-return None
-
-fullpath = property(__get_fullpath__, None, doc='''A read only property that returns the fullpath as a python string.''')
+fullpath = property(str, None, doc='''A read only property that returns the fullpath as a python string.''')
 basename = property(GetFilename, None, doc='''A read only property that returns the path basename as a python string.''')
 dirname = property(GetDirectory, None, doc='''A read only property that returns the path directory name as a python string.''')
 exists = property(Exists, None, doc='''A read only property that returns a boolean value that indicates if the file exists.''')
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] ba87147 - Revert "[lldb] Fix SBFileSpec.fullpath"

2022-11-21 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-11-21T12:31:43-08:00
New Revision: ba87147881c8f6592aea0cbdb22d0028e78b30d8

URL: 
https://github.com/llvm/llvm-project/commit/ba87147881c8f6592aea0cbdb22d0028e78b30d8
DIFF: 
https://github.com/llvm/llvm-project/commit/ba87147881c8f6592aea0cbdb22d0028e78b30d8.diff

LOG: Revert "[lldb] Fix SBFileSpec.fullpath"

This reverts commit a59ed8fa86036efe66efcaddd5cd3e1d17856563.

Added: 


Modified: 
lldb/bindings/interface/SBFileSpec.i

Removed: 




diff  --git a/lldb/bindings/interface/SBFileSpec.i 
b/lldb/bindings/interface/SBFileSpec.i
index e6f9bb81e2402..b549321487ec2 100644
--- a/lldb/bindings/interface/SBFileSpec.i
+++ b/lldb/bindings/interface/SBFileSpec.i
@@ -84,7 +84,18 @@ public:
 
 #ifdef SWIGPYTHON
 %pythoncode %{
-fullpath = property(str, None, doc='''A read only property that 
returns the fullpath as a python string.''')
+def __get_fullpath__(self):
+spec_dir = self.GetDirectory()
+spec_file = self.GetFilename()
+if spec_dir and spec_file:
+return '%s/%s' % (spec_dir, spec_file)
+elif spec_dir:
+return spec_dir
+elif spec_file:
+return spec_file
+return None
+
+fullpath = property(__get_fullpath__, None, doc='''A read only 
property that returns the fullpath as a python string.''')
 basename = property(GetFilename, None, doc='''A read only property 
that returns the path basename as a python string.''')
 dirname = property(GetDirectory, None, doc='''A read only property 
that returns the path directory name as a python string.''')
 exists = property(Exists, None, doc='''A read only property that 
returns a boolean value that indicates if the file exists.''')



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


[Lldb-commits] [lldb] b3f15cc - Reland "[lldb] Fix SBFileSpec.fullpath"

2022-11-21 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-11-21T12:45:27-08:00
New Revision: b3f15ccf54cf8094507137d145b38313aa785d61

URL: 
https://github.com/llvm/llvm-project/commit/b3f15ccf54cf8094507137d145b38313aa785d61
DIFF: 
https://github.com/llvm/llvm-project/commit/b3f15ccf54cf8094507137d145b38313aa785d61.diff

LOG: Reland "[lldb] Fix SBFileSpec.fullpath"

Update `fullpath` asserts in TestMiniDump.py.

This reverts commit 682fcc95f4149f00e9da961817fe2f5832e4b301.

Added: 


Modified: 
lldb/bindings/interface/SBFileSpec.i
lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py

Removed: 




diff  --git a/lldb/bindings/interface/SBFileSpec.i 
b/lldb/bindings/interface/SBFileSpec.i
index b549321487ec2..e6f9bb81e2402 100644
--- a/lldb/bindings/interface/SBFileSpec.i
+++ b/lldb/bindings/interface/SBFileSpec.i
@@ -84,18 +84,7 @@ public:
 
 #ifdef SWIGPYTHON
 %pythoncode %{
-def __get_fullpath__(self):
-spec_dir = self.GetDirectory()
-spec_file = self.GetFilename()
-if spec_dir and spec_file:
-return '%s/%s' % (spec_dir, spec_file)
-elif spec_dir:
-return spec_dir
-elif spec_file:
-return spec_file
-return None
-
-fullpath = property(__get_fullpath__, None, doc='''A read only 
property that returns the fullpath as a python string.''')
+fullpath = property(str, None, doc='''A read only property that 
returns the fullpath as a python string.''')
 basename = property(GetFilename, None, doc='''A read only property 
that returns the path basename as a python string.''')
 dirname = property(GetDirectory, None, doc='''A read only property 
that returns the path directory name as a python string.''')
 exists = property(Exists, None, doc='''A read only property that 
returns a boolean value that indicates if the file exists.''')

diff  --git a/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py 
b/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
index e36f1af89e9ca..777548c39253d 100644
--- a/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
+++ b/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
@@ -44,27 +44,27 @@ def test_modules_in_mini_dump(self):
 self.assertTrue(self.process, PROCESS_IS_VALID)
 expected_modules = [
 {
-'filename' : r"C:\Users\amccarth\Documents\Visual Studio 
2013\Projects\fizzbuzz\Debug/fizzbuzz.exe",
+'filename' : r"C:\Users\amccarth\Documents\Visual Studio 
2013\Projects\fizzbuzz\Debug\fizzbuzz.exe",
 'uuid' : '0F45B791-9A96-46F9-BF8F-2D6076EA421A-0011',
 },
 {
-'filename' : r"C:\Windows\SysWOW64/ntdll.dll",
+'filename' : r"C:\Windows\SysWOW64\ntdll.dll",
 'uuid' : 'BBB0846A-402C-4052-A16B-67650BBFE6B0-0002',
 },
 {
-'filename' : r"C:\Windows\SysWOW64/kernel32.dll",
+'filename' : r"C:\Windows\SysWOW64\kernel32.dll",
 'uuid' : 'E5CB7E1B-005E-4113-AB98-98D6913B52D8-0002',
 },
 {
-'filename' : r"C:\Windows\SysWOW64/KERNELBASE.dll",
+'filename' : r"C:\Windows\SysWOW64\KERNELBASE.dll",
 'uuid' : '0BF95241-CB0D-4BD4-AC5D-186A6452E522-0001',
 },
 {
-'filename' : r"C:\Windows\System32/MSVCP120D.dll",
+'filename' : r"C:\Windows\System32\MSVCP120D.dll",
 'uuid' : '3C05516E-57E7-40EB-8D3F-9722C5BD80DD-0001',
 },
 {
-'filename' : r"C:\Windows\System32/MSVCR120D.dll",
+'filename' : r"C:\Windows\System32\MSVCR120D.dll",
 'uuid' : '6382FB86-46C4-4046-AE42-8D97B3F91FF2-0001',
 },
 ]



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


[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread jeffrey tan via Phabricator via lldb-commits
yinghuitan added inline comments.



Comment at: lldb/source/Core/ValueObject.cpp:600
+  // no member variables or member functions will be available.
+  if (GetCompilerType().IsForcefullyCompleted()) {
+  destination = "";

Is this shown in lldb-vscode? If so, can I suggest we add a VSCode test for it 
if not too much work? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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


[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread jeffrey tan via Phabricator via lldb-commits
yinghuitan added a comment.

Also, do you have any plan to record this happening in statistics dump so that 
our telemetry can report it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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


[Lldb-commits] [PATCH] D137873: [LLDB][Minidump] Use plugin.object-file.pe-coff.abi as minidump process abi when OS is Windows.

2022-11-21 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu updated this revision to Diff 477008.
zequanwu edited the summary of this revision.
zequanwu added a comment.

Merge executable module's architecture into target's architecture.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137873/new/

https://reviews.llvm.org/D137873

Files:
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/test/Shell/Minidump/Windows/find-module.test
  lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml


Index: 
lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml
===
--- lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml
+++ lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml
@@ -50,7 +50,7 @@
 ...
 
 --- !COFF
-OptionalHeader:  
+OptionalHeader:
   AddressOfEntryPoint: 0
   ImageBase:   720896
   SectionAlignment: 4096
@@ -67,13 +67,13 @@
   SizeOfStackCommit: 4096
   SizeOfHeapReserve: 1048576
   SizeOfHeapCommit: 4096
-  Debug:   
+  Debug:
 RelativeVirtualAddress: 8192
 Size:28
-header:  
-  Machine: IMAGE_FILE_MACHINE_AMD64
+header:
+  Machine: IMAGE_FILE_MACHINE_I386
   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, 
IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
-sections:
+sections:
   - Name:.text
 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, 
IMAGE_SCN_MEM_READ ]
 VirtualAddress:  4096
Index: lldb/test/Shell/Minidump/Windows/find-module.test
===
--- lldb/test/Shell/Minidump/Windows/find-module.test
+++ lldb/test/Shell/Minidump/Windows/find-module.test
@@ -4,7 +4,25 @@
 RUN: yaml2obj %S/Inputs/find-module.exe.yaml -o %T/find-module.exe
 RUN: yaml2obj %S/Inputs/find-module.dmp.yaml -o %T/find-module.dmp
 RUN: %lldb -O "settings set target.exec-search-paths %T" \
-RUN:   -c %T/find-module.dmp -o "image dump objfile" -o exit | FileCheck %s
+RUN:   -c %T/find-module.dmp -o "image dump objfile" -o "target list" -o exit \
+RUN:   | FileCheck --check-prefix=DEFAULT %s
 
-CHECK-LABEL: image dump objfile
-CHECK: ObjectFilePECOFF, file = '{{.*}}find-module.exe', arch = i386
+RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi msvc" \
+RUN:   -O "settings set target.exec-search-paths %T" -c %T/find-module.dmp \
+RUN:   -o "target list" -o exit | FileCheck --check-prefix=MSVC %s
+
+RUN: %lldb -O "settings set plugin.object-file.pe-coff.abi gnu" \
+RUN:   -O "settings set target.exec-search-paths %T" -c %T/find-module.dmp \
+RUN:   -o "target list" -o exit | FileCheck --check-prefix=GNU %s
+
+DEFAULT-LABEL: image dump objfile
+DEFAULT: ObjectFilePECOFF, file = '{{.*}}find-module.exe', arch = i386
+
+DEFAULT-LABEL: target list
+DEFAULT: arch=i386-pc-windows-{{msvc|gnu}}
+
+MSVC-LABEL: target list
+MSVC: arch=i386-pc-windows-msvc
+
+GNU-LABEL: target list
+GNU: arch=i386-pc-windows-gnu
Index: lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
===
--- lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -290,7 +290,8 @@
   SetUnixSignals(UnixSignals::Create(GetArchitecture()));
 
   ReadModuleList();
-
+  if (ModuleSP module = GetTarget().GetExecutableModule())
+GetTarget().MergeArchitecture(module->GetArchitecture());
   llvm::Optional pid = m_minidump_parser->GetPid();
   if (!pid) {
 Debugger::ReportWarning("unable to retrieve process ID from minidump file, 
"


Index: lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml
===
--- lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml
+++ lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml
@@ -50,7 +50,7 @@
 ...
 
 --- !COFF
-OptionalHeader:  
+OptionalHeader:
   AddressOfEntryPoint: 0
   ImageBase:   720896
   SectionAlignment: 4096
@@ -67,13 +67,13 @@
   SizeOfStackCommit: 4096
   SizeOfHeapReserve: 1048576
   SizeOfHeapCommit: 4096
-  Debug:   
+  Debug:
 RelativeVirtualAddress: 8192
 Size:28
-header:  
-  Machine: IMAGE_FILE_MACHINE_AMD64
+header:
+  Machine: IMAGE_FILE_MACHINE_I386
   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
-sections:
+sections:
   - Name:.text
 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
 VirtualAddress:  4096
Index: lldb/test/Shell/Minidump/Windows/find-module.test
===
--- lldb/test/Shell/Minidump/Windows/find-module.test
+++ lldb/test/Shell/Minidump/Windows/find-module.test
@@ -4,7 +4,25 @@
 RUN:

[Lldb-commits] [PATCH] D137873: [LLDB][Minidump] Use plugin.object-file.pe-coff.abi as minidump process abi when OS is Windows.

2022-11-21 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu added inline comments.



Comment at: 
lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win-no-memory-info.yaml:74
+header:
+  Machine: IMAGE_FILE_MACHINE_I386
   Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, 
IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]

Processor Arch is X86, so this should be i386.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137873/new/

https://reviews.llvm.org/D137873

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


[Lldb-commits] [PATCH] D137217: [LTO][COFF] Use bitcode file names in lto native object file names.

2022-11-21 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu updated this revision to Diff 477014.
zequanwu added a comment.

Update `Twine` argument to `const Twine&`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137217/new/

https://reviews.llvm.org/D137217

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
  lld/COFF/LTO.cpp
  lld/COFF/LTO.h
  lld/ELF/LTO.cpp
  lld/MachO/LTO.cpp
  lld/test/COFF/lto-obj-path.ll
  lld/test/COFF/pdb-thinlto.ll
  lld/test/COFF/thinlto.ll
  lld/wasm/LTO.cpp
  lldb/source/Core/DataFileCache.cpp
  llvm/include/llvm/Support/Caching.h
  llvm/lib/Debuginfod/Debuginfod.cpp
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/Support/Caching.cpp
  llvm/tools/llvm-lto/llvm-lto.cpp
  llvm/tools/llvm-lto2/llvm-lto2.cpp

Index: llvm/tools/llvm-lto2/llvm-lto2.cpp
===
--- llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -411,7 +411,9 @@
   if (HasErrors)
 return 1;
 
-  auto AddStream = [&](size_t Task) -> std::unique_ptr {
+  auto AddStream =
+  [&](size_t Task,
+  const Twine &ModuleName) -> std::unique_ptr {
 std::string Path = OutputFilename + "." + utostr(Task);
 
 std::error_code EC;
@@ -420,8 +422,9 @@
 return std::make_unique(std::move(S), Path);
   };
 
-  auto AddBuffer = [&](size_t Task, std::unique_ptr MB) {
-*AddStream(Task)->OS << MB->getBuffer();
+  auto AddBuffer = [&](size_t Task, const Twine &ModuleName,
+   std::unique_ptr MB) {
+*AddStream(Task, ModuleName)->OS << MB->getBuffer();
   };
 
   FileCache Cache;
Index: llvm/tools/llvm-lto/llvm-lto.cpp
===
--- llvm/tools/llvm-lto/llvm-lto.cpp
+++ llvm/tools/llvm-lto/llvm-lto.cpp
@@ -317,11 +317,11 @@
   if (!CurrentActivity.empty())
 OS << ' ' << CurrentActivity;
   OS << ": ";
-  
+
   DiagnosticPrinterRawOStream DP(OS);
   DI.print(DP);
   OS << '\n';
-  
+
   if (DI.getSeverity() == DS_Error)
 exit(1);
   return true;
@@ -1099,7 +1099,9 @@
 error("writing merged module failed.");
 }
 
-auto AddStream = [&](size_t Task) -> std::unique_ptr {
+auto AddStream =
+[&](size_t Task,
+const Twine &ModuleName) -> std::unique_ptr {
   std::string PartFilename = OutputFilename;
   if (Parallelism != 1)
 PartFilename += "." + utostr(Task);
Index: llvm/lib/Support/Caching.cpp
===
--- llvm/lib/Support/Caching.cpp
+++ llvm/lib/Support/Caching.cpp
@@ -26,9 +26,9 @@
 
 using namespace llvm;
 
-Expected llvm::localCache(Twine CacheNameRef,
- Twine TempFilePrefixRef,
- Twine CacheDirectoryPathRef,
+Expected llvm::localCache(const Twine &CacheNameRef,
+ const Twine &TempFilePrefixRef,
+ const Twine &CacheDirectoryPathRef,
  AddBufferFn AddBuffer) {
 
   // Create local copies which are safely captured-by-copy in lambdas
@@ -37,7 +37,8 @@
   TempFilePrefixRef.toVector(TempFilePrefix);
   CacheDirectoryPathRef.toVector(CacheDirectoryPath);
 
-  return [=](unsigned Task, StringRef Key) -> Expected {
+  return [=](unsigned Task, StringRef Key,
+ const Twine &ModuleName) -> Expected {
 // This choice of file name allows the cache to be pruned (see pruneCache()
 // in include/llvm/Support/CachePruning.h).
 SmallString<64> EntryPath;
@@ -54,7 +55,7 @@
 /*RequiresNullTerminator=*/false);
   sys::fs::closeFile(*FDOrErr);
   if (MBOrErr) {
-AddBuffer(Task, std::move(*MBOrErr));
+AddBuffer(Task, ModuleName, std::move(*MBOrErr));
 return AddStreamFn();
   }
   EC = MBOrErr.getError();
@@ -77,14 +78,15 @@
 struct CacheStream : CachedFileStream {
   AddBufferFn AddBuffer;
   sys::fs::TempFile TempFile;
+  std::string ModuleName;
   unsigned Task;
 
   CacheStream(std::unique_ptr OS, AddBufferFn AddBuffer,
   sys::fs::TempFile TempFile, std::string EntryPath,
-  unsigned Task)
+  std::string ModuleName, unsigned Task)
   : CachedFileStream(std::move(OS), std::move(EntryPath)),
 AddBuffer(std::move(AddBuffer)), TempFile(std::move(TempFile)),
-Task(Task) {}
+ModuleName(ModuleName), Task(Task) {}
 
   ~CacheStream() {
 // TODO: Manually commit rather than using non-trivial destructor,
@@ -133,11 +135,12 @@
  TempFile.TmpName + " to " + ObjectPathName + ": " +
  toString(std::move(E)) + "\n");
 
-AddBuffer(Task, std::move(*MBOrErr));

[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

2022-11-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D138259#3942246 , @yinghuitan 
wrote:

> Also, do you have any plan to record this happening in statistics dump so 
> that our telemetry can report it?

I do, that will be a separate patch I will make once this patch is in.




Comment at: lldb/source/Core/ValueObject.cpp:600
+  // no member variables or member functions will be available.
+  if (GetCompilerType().IsForcefullyCompleted()) {
+  destination = "";

yinghuitan wrote:
> Is this shown in lldb-vscode? If so, can I suggest we add a VSCode test for 
> it if not too much work? 
It will show up as the summary, no need to duplicate the functionality in 
another location


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138259/new/

https://reviews.llvm.org/D138259

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