Skip to content

Commit 0d4ac73

Browse files
committed
Merge branch 'release-260130' into HEAD
1 parent 9abfbad commit 0d4ac73

200 files changed

Lines changed: 10747 additions & 14685 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clangd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
If:
2+
PathMatch: [.*deps/.*, .*out/.*, .*build/.*]
3+
4+
Index:
5+
Background: Skip

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ xs/assertlib*
1616
.vs/*
1717
local-lib
1818
/src/TAGS
19-
/.vscode/
2019
build-linux/*
2120
deps/build*/*
2221
**/.DS_Store
@@ -62,3 +61,4 @@ __pycache__
6261
/docs/printer_parameters_validation.md
6362
/docs/printer_settings_ui_parameters.md
6463
docs
64+
flatbuild

.vscode/launch.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "C3DSlicer: Launch",
6+
"type": "lldb",
7+
"request": "launch",
8+
"program": "${command:cmake.launchTargetPath}",
9+
"args": [],
10+
"cwd": "${workspaceFolder}",
11+
"linux": {
12+
"type": "lldb",
13+
"env": {
14+
"SLIC3R_RESOURCES_DIR": "${workspaceFolder}/resources",
15+
"GDK_SCALE": "1.25",
16+
"GDK_DPI_SCALE": "1.25",
17+
"SLIC3R_DPI_SCALE": "1.25"
18+
},
19+
"initCommands": [
20+
"breakpoint name configure --disable cpp_exception",
21+
"process handle -p true -s false -n false SIGUSR1",
22+
"settings set target.max-string-summary-length 10000",
23+
"command script import ${workspaceFolder}/.vscode/lldb_formatters.py"
24+
]
25+
},
26+
"windows": {
27+
"type": "cppvsdbg",
28+
"env": {
29+
"SLIC3R_RESOURCES_DIR": "${workspaceFolder}/resources"
30+
}
31+
},
32+
"osx": {
33+
"type": "lldb",
34+
"env": {
35+
"SLIC3R_RESOURCES_DIR": "${workspaceFolder}/resources"
36+
},
37+
"initCommands": [
38+
"settings set target.max-string-summary-length 10000",
39+
"command script import ${workspaceFolder}/.vscode/lldb_formatters.py"
40+
]
41+
}
42+
}
43+
]
44+
}

.vscode/lldb_formatters.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import lldb
2+
3+
def StringSummaryProvider(valobj, internal_dict):
4+
# Try to access _M_dataplus._M_p
5+
# If fails, try to look at memory manually
6+
7+
# This is a heuristic for GCC's std::string
8+
# It has _M_dataplus, _M_string_length, etc.
9+
10+
try:
11+
# If we have debug info, this works
12+
dataplus = valobj.GetChildMemberWithName('_M_dataplus')
13+
if dataplus.IsValid():
14+
mp = dataplus.GetChildMemberWithName('_M_p')
15+
if mp.IsValid():
16+
data = mp.GetSummary()
17+
if data: return data
18+
# If summary is missing, read memory
19+
addr = mp.GetValueAsUnsigned(0)
20+
if addr == 0: return '""'
21+
22+
# Read string from memory
23+
error = lldb.SBError()
24+
s = valobj.GetProcess().ReadCStringFromMemory(addr, 1024, error)
25+
if error.Success():
26+
return f'"{s}"'
27+
except:
28+
pass
29+
30+
# Fallback for missing debug info (incomplete type)
31+
# Assuming standard layout: pointer at offset 0
32+
try:
33+
addr = valobj.GetAddress().GetLoadAddress(valobj.GetTarget())
34+
if addr == lldb.LLDB_INVALID_ADDRESS:
35+
addr = valobj.GetValueAsUnsigned(0)
36+
37+
# We need to read the pointer at this address.
38+
# But wait, std::string is a struct.
39+
# _M_dataplus is the first member.
40+
# _M_dataplus has _M_p as first member (usually).
41+
42+
# So dereferencing the address of the string object gives the address of the char buffer.
43+
error = lldb.SBError()
44+
pointer_val = valobj.GetProcess().ReadPointerFromMemory(addr, error)
45+
if error.Success() and pointer_val != 0:
46+
s = valobj.GetProcess().ReadCStringFromMemory(pointer_val, 1024, error)
47+
if error.Success():
48+
return f'"{s}"'
49+
except:
50+
pass
51+
52+
return ""
53+
54+
def WxStringSummaryProvider(valobj, internal_dict):
55+
# wxString is usually a wrapper around std::basic_string or compatible
56+
# In wx 3.x with std::string enabled, it might inherit from it or have it as member
57+
58+
# Try 1: check if it has m_impl
59+
try:
60+
impl = valobj.GetChildMemberWithName('m_impl')
61+
if impl.IsValid():
62+
return StringSummaryProvider(impl, internal_dict)
63+
except:
64+
pass
65+
66+
# Try 2: treat as std::string directly (inheritance)
67+
res = StringSummaryProvider(valobj, internal_dict)
68+
if res and res != "":
69+
return res
70+
71+
return ""
72+
73+
def WxEventSummaryProvider(valobj, internal_dict):
74+
# For incomplete wxEvent, we try to resolve the vtable to get dynamic type
75+
76+
try:
77+
addr = valobj.GetAddress().GetLoadAddress(valobj.GetTarget())
78+
if addr == lldb.LLDB_INVALID_ADDRESS:
79+
# Maybe it's a pointer or reference, get its value
80+
addr = valobj.GetValueAsUnsigned(0)
81+
82+
if addr == 0:
83+
return "NULL"
84+
85+
# Read vtable pointer (first word)
86+
error = lldb.SBError()
87+
vptr = valobj.GetProcess().ReadPointerFromMemory(addr, error)
88+
89+
if error.Success() and vptr != 0:
90+
# Resolve symbol for vptr
91+
addr_obj = valobj.GetTarget().ResolveLoadAddress(vptr)
92+
sym = addr_obj.GetSymbol()
93+
if sym.IsValid():
94+
name = sym.GetName()
95+
# Name is like "vtable for wxCommandEvent"
96+
# Demangle usually happens automatically in LLDB API or we can just parse
97+
if "vtable for " in name:
98+
return name.replace("vtable for ", "") + f" @ {hex(addr)}"
99+
return name + f" @ {hex(addr)}"
100+
except:
101+
pass
102+
103+
return f"wxEvent @ {hex(valobj.GetValueAsUnsigned(0))}"
104+
105+
def __lldb_init_module(debugger, internal_dict):
106+
debugger.HandleCommand('type summary add -F lldb_formatters.StringSummaryProvider "std::string"')
107+
debugger.HandleCommand('type summary add -F lldb_formatters.StringSummaryProvider "std::__cxx11::string"')
108+
debugger.HandleCommand('type summary add -F lldb_formatters.StringSummaryProvider "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >"')
109+
110+
debugger.HandleCommand('type summary add -F lldb_formatters.WxStringSummaryProvider "wxString"')
111+
debugger.HandleCommand('type summary add -F lldb_formatters.WxEventSummaryProvider "wxEvent" -C yes')
112+
debugger.HandleCommand('type summary add -F lldb_formatters.WxEventSummaryProvider "wxCommandEvent" -C yes')
113+
debugger.HandleCommand('type summary add -F lldb_formatters.WxEventSummaryProvider "wxNotifyEvent" -C yes')
114+
debugger.HandleCommand('type summary add -F lldb_formatters.WxEventSummaryProvider "wxMouseEvent" -C yes')
115+
debugger.HandleCommand('type summary add -F lldb_formatters.WxEventSummaryProvider "wxKeyEvent" -C yes')

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"cmake.ctest.allowParallelJobs": true,
3+
"cmake.generator": "Ninja",
4+
"cmakeFormat.cwd": "",
5+
"cmake.options.statusBarVisibility": "visible",
6+
"C_Cpp.intelliSenseEngine": "disabled",
7+
"clangd.path": "/usr/bin/clangd-18",
8+
"clangd.arguments": [
9+
"--compile-commands-dir=${workspaceFolder}/out/linux-release/build",
10+
"--background-index",
11+
"--completion-style=detailed",
12+
"--header-insertion=iwyu",
13+
"-j=2"
14+
]
15+
}

CMakePresets.json

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
},
4444
{
45-
"name": "weiyusuo-release",
45+
"name": "weiyusuo-relwithdeb",
4646
"displayName": "weiyusuo-release",
4747
"description": "Sets release build type",
4848
"inherits": "x64-release",
@@ -56,6 +56,21 @@
5656
"CMAKE_CXX_COMPILER_LAUNCHER":"ccache"
5757
}
5858
},
59+
{
60+
"name": "weiyusuo-release",
61+
"displayName": "weiyusuo-release",
62+
"description": "Sets release build type",
63+
"inherits": "x64-release",
64+
"cacheVariables": {
65+
"CMAKE_BUILD_TYPE": "Release",
66+
"CMAKE_PREFIX_PATH": "${sourceDir}/deps/build/OrcaSlicer_dep/usr/local/",
67+
"CX_DEBUG": "1",
68+
"CMAKE_EXPORT_COMPILE_COMMANDS":"1",
69+
"BOOST_HAS_THREADS": "1",
70+
"CMAKE_C_COMPILER_LAUNCHER":"ccache",
71+
"CMAKE_CXX_COMPILER_LAUNCHER":"ccache"
72+
}
73+
},
5974
{
6075
"name": "x86-debug",
6176
"displayName": "x86 Debug ",
@@ -111,11 +126,13 @@
111126
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
112127
"CMAKE_PREFIX_PATH": "${sourceDir}/deps/build/destdir/usr/local/",
113128
"CMAKE_EXPORT_COMPILE_COMMANDS":"1",
114-
"CMAKE_CXX_COMPILER": "/usr/bin/clang++",
115-
"CMAKE_C_COMPILER": "/usr/bin/clang",
129+
"CMAKE_CXX_COMPILER": "clang++",
130+
"CMAKE_C_COMPILER": "clang",
116131
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
117132
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
118-
"SLIC3R_STATIC":"1"
133+
"SLIC3R_STATIC":"1",
134+
"SLIC3R_GTK":"3",
135+
"CMAKE_CXX_FLAGS": "-fno-omit-frame-pointer"
119136
}
120137
},
121138
{

0 commit comments

Comments
 (0)