[Lldb-commits] [PATCH] D147370: [lldb] fixing #61727 fixing incorrect variable displaying with DW_OP_div

2023-05-02 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl added a comment.

The test seems to rely on the presence of the linker for the desired target 
platform, so cannot be used on cross-compile environment.

   TEST 'lldb-shell :: 
SymbolFile/DWARF/x86/DW_OP_div-with-signed.s' FAILED 
  Script:
  --
  : 'RUN: at line 3';   
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang 
--target=specify-a-target-or-use-a-_host-substitution --target=x86_64-pc-linux 
-o 
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/DW_OP_div-with-signed.s.tmp
 
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/DW_OP_div-with-signed.s
  : 'RUN: at line 4';   
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/lldb --no-lldbinit -S 
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/test/Shell/lit-lldb-init-quiet
 
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/DW_OP_div-with-signed.s.tmp
 -o "b f" -o "r" -o "c" -o "c" -o "expression -T -- i"  -o "exit" | 
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/FileCheck 
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/DW_OP_div-with-signed.s
  --
  Exit Code: 1
  Command Output (stderr):
  --
  /usr/bin/ld: unrecognised emulation mode: elf_x86_64
  Supported emulations: armelf_linux_eabi armelfb_linux_eabi
  clang: error: linker command failed with exit code 1 (use -v to see 
invocation)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147370

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


[Lldb-commits] [PATCH] D147370: [lldb] fixing #61727 fixing incorrect variable displaying with DW_OP_div

2023-05-02 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl added a comment.

This seems to fail on ARM: 
https://lab.llvm.org/buildbot/#/builders/17/builds/37130


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147370

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


[Lldb-commits] [PATCH] D149262: [lldb] Add settings for expression evaluation memory allocations.

2023-05-02 Thread Anton Korobeynikov via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8be139fc1251: [lldb] Add settings for expression evaluation 
memory allocations. (authored by kuilpd, committed by asl).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149262

Files:
  lldb/include/lldb/Target/ABI.h
  lldb/include/lldb/Target/Target.h
  lldb/source/Expression/IRMemoryMap.cpp
  lldb/source/Expression/LLVMUserExpression.cpp
  lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.h
  lldb/source/Target/Target.cpp
  lldb/source/Target/TargetProperties.td
  lldb/test/API/commands/expression/memory-allocation/Makefile
  lldb/test/API/commands/expression/memory-allocation/TestMemoryAllocSettings.py
  lldb/test/API/commands/expression/memory-allocation/main.cpp

Index: lldb/test/API/commands/expression/memory-allocation/main.cpp
===
--- /dev/null
+++ lldb/test/API/commands/expression/memory-allocation/main.cpp
@@ -0,0 +1,3 @@
+int main() {
+  return 0;
+}
Index: lldb/test/API/commands/expression/memory-allocation/TestMemoryAllocSettings.py
===
--- /dev/null
+++ lldb/test/API/commands/expression/memory-allocation/TestMemoryAllocSettings.py
@@ -0,0 +1,35 @@
+"""
+Test changing setting for expression memory allocation.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestMemoryAllocSettings(TestBase):
+
+def test(self):
+"""Test changing settings for expression memory allocation."""
+self.build()
+target = self.createTestTarget()
+
+self.log_file = self.getBuildArtifact("log-expr.txt")
+
+self.runCmd("settings set target.expr-alloc-address 0xdead")
+self.runCmd("settings set target.expr-alloc-size 1")
+self.runCmd("settings set target.expr-alloc-align 0x1000")
+
+self.runCmd("log enable lldb expr -f " + self.log_file)
+self.runCmd("expression -- int foo; ")
+
+self.assertTrue(os.path.isfile(self.log_file))
+with open(self.log_file, 'r') as f:
+log = f.read()
+
+alloc0 = re.search('^.*IRMemoryMap::Malloc.+?0xdead.*$', log, re.MULTILINE)
+# Malloc adds additional bytes to allocation size, hence 10007
+alloc1 = re.search('^.*IRMemoryMap::Malloc\s*?\(10007.+?0xdead1000.*$', log, re.MULTILINE)
+self.assertTrue(alloc0, "Couldn't find an allocation at a given address.")
+self.assertTrue(alloc1, "Couldn't find an allocation of a given size at a given address.")
+
Index: lldb/test/API/commands/expression/memory-allocation/Makefile
===
--- /dev/null
+++ lldb/test/API/commands/expression/memory-allocation/Makefile
@@ -0,0 +1,3 @@
+CXX_SOURCES := main.cpp
+
+include Makefile.rules
Index: lldb/source/Target/TargetProperties.td
===
--- lldb/source/Target/TargetProperties.td
+++ lldb/source/Target/TargetProperties.td
@@ -24,6 +24,15 @@
 DefaultUnsignedValue<5>,
 Desc<"The maximum amount of errors to emit while parsing an expression. "
  "A value of 0 means to always continue parsing if possible.">;
+  def ExprAllocAddress: Property<"expr-alloc-address", "UInt64">,
+DefaultUnsignedValue<0>,
+Desc<"Start address within the process address space of memory allocation for expression evaluation.">;
+  def ExprAllocSize: Property<"expr-alloc-size", "UInt64">,
+DefaultUnsignedValue<0>,
+Desc<"Amount of memory in bytes to allocate for expression evaluation.">;
+  def ExprAllocAlign: Property<"expr-alloc-align", "UInt64">,
+DefaultUnsignedValue<0>,
+Desc<"Alignment for each memory allocation for expression evaluation.">;
   def PreferDynamic: Property<"prefer-dynamic-value", "Enum">,
 DefaultEnumValue<"eDynamicDontRunTarget">,
 EnumValues<"OptionEnumValues(g_dynamic_value_types)">,
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -4586,6 +4586,24 @@
   g_target_properties[idx].default_uint_value);
 }
 
+uint64_t TargetProperties::GetExprAllocAddress() const {
+  const uint32_t idx = ePropertyExprAllocAddress;
+  return m_collection_sp->GetPropertyAtIndexAsUInt64(
+  nullptr, idx, g_target_properties[idx].default_uint_value);
+}
+
+uint64_t TargetProperties::GetExprAllocSize() const {
+  const uint32_t idx = ePropertyExprAllocSize;
+  return m_collection_sp->GetPropertyAtIndexAsUInt64(
+  nullptr, idx, g_target_properties[idx].default_uint_value);
+}
+
+uint64_t TargetProperties::GetExprAllocAlign() const {
+  const 

[Lldb-commits] [PATCH] D149262: [lldb] Add settings for expression evaluation memory allocations.

2023-04-28 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl added inline comments.



Comment at: lldb/source/Expression/IRMemoryMap.cpp:181
 size_t alloc_size = back->second.m_size;
 auto arch = target_sp->GetArchitecture().GetTriple().getArch();
+uint64_t align = target_sp->GetExprAllocAlign();

is arch unused now?


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

https://reviews.llvm.org/D149262

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


[Lldb-commits] [PATCH] D146965: [lldb] Add support for MSP430 in LLDB.

2023-04-17 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl added a comment.

@kuilpd

Please ensure that the patch is rebased into top of `main` and builds w/o 
errors / warnings.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146965

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


[Lldb-commits] [PATCH] D146965: [lldb] Add support for MSP430 in LLDB.

2023-04-17 Thread Anton Korobeynikov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG82c02b733c77: [lldb] Add support for MSP430 in LLDB. 
(authored by asl).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146965

Files:
  lldb/include/lldb/Utility/ArchSpec.h
  lldb/include/lldb/Utility/DataExtractor.h
  lldb/source/Expression/IRMemoryMap.cpp
  lldb/source/Expression/LLVMUserExpression.cpp
  lldb/source/Host/common/NativeProcessProtocol.cpp
  lldb/source/Plugins/ABI/CMakeLists.txt
  lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp
  lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.h
  lldb/source/Plugins/ABI/MSP430/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/Breakpad/BreakpadRecords.cpp
  lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterFallback.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Target/Platform.cpp
  lldb/source/Utility/ArchSpec.cpp
  lldb/test/API/functionalities/gdb_remote_client/TestMSP430MSPDebug.py
  lldb/test/API/functionalities/gdb_remote_client/msp430.yaml
  lldb/unittests/Utility/ArchSpecTest.cpp

Index: lldb/unittests/Utility/ArchSpecTest.cpp
===
--- lldb/unittests/Utility/ArchSpecTest.cpp
+++ lldb/unittests/Utility/ArchSpecTest.cpp
@@ -123,6 +123,12 @@
   EXPECT_STREQ("i686", AS.GetArchitectureName());
   EXPECT_EQ(ArchSpec::eCore_x86_32_i686, AS.GetCore());
 
+  AS = ArchSpec();
+  EXPECT_TRUE(AS.SetTriple("msp430---elf"));
+  EXPECT_EQ(llvm::Triple::msp430, AS.GetTriple().getArch());
+  EXPECT_STREQ("msp430", AS.GetArchitectureName());
+  EXPECT_EQ(ArchSpec::eCore_msp430, AS.GetCore());
+
   // Various flavors of invalid triples.
   AS = ArchSpec();
   EXPECT_FALSE(AS.SetTriple("unknown-unknown-unknown"));
Index: lldb/test/API/functionalities/gdb_remote_client/msp430.yaml
===
--- /dev/null
+++ lldb/test/API/functionalities/gdb_remote_client/msp430.yaml
@@ -0,0 +1,426 @@
+# File test.c, compiled with flags "-O0 -g"
+# Source code:
+#
+# int foo = 0;
+#
+# int func() {
+# foo = 1234;
+# return foo;
+# }
+#
+# int main() {
+# return func();
+# }
+#
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS32
+  Data:ELFDATA2LSB
+  OSABI:   ELFOSABI_STANDALONE
+  Type:ET_EXEC
+  Machine: EM_MSP430
+  Flags:   [  ]
+  Entry:   0x500
+ProgramHeaders:
+  - Type:PT_LOAD
+Flags:   [ PF_X, PF_R ]
+FirstSec:.text
+LastSec: .bss
+VAddr:   0x46C
+Align:   0x4
+  - Type:PT_LOAD
+Flags:   [ PF_W, PF_R ]
+FirstSec:.data
+LastSec: .bss
+VAddr:   0x53C
+Align:   0x4
+  - Type:PT_LOAD
+Flags:   [ PF_R ]
+FirstSec:__interrupt_vector_31
+LastSec: __interrupt_vector_31
+VAddr:   0xFFFE
+Align:   0x4
+Sections:
+  - Name:.text
+Type:SHT_PROGBITS
+Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
+Address: 0x500
+AddressAlign:0x4
+Content: 3140C0FF0C43B0121C05B0128101B240D2043C051C423C053041318002008143B01210053150020030411C4330413C402A0030410C433041
+  - Name:.data
+Type:SHT_PROGBITS
+Flags:   [ SHF_WRITE, SHF_ALLOC ]
+Address: 0x53C
+AddressAlign:0x1
+  - Name:.bss
+Type:SHT_NOBITS
+Flags:   [ SHF_WRITE, SHF_ALLOC ]
+Address: 0x53C
+AddressAlign:0x2
+Size:0x2
+  - Name:__interrupt_vector_31
+Type:SHT_PROGBITS
+Flags:   [ SHF_ALLOC ]
+Address: 0xFFFE
+AddressAlign:0x1
+Offset:  0xD2
+Content: '0005'
+  - Name:.rodata
+Type:SHT_PROGBITS
+Flags:   [ SHF_WRITE, SHF_ALLOC ]
+Address: 0x500
+AddressAlign:0x1
+  - Name:.rodata2
+Type:SHT_PROGBITS
+Flags:   [ SHF_WRITE ]
+Address: 0x500
+AddressAlign:0x1
+  - Name:.noinit
+Type:SHT_PROGBITS
+Flags:   [ SHF_WRITE ]
+Address: 0x53E
+AddressAlign:0x1
+  - Name:.persistent
+Type:SHT_PROGBITS
+Flags:   [ SHF_WRITE ]
+Address: 0x53E
+AddressAlign:0x1
+  - Name:.MSP430.attributes
+Type:SHT_MSP430_ATTRIBUTES
+AddressAlign:0x1
+Content: 4116006D737061626900010B00040106010801
+  - Name:.comment
+Type:SHT_PROGBITS
+Flags:   [ SHF_MERGE, SHF_STRINGS ]
+AddressAlign:0x1
+

[Lldb-commits] [PATCH] D146965: [lldb] Add support for MSP430 in LLDB.

2023-04-17 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl added a comment.

Thanks @bulbazord @DavidSpickett !


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

https://reviews.llvm.org/D146965

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


[Lldb-commits] [PATCH] D146965: [lldb] Add support for MSP430 in LLDB.

2023-03-27 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl added a comment.

@JDevlieghere @bulbazord I don't think I know lldb codebase well enough to 
cover the complete review here. But from MSP430-standpoint things seem to be 
correct. Will you be able to review or suggest some other reviewers?

Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146965

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


[Lldb-commits] [PATCH] D116351: Update Bug report URL to Github Issues

2022-01-04 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl requested changes to this revision.
asl added a comment.
This revision now requires changes to proceed.

Will you please check the comments and reword everything using proper 
terminology and new things we're having on GitHub?




Comment at: clang/www/c_status.html:76
+The https://bugs.llvm.org/;>LLVM bug tracker and 
+https://github.com/llvm/llvm-project/issues/;>LLVM Issues contain
+a Clang C component that tracks known bugs with Clang's language

asl wrote:
> The component got mapped to dedicated label in GitHub. So, it will be great 
> to get rid of bugzilla-centric definition and switch to GitHub terms
As I said – there is no "Clang C component" in github. We need to reword 
everything in terms of labels and mention correct label here.



Comment at: clang/www/cxx_status.html:81
+https://github.com/llvm/llvm-project/issues/;>LLVM Issues contain
+Clang C++ components that track known bugs with Clang's language conformance in
 each language mode.

asl wrote:
> Ditto. Also, there are separate labels for C++11 / 14 / 20 / 23. It might 
> make sense to mention them here
See above


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

https://reviews.llvm.org/D116351

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


[Lldb-commits] [PATCH] D116351: Update Bug report URL to Github Issues

2022-01-04 Thread Anton Korobeynikov via Phabricator via lldb-commits
asl requested changes to this revision.
asl added a subscriber: tstellar.
asl added a comment.
This revision now requires changes to proceed.

Thanks for doing this! I added few notes on the way.




Comment at: clang/www/c_status.html:76
+The https://bugs.llvm.org/;>LLVM bug tracker and 
+https://github.com/llvm/llvm-project/issues/;>LLVM Issues contain
+a Clang C component that tracks known bugs with Clang's language

The component got mapped to dedicated label in GitHub. So, it will be great to 
get rid of bugzilla-centric definition and switch to GitHub terms



Comment at: clang/www/cxx_status.html:81
+https://github.com/llvm/llvm-project/issues/;>LLVM Issues contain
+Clang C++ components that track known bugs with Clang's language conformance in
 each language mode.

Ditto. Also, there are separate labels for C++11 / 14 / 20 / 23. It might make 
sense to mention them here



Comment at: clang/www/get_involved.html:69
+href="https://bugs.llvm.org/;>Bugzilla bug database or https://github.com/llvm/llvm-project/issues/;>LLVM Issues.
 

I think it would make sense to get rid of bz here. For new contributors 
everything should be GitHub-centric



Comment at: libcxx/docs/index.rst:220
 * `libc++abi Homepage `_
 * `LLVM Bugzilla `_
+* `LLVM Issues `_

I'd remove bugzilla here



Comment at: libunwind/docs/index.rst:101
 * `LLVM Homepage `_
 * `LLVM Bugzilla `_
+* `LLVM Issues `_

And here



Comment at: llvm/docs/HowToReleaseLLVM.rst:280
 
+.. FIXME: Edit for LLVM Issues in Github.
 .. _bug: https://bugs.llvm.org/

This is for @tstellar :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116351

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