[Lldb-commits] [PATCH] D141219: Add a .lldbinit file to autoload LLVM/Clang data formatters

2023-01-08 Thread Alexander Richardson via Phabricator via lldb-commits
arichardson created this revision.
arichardson added a reviewer: LLDB.
Herald added a project: All.
arichardson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This makes it much easier to debug LLVM/Clang when using an IDE such as
CLion that defaults to using the project root directory as the CWD for
run targets and therefore allows for this file to be loaded. The only
thing that needs to be configured manually is setting
`settings set target.load-cwd-lldbinit true` in ~/.lldbinit


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141219

Files:
  .lldbinit


Index: .lldbinit
===
--- /dev/null
+++ .lldbinit
@@ -0,0 +1,3 @@
+# To autoload set `settings set target.load-cwd-lldbinit true` in ~/.lldbinit
+command script import ./llvm/utils/lldbDataFormatters.py
+command script import ./clang/utils/ClangDataFormat.py


Index: .lldbinit
===
--- /dev/null
+++ .lldbinit
@@ -0,0 +1,3 @@
+# To autoload set `settings set target.load-cwd-lldbinit true` in ~/.lldbinit
+command script import ./llvm/utils/lldbDataFormatters.py
+command script import ./clang/utils/ClangDataFormat.py
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D141245: [LLDB][LoongArch] ObjectFile: add a case for `EM_LOONGARCH`

2023-01-08 Thread Hui Li via Phabricator via lldb-commits
lh03061238 created this revision.
lh03061238 added reviewers: SixWeining, wangleiat, xen0n, xry111, MaskRay, 
seehearfeel, DavidSpickett.
Herald added a subscriber: emaste.
Herald added a project: All.
lh03061238 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This adds the jump slot mapping for LoongArch. This is a simple
change that ensures lldb running properly.

Note that this problem was found only when CMake variables 
 "DLLVM_ENABLE_ASSERTIONS=ON" is selected.

Without this patch,

  $ build/bin/lldb  test
  
  ../ELFHeader::GetRelocationJumpSlotType() const: Assertion `false && 
"architecture not supported"' fail

With this patch

  $ build/bin/lldb  test
  (lldb) target create "test"
  Current executable set to '../test' (loongarch64).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141245

Files:
  lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp


Index: lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
===
--- lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -211,6 +211,9 @@
   case EM_RISCV:
 slot = R_RISCV_JUMP_SLOT;
 break;
+  case EM_LOONGARCH:
+slot = R_LARCH_JUMP_SLOT;
+break;
   }
 
   return slot;


Index: lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
===
--- lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -211,6 +211,9 @@
   case EM_RISCV:
 slot = R_RISCV_JUMP_SLOT;
 break;
+  case EM_LOONGARCH:
+slot = R_LARCH_JUMP_SLOT;
+break;
   }
 
   return slot;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits