Commit Graph
100 Commits
Author SHA1 Message Date
bbodi ed6b1dd5cd Describe rawptr as a pointer to no type
`rawptr` pointed to a 1-byte `void` base type, so gdb printed every
rawptr, such as an allocator's `data`, as a C string. Describe it as a
pointer with no pointee type, which is how clang emits `void *`. This
also drops the address space it was given by mistake.
2026-10-08 15:32:26 +02:00
bbodi e3c69ec540 Fix the debug name and characters of cstring16
The name `cstring16` was passed with the length of `cstring`, so the
type was named `cstring`. Its characters, and those of `string16`,
were a 16-bit `wchar_t`, which gdb reads as UTF-32 on Linux and so
printed as garbage. On DWARF describe them as `char16_t`, a 16-bit UTF
character, which gdb reads as UTF-16. CodeView keeps `wchar_t`.
2026-10-08 15:31:11 +02:00
bbodi 243fb9184f Define enum, typeid and #soa debug types locally
With the split debug types modules, every other module only declares a
record type. gdb resolves a declared struct by searching for its
definition, but a declared enum by taking the first symbol of that name,
which is the declaration itself in the module being looked at. Enums,
flag enum bit_sets and typeid showed as <incomplete type>, and every
`any` printed as nil since its `id` could not be read. gdb also cannot
find a declared type whose name starts with `#`, so #soa types were
incomplete too.

On DWARF, define these in every module that uses them, as clang does
with enums. CodeView resolves forward references by name, so Windows
keeps them in the types modules.
2026-10-08 15:29:58 +02:00
gingerBill 6bc36986d2 Keep the names of big endian types in CodeView and add RAD views to swap their bytes 2026-10-08 13:41:52 +01:00
gingerBill 4d8e8aaf4a Mark optimized procedures, add assignment tracking, and add MD5 file checksums on LLVM 22+ 2026-10-08 12:28:21 +01:00
gingerBill 81842d44dc Improve RAD Debugger view information for unions, string16, and anything else need to be generated 2026-10-08 11:09:33 +01:00
gingerBill 29f4b033df Describe bit_sets as flag enums on DWARF and typeid as an enum of the type table defined once alongside any, declare the element of #soa range loops 2026-10-08 10:42:43 +01:00
gingerBill 399b6d4a36 Name procedures and globals in debug info by package and enclosing procedure, with literals named by line, one shared name for all polymorphic instances, and exported and custom link names kept 2026-10-08 10:10:15 +01:00
gingerBill 216bcf7475 Split the debug types module into eight picked by a hash of each type's name, defined in parallel rounds and anchored by a union of pointers to its types 2026-10-08 09:48:40 +01:00
gingerBill 0a4724602b Define record debug types once in a debug types module with forward declarations in every other module 2026-10-08 09:18:15 +01:00
gingerBill 8c692ad0e9 Give debug types unique identifiers, describe self-referencing procedure types per debug format, declare range loop variables once, and use DWARF 5 on Darwin and Linux 2026-10-08 08:56:39 +01:00
gingerBill 6cfa3dafb7 Finalize debug info per module in parallel, and skip debug info work that was never used 2026-10-08 01:05:24 +01:00
gingerBill 35fdd3c499 Fix infinite recursion lowering procedure types that contain themselves 2026-10-08 00:26:40 +01:00
Matthias Huerbe 9a4522d2dd Make @(static) locals visible in the PDB 2026-10-07 08:16:27 +00:00
gingerBill e5cc35c445 Lower what LLVM's fast instruction selector cannot select before emitting objects, and declare debug variables through stack slots 2026-10-03 11:02:55 +01:00
gingerBill 29106aaa1e Cache type layouts and union constantability, build nested constants once, create debug files lazily 2026-10-03 01:26:01 +01:00
gingerBill 5f579a1a10 Fix numerous race conditions: clone polymorphic defaults per call, evaluate foreign import attributes after collection, own dependencies for record instances, sorted Objective-C emission, no debug line for anonymous records 2026-10-01 21:55:25 +01:00
gingerBill bc636e4b36 raddbg debug view for fixed capacity dynamic arrays 2026-03-12 12:56:00 +00:00
gingerBill f1dbe9c242 [dynamic; N]T proof of concept: fixed capacity dynamic array (akin to small_array.Small_Array(N, T)) 2026-03-11 16:46:33 +00:00
gingerBill 3dccd4e3ad Fix debug info 2026-02-02 11:15:34 +00:00
Laytan c4d1cd6ee5 fixes for 32bit with regards to typeid 2025-11-04 21:37:29 +01:00
gingerBill 738a72943b Try moving parapoly procs into a separate module when doing weak monomorphization 2025-09-18 15:04:16 +01:00
gingerBill ae02d3d02d Begin supporting string16 across the core library 2025-08-02 11:55:16 +01:00
gingerBill c383e550f9 Merge branch 'master' into bill/raddebugger-custom-section 2025-05-22 16:04:42 +01:00
tf2spi 2f636886a5 Add debug info for labels (#4385)
* Emit label debug info w/o location

* Insert debug label call

* Slight refactor for later fix

* Improve debug labels for block statements

* Improve debug info with for loops

* Generate label lbBlocks w/ debug

* Lightly refactor lb_add_debug_label

* Revise comments, add null check assertion

* Use LLVM-C API for debug labels

* Prefer C DILabel API for POSIX, fallback to CPP

* Use version check for LLVM-C DILabel
2025-05-15 22:11:06 +02:00
gingerBill ea65a7b870 Move raddbg string stuff to a thread-safe queue 2025-05-07 14:26:10 +01:00
gingerBill 833d77da1f Add column major matrix support 2025-05-07 13:20:14 +01:00
gingerBill e0125ccec2 Begin work on adding support for the .raddbg section for the RAD Debugger 2025-05-07 11:30:15 +01:00
gingerBill ce5b7cccab Fix lb_add_debug_local_variable to use the correct procedure in LLVM 20 2025-04-03 10:04:14 +01:00
gingerBill d209af5094 Update to LLVM 20.1.0 2025-03-18 15:39:18 +00:00
gingerBill 90a973ccf6 Make debug symbols use the new name canonicalization rules 2025-02-20 10:27:59 +00:00
Laytan Laats 2620721128 '#no_nil' I am actually disappointed in myself 2025-01-08 21:45:59 +01:00
Laytan Laats b3c359557e #no_nil third time's the charm 2025-01-08 21:24:22 +01:00
Laytan Laats 7185a93a86 actually fix #no_nil debug info
Fixes #4664
2025-01-08 20:24:31 +01:00
Laytan Laats 2aae4cfd46 fix #no_nil in debug info
Fixes #4664
2025-01-08 18:47:32 +01:00
gingerBill e38a08013e Remove #relative types from the compiler 2024-11-14 16:17:24 +00:00
Laytan Laats d03d9e49a6 fix #4243 2024-09-15 00:03:20 +02:00
Laytan Laats 4f3f256375 improve bit field debug info 2024-09-14 15:52:37 +02:00
gingerBill 5a4746c3a0 Improve debug information for procedure types 2024-09-07 17:41:16 +01:00
gingerBill 8b248673c1 Fix #4105 2024-08-24 13:36:43 +01:00
gingerBill 549311fac9 Fix global variables being "missing" with -use-separate-modules 2024-07-15 12:21:42 +01:00
gingerBill eef2aef021 Fix #3724 2024-06-10 15:07:45 +01:00
Laytan Laats 7d29389834 fix debug info IR error on LLVM < 13 2024-06-04 14:41:42 +02:00
Laytan Laats 90369b669b fix direct proc args debug info 2024-04-22 19:36:24 +02:00
gingerBill f84a092977 Fix typo. 2024-04-18 11:28:46 +01:00
gingerBill aad41fc762 Fix #3445 2024-04-18 11:27:42 +01:00
Laytan Laats 4fc96e1ca5 change unneeded permanent allocation to temporary 2024-04-01 19:06:05 +02:00
Laytan Laats cfc85fd737 fix wrong type in map debug info 2024-04-01 18:42:10 +02:00
Laytan Laats 7c2352ea08 remove soa handling in debug info, fields are already added in checker 2024-04-01 16:51:16 +02:00
Laytan Laats 9647cb74ad debug info fixes/refactor
This fixes (on my end) #3340, #3117, #2945, #2922, and #2762

A general refactor of debug info generation in order to fix issues and
increase stability.

What I believe is the root cause of a bunch of issues is that we use the
temporary metadata/forward declarations too much (/ hold onto them for
too long). It seems to cause problems with the reference counting inside
LLVM.

This PR reduces the use of these forward declarations to a minimum, it
creates it, fills in the fields, and resolves it, instead of waiting
until the end of generating code.

Some smaller issues I came across have also been solved.
2024-04-01 16:28:44 +02:00