-
- Notifications
You must be signed in to change notification settings - Fork 272
add autocompletion for ldc2 with bash-completion #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+36 −0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Member
| Haven't tested it yet, but seems very useful – thanks! |
dnadlinger added a commit that referenced this pull request Aug 9, 2011
add autocompletion for ldc2 with bash-completion
timotheecour pushed a commit to timotheecour/ldc that referenced this pull request Dec 13, 2017
Handle TypeOfExprType.
dkgroot added a commit to dkgroot-ldc/ldc that referenced this pull request Dec 28, 2017
kinke added a commit to kinke/ldc that referenced this pull request Aug 8, 2018
kinke pushed a commit that referenced this pull request Feb 28, 2024
…inux. (dlang/dmd!16233) You can see the correct declaration for ifaddrs on Linux here: https://www.man7.org/linux/man-pages/man3/getifaddrs.3.html What the fields are supposed to be named is ifa_broadaddr and ifa_dstaddr. However, because Linux defines them using a union, it gives them different names within the union - ifu_broadaddr and ifu_dstaddr - and then #defines the proper names to access the union names. What druntime did was use the union names - and then incorrectly name ifu_dtsaddr as if_dstaddr. So, it was doubly wrong for that field. The two approaches that we could take here would be to either 1. Turn the union into a type so that we could have an ifa_ifu field to allow accessing the ifu_* names that way - as is technically possible in C - and then add wrapper functions with the ifa_* names (since we couldn't use an alias to access members of the union member variable). 2. Just rename the fields to ifa_* and ignore the fact that you can technically access the ifu_* fields via the union name in C. The simpler approach is #2, so that's what this commit does. I'm pretty sure that the ability to access the ifu_* fields via the union name is just an implementation detail - particularly since other platforms just declare the ifa_* names without using a union at all. Either way, deprecated aliases are provided so that existing code doesn't break.
the-horo added a commit to the-horo/ldc that referenced this pull request Aug 21, 2025
These tests seem to fail with a shared druntime, and work with a static one. CI fails with a static druntime though. A gdb backtrace with a shared druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /root/build/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000005555550afc in D main () (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 (gdb) bt \#0 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#1 0x0000007ff77563b8 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#2 0x0000007ff7757000 in _Unwind_Backtrace () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#3 0x0000007ff78b2c6c in backtrace () from /usr/lib64/libc.so.6 \ldc-developers#4 0x0000007ff7aee058 in core.lifetime.emplace!(core.runtime.DefaultTraceInfo).emplace(core.runtime.DefaultTraceInfo) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#5 0x0000007ff7aed1f0 in core.runtime.defaultTraceHandler(void*) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#6 0x0000007ff7b09614 in _d_createTrace () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#7 0x0000007ff7b0a7a0 in _d_throw_exception () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#8 0x0000007ff7acb418 in _d_assert_msg () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#9 0x0000005555550d18 in etc.linux.memoryerror.registerMemoryAssertHandler!().registerMemoryAssertHandler()._d_handleSignalAssert(int, core.sys.posix.signal.siginfo_t*, void*) () \ldc-developers#10 <signal handler called> \ldc-developers#11 0x0000005555550afc in D main () ``` And with a static druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /tmp/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000555556a4bc in D main () (gdb) c Continuing. core.exception.AssertError@/usr/lib/ldc2/1.41/include/d/etc/linux/memoryerror.d(415): segmentation fault: null pointer read/write operation ---------------- ??:? [0x555557fa2f] ??:? [0x555557f1ab] ??:? [0x5555581d17] ??:? [0x5555570893] ??:? [0x555556b2ab] ??:? [0x555556a6d7] ??:? [0x7ff7ffb797] ??:? [0x555556a4bb] ??:? [0x5555570567] ??:? [0x5555570413] ??:? [0x5555570277] ??:? [0x555556a5a3] ??:? [0x7ff7d02053] ??:? __libc_start_main [0x7ff7d02137] ??:? [0x555556a3af] Program received signal SIGSEGV, Segmentation fault. 0x0000007ffffffdd0 in ?? () ``` Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
the-horo added a commit to the-horo/ldc that referenced this pull request Aug 22, 2025
These tests seem to fail with a shared druntime (depending on arch as well), and work with a static one. CI fails with a static druntime though. A gdb backtrace with a shared druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /root/build/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000005555550afc in D main () (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 (gdb) bt \#0 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#1 0x0000007ff77563b8 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#2 0x0000007ff7757000 in _Unwind_Backtrace () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#3 0x0000007ff78b2c6c in backtrace () from /usr/lib64/libc.so.6 \ldc-developers#4 0x0000007ff7aee058 in core.lifetime.emplace!(core.runtime.DefaultTraceInfo).emplace(core.runtime.DefaultTraceInfo) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#5 0x0000007ff7aed1f0 in core.runtime.defaultTraceHandler(void*) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#6 0x0000007ff7b09614 in _d_createTrace () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#7 0x0000007ff7b0a7a0 in _d_throw_exception () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#8 0x0000007ff7acb418 in _d_assert_msg () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#9 0x0000005555550d18 in etc.linux.memoryerror.registerMemoryAssertHandler!().registerMemoryAssertHandler()._d_handleSignalAssert(int, core.sys.posix.signal.siginfo_t*, void*) () \ldc-developers#10 <signal handler called> \ldc-developers#11 0x0000005555550afc in D main () ``` And with a static druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /tmp/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000555556a4bc in D main () (gdb) c Continuing. core.exception.AssertError@/usr/lib/ldc2/1.41/include/d/etc/linux/memoryerror.d(415): segmentation fault: null pointer read/write operation ---------------- ??:? [0x555557fa2f] ??:? [0x555557f1ab] ??:? [0x5555581d17] ??:? [0x5555570893] ??:? [0x555556b2ab] ??:? [0x555556a6d7] ??:? [0x7ff7ffb797] ??:? [0x555556a4bb] ??:? [0x5555570567] ??:? [0x5555570413] ??:? [0x5555570277] ??:? [0x555556a5a3] ??:? [0x7ff7d02053] ??:? __libc_start_main [0x7ff7d02137] ??:? [0x555556a3af] Program received signal SIGSEGV, Segmentation fault. 0x0000007ffffffdd0 in ?? () ``` Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
the-horo added a commit to the-horo/ldc that referenced this pull request Aug 22, 2025
These tests seem to fail with a shared druntime (depending on arch as well), and work with a static one. CI fails with a static druntime though. A gdb backtrace with a shared druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /root/build/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000005555550afc in D main () (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 (gdb) bt \#0 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#1 0x0000007ff77563b8 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#2 0x0000007ff7757000 in _Unwind_Backtrace () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#3 0x0000007ff78b2c6c in backtrace () from /usr/lib64/libc.so.6 \ldc-developers#4 0x0000007ff7aee058 in core.lifetime.emplace!(core.runtime.DefaultTraceInfo).emplace(core.runtime.DefaultTraceInfo) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#5 0x0000007ff7aed1f0 in core.runtime.defaultTraceHandler(void*) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#6 0x0000007ff7b09614 in _d_createTrace () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#7 0x0000007ff7b0a7a0 in _d_throw_exception () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#8 0x0000007ff7acb418 in _d_assert_msg () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#9 0x0000005555550d18 in etc.linux.memoryerror.registerMemoryAssertHandler!().registerMemoryAssertHandler()._d_handleSignalAssert(int, core.sys.posix.signal.siginfo_t*, void*) () \ldc-developers#10 <signal handler called> \ldc-developers#11 0x0000005555550afc in D main () ``` And with a static druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /tmp/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000555556a4bc in D main () (gdb) c Continuing. core.exception.AssertError@/usr/lib/ldc2/1.41/include/d/etc/linux/memoryerror.d(415): segmentation fault: null pointer read/write operation ---------------- ??:? [0x555557fa2f] ??:? [0x555557f1ab] ??:? [0x5555581d17] ??:? [0x5555570893] ??:? [0x555556b2ab] ??:? [0x555556a6d7] ??:? [0x7ff7ffb797] ??:? [0x555556a4bb] ??:? [0x5555570567] ??:? [0x5555570413] ??:? [0x5555570277] ??:? [0x555556a5a3] ??:? [0x7ff7d02053] ??:? __libc_start_main [0x7ff7d02137] ??:? [0x555556a3af] Program received signal SIGSEGV, Segmentation fault. 0x0000007ffffffdd0 in ?? () ``` Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
the-horo added a commit to the-horo/ldc that referenced this pull request Aug 24, 2025
These tests seem to fail with a shared druntime (depending on arch as well), and work with a static one. CI fails with a static druntime though. A gdb backtrace with a shared druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /root/build/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000005555550afc in D main () (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 (gdb) bt \#0 0x0000007ff77432f0 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#1 0x0000007ff77563b8 in ?? () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#2 0x0000007ff7757000 in _Unwind_Backtrace () from /usr/lib/gcc/aarch64-unknown-linux-gnu/15/libgcc_s.so.1 \ldc-developers#3 0x0000007ff78b2c6c in backtrace () from /usr/lib64/libc.so.6 \ldc-developers#4 0x0000007ff7aee058 in core.lifetime.emplace!(core.runtime.DefaultTraceInfo).emplace(core.runtime.DefaultTraceInfo) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#5 0x0000007ff7aed1f0 in core.runtime.defaultTraceHandler(void*) () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#6 0x0000007ff7b09614 in _d_createTrace () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#7 0x0000007ff7b0a7a0 in _d_throw_exception () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#8 0x0000007ff7acb418 in _d_assert_msg () from /usr/lib/ldc2/1.41/lib64/libdruntime-ldc-shared.so.111 \ldc-developers#9 0x0000005555550d18 in etc.linux.memoryerror.registerMemoryAssertHandler!().registerMemoryAssertHandler()._d_handleSignalAssert(int, core.sys.posix.signal.siginfo_t*, void*) () \ldc-developers#10 <signal handler called> \ldc-developers#11 0x0000005555550afc in D main () ``` And with a static druntime: ``` Reading symbols from ./a... (No debugging symbols found in ./a) (gdb) r Starting program: /tmp/a [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000555556a4bc in D main () (gdb) c Continuing. core.exception.AssertError@/usr/lib/ldc2/1.41/include/d/etc/linux/memoryerror.d(415): segmentation fault: null pointer read/write operation ---------------- ??:? [0x555557fa2f] ??:? [0x555557f1ab] ??:? [0x5555581d17] ??:? [0x5555570893] ??:? [0x555556b2ab] ??:? [0x555556a6d7] ??:? [0x7ff7ffb797] ??:? [0x555556a4bb] ??:? [0x5555570567] ??:? [0x5555570413] ??:? [0x5555570277] ??:? [0x555556a5a3] ??:? [0x7ff7d02053] ??:? __libc_start_main [0x7ff7d02137] ??:? [0x555556a3af] Program received signal SIGSEGV, Segmentation fault. 0x0000007ffffffdd0 in ?? () ``` Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
kinke pushed a commit that referenced this pull request Sep 27, 2025
Limit the number of platforms that this is done on. A inspection of some libc implementations of fork has identified the main culprits, don't need to apply this to any others. MacOS testsuite also regressed as a result on calling this code, it's not clear why, but the backtrace is: ``` * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) * frame #0: 0x00007ff81abe6ee3 libsystem_platform.dylib`_os_unfair_lock_recursive_abort + 23 frame #1: 0x00007ff81abe12da libsystem_platform.dylib`_os_unfair_lock_lock_slow + 247 frame #2: 0x00007ff81abccd44 libsystem_pthread.dylib`_pthread_atfork_prepare_handlers + 48 frame #3: 0x00007ff825dc2705 libSystem.B.dylib`libSystem_atfork_prepare + 25 frame #4: 0x00007ff81aac17e1 libsystem_c.dylib`fork + 24 frame #5: 0x0000000101f730ee test_runner`core.internal.backtrace.dwarf.resolveAddressesWithAtos(Location[]) + 210 ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
bash_completion.d/ldc allow to user complete his statement by pressing tab