Skip to content

Commit

Permalink
Merge pull request #841 from puremourning/update-codelldb
Browse files Browse the repository at this point in the history
Update codelldb to v1.10.0
  • Loading branch information
mergify[bot] authored Feb 17, 2024
2 parents da7fc24 + 1f4e2b5 commit def0926
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 11 deletions.
14 changes: 7 additions & 7 deletions python3/vimspector/gadgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,12 @@
'${version}/${file_name}',
},
'all': {
'version': 'v1.9.2',
'version': 'v1.10.0',
},
'macos': {
'file_name': 'codelldb-x86_64-darwin.vsix',
'checksum':
'0b36e91930bca3344cf9b78984ee85ccacc6dc97ab9be5da935d4596f0dba05c',
'91b10d5670a40434c308c09cb511a5b3e096c82b446a0bbbe4224af33204f5cf',
'make_executable': [
'adapter/codelldb',
'lldb/bin/debugserver',
Expand All @@ -562,12 +562,12 @@
'macos_arm64': {
'file_name': 'codelldb-aarch64-darwin.vsix',
'checksum':
'5db25c0b1277795e2196a9118a38e6984b4787ac2c1e3e3adfeefe537296fc51',
'4ab0795a726bc52d6e2fa8ebc610baa3f262ebea89adac478cf4a34c72167a41',
},
'linux': {
'file_name': 'codelldb-x86_64-linux.vsix',
'checksum':
'898bd22b2505b12671fee7d2fe1abb384dc60d13f5fec2b4b650d0dac3f83d75',
'd12bff19811974e14688e9754d8d7b9a2430868c3bac883d695032a4acd012ca',
'make_executable': [
'adapter/codelldb',
'lldb/bin/lldb',
Expand All @@ -578,17 +578,17 @@
'linux_arm64': {
'file_name': 'codelldb-aarch64-linux.vsix',
'checksum':
'90c23169d5c32b6c3c6c040622f5f181af3e8a0a7d47e01219ce0af4a70aadb4',
'0a81f6617834754537520b7bae2ea9ad50d26b372f8c8bd967dae099e4b27d06',
},
'linux_armv7': {
'file_name': 'codelldb-arm-linux.vsix',
'checksum':
'971a9def71f8093ee63c1944dd69e3fbada97fc2804d312ab22e75f6d7e4e207',
'4bfc5ee753d4359c9ba3cf8fc726f4245a62fd283b718b5120ef1b404baf68c9',
},
'windows': {
'file_name': 'codelldb-x86_64-windows.vsix',
'checksum':
'1c23239941165d051b904a95c0bbf0853d3ff9b9149cdf36c6763fd4937c95f1',
'2f251384e4356edcffe168439714d00de5ca434b263719cbdaf63c9d2f0ffe64',
'make_executable': []
},
'adapters': {
Expand Down
2 changes: 1 addition & 1 deletion python3/vimspector/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def GetMemoryReference( self ):
# Get a memoryReference for use in a ReadMemory request
variable, _ = self._GetVariable( None, None )
if variable is None:
return None
return None, None

# TODO: Return the connection too!
return variable.connection, variable.MemoryReference()
Expand Down
17 changes: 16 additions & 1 deletion support/test/rust/vimspector_test/.vimspector.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
{
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
"adapters": {
"CodeLLDB-localbuild": {
"extends": "CodeLLDB",
"command": [
"$HOME/Development/vimspector/CodeLLDB/build/adapter/codelldb",
"--port",
"${unusedLocalPort}"
]
}
},
"configurations": {
"Run - CodeLLDB": {
"adapter": "CodeLLDB",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/target/debug/vimspector_test"
"program": "${workspaceRoot}/target/debug/vimspector_test",
"expressions": "native"
}
},
"CodeLLDB-localbuild": {
"extends": "Run - CodeLLDB",
"adapter": "CodeLLDB-localbuild"
}
}
}
8 changes: 7 additions & 1 deletion support/test/rust/vimspector_test/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
struct Foo {
x: i32,
}

fn main() {
let s = "World!";
println!("Hello, {}!", s);
let f = Foo { x: 42 };
let g = &f;
println!("Hello, {} {} {}!", s, g.x, f.x);
}
12 changes: 12 additions & 0 deletions tests/testdata/cpp/simple/.vimspector.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
"cpp_catch": ""
}
}
},
"CodeLLDB-localbuild": {
"extends": "CodeLLDB",
"adapter": "CodeLLDB-localbuild"
}
},
"adapters": {
Expand All @@ -124,6 +128,14 @@
"LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY": "YES"
},
"name": "lldb"
},
"CodeLLDB-localbuild": {
"extends": "CodeLLDB",
"command": [
"$HOME/Development/vimspector/CodeLLDB/build/adapter/codelldb",
"--port",
"${unusedLocalPort}"
]
}
}
}
2 changes: 1 addition & 1 deletion tests/testdata/cpp/simple/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TARGETS=simple variables struct printer threads tiny
TARGETS=simple variables struct printer threads tiny buffer

CXXFLAGS=-g -O0 -std=c++17
CFLAGS=-g -O0
Expand Down
40 changes: 40 additions & 0 deletions tests/testdata/cpp/simple/buffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iostream>

#include <sys/mman.h>

struct Foo
{
uint32_t a;
uint64_t b;
float d;
};

static void handle_data(const unsigned char* data, size_t length)
{
if (length < sizeof(Foo))
return;

Foo f;
memcpy(&f, data, sizeof(Foo));

std::cout << "a: " << f.a << ", b: " << f.b << ", d: " << f.d << std::endl;
}

int main(int , char**)
{
unsigned char data[1024];
Foo f{ 10, 20, 30.7f };

memcpy(data + 3, &f, sizeof(Foo));

void *ptr = mmap(nullptr, 2048, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
memcpy(ptr, data+3, sizeof(Foo));

handle_data((unsigned char*)ptr, sizeof(f));
munmap(ptr, 2048);

return 0;
}

0 comments on commit def0926

Please sign in to comment.