25016 Commits

Author SHA1 Message Date
kcbanner
dd2035735f debug: fix memory leak when an error occurs opening a pdb file 2023-07-20 22:58:13 -04:00
kcbanner
865d4d2d8c debug: more fixups for mips linux not having ucontext_t
- increase test-std max_rss to 1.1 above the CI observed amount
2023-07-20 22:58:13 -04:00
kcbanner
5ebca4392e debug: fixing more compile errors on arches that I hadn't tested on yet 2023-07-20 22:58:13 -04:00
kcbanner
551f153718 dwarf: fixes for non-64 bit systems 2023-07-20 22:58:13 -04:00
kcbanner
2f75d20d87 debug: use an explicit context type instead of anytype for dumpStackTraceFromBase, update crash_report to use this for exceptions 2023-07-20 22:58:13 -04:00
kcbanner
d74c8acdfb dwarf: fixup for sort changes 2023-07-20 22:58:13 -04:00
kcbanner
d1a9bb1fea debug: fixup context detection for wasi 2023-07-20 22:58:13 -04:00
kcbanner
a325d7f6d1 fmt and cleanup 2023-07-20 22:58:13 -04:00
kcbanner
c98e03fc7e - rework CFI instruction parsing to not use std.meta
- move register formatting code to zig-dwardump
2023-07-20 22:58:13 -04:00
kcbanner
e72e762d1e dwarf: implement more register mappings, fix up macos compile 2023-07-20 22:58:13 -04:00
kcbanner
9145ff7da0 dwarf: implement more register number mappings
- add dwarf.abi.RegisterContext to handle register numbers changing based on DWARF format
2023-07-20 22:58:13 -04:00
kcbanner
b449d98a93 - rework StackIterator to optionally use debug_info to unwind the stack
- add abi routines for getting register values
- unwding is working!
2023-07-20 22:58:13 -04:00
kcbanner
69399fbb82 - add default register rule
- fixup eh pointer decoding
2023-07-20 22:58:13 -04:00
kcbanner
a0a40c2e7e - implement more opcodes 2023-07-20 22:58:13 -04:00
kcbanner
7b4611cfb3 - move writing code to zig-dwarfdump
- implement restore_state, restore_extended, offset_extended
2023-07-20 22:58:13 -04:00
kcbanner
338df862d1 - fix remember_state
- implement def_cfa_register
2023-07-20 22:58:13 -04:00
kcbanner
f3f3c877e0 - add DWARF expression parser
- change read apis to use a stream
- add register formatters
2023-07-20 22:58:13 -04:00
kcbanner
38303d7b9c add VirtualMachine to run CFA instructions 2023-07-20 22:58:13 -04:00
kcbanner
8b8d627137 - add call frame instruction parser
- add register printing
2023-07-20 22:58:13 -04:00
kcbanner
6c1d1aa45c begin working on parsing unwind info 2023-07-20 22:58:13 -04:00
kcbanner
f6148f123e add CommonInformationEntry parser 2023-07-20 22:58:12 -04:00
kcbanner
ea9917d9bd debug: support loading elf debug info from external files
Some distributions (ie. Ubuntu) have their libc debug
info in separate files. This change allows the stack walking
code to read that debug info.

- add support for reading compressed ELF sections
- support reading the build-id from the elf headers in order to lookup external debug info
- support reading the .gnu_debuglink section to look up external debug info
2023-07-20 22:58:12 -04:00
Hao Li
8a18abfd60
Remove the SingleThread limitation for ARM (#16442)
The libc++ issue has been fixed in https://reviews.llvm.org/D118391, so
we don't have this issue in llvm 16+

closes #6573
2023-07-20 19:17:28 -04:00
Frank Denis
124448c1b6 Include system headers path when targeting assembly_with_cpp
This is consistent with what clang and gcc are doing, because
headers such as <cet.h> are specifically designed to be used
in the context of assembly code.

Fixes #16449
2023-07-20 16:14:12 -07:00
Andrew Kelley
3f15010abe
Merge pull request #16430 from jacobly0/llvm-builder
llvm: begin the journey of independence from llvm
2023-07-20 12:55:03 -07:00
Linus Groh
3bada8e3ce std.hash_map: Fix casing of keyPtr variables
The only case where those should be written in camelCase is if they were
function pointers, which they aren't.
2023-07-20 12:52:05 -07:00
Alex Kladov
772debb03a reduce AstGen.numberLiteral stack usage
At the moment, the LLVM IR we generate for this fn is

define internal fastcc void @AstGen.numberLiteral ...  {
Entry:
  ...
  %16 = alloca %"fmt.parse_float.decimal.Decimal(f128)", align 8
  ...

That `Decimal` is huuuge! It stores

    pub const max_digits =  11564;
    digits: [max_digits]u8,

on the stack.

It comes from `convertSlow` function, which LLVM happily inlined,
despite it being the cold path. Forbid inlining that to not penalize
callers with excessive stack usage.

Backstory: I was looking for needles memcpys in TigerBeetle, and came up
with this copyhound.zig tool for doing just that:

   ee67e2ab95/src/copyhound.zig

Got curious, run it on the Zig's own code base, and looked at some of
the worst offenders.

List of worst offenders:

warning: crypto.kyber_d00.Kyber.SecretKey.decaps: 7776 bytes memcpy
warning: crypto.ff.Modulus.powPublic: 8160 bytes memcpy
warning: AstGen.numberLiteral: 11584 bytes memcpy
warning: crypto.tls.Client.init__anon_133566: 13984 bytes memcpy
warning: http.Client.connectUnproxied: 16896 bytes memcpy
warning: crypto.tls.Client.init__anon_133566: 16904 bytes memcpy
warning: objcopy.ElfFileHelper.tryCompressSection: 32768 bytes memcpy

Note from Andrew: I removed `noinline` from this commit since it should
be enough to set it to be cold.
2023-07-20 12:51:18 -07:00
xdBronch
e313584a48 more UEFI alignment fixes 2023-07-20 12:46:33 -07:00
Jacob Young
17255bed41
Merge pull request #16443 from notcancername/cbe-empty-enum
cbe: fix bug where empty enum would be generated
2023-07-20 02:47:26 -04:00
Jacob Young
4d31d4d875 llvm: cleanup LLVM IR dumping 2023-07-20 02:44:40 -04:00
Jacob Young
a1062c63ca llvm: add Builder trailing extra interface 2023-07-20 01:48:50 -04:00
Jacob Young
ea72fea1a4 llvm: fix bootstrap 2023-07-19 23:39:42 -04:00
Jacob Young
9dd7a9eb02 llvm: fix various crashes 2023-07-19 23:38:40 -04:00
Jacob Young
9c4d5e64b4 llvm: minor fixes 2023-07-19 23:38:40 -04:00
Jacob Young
9afb349aba llvm: convert most instructions 2023-07-19 23:38:40 -04:00
Jacob Young
ef84e86992 llvm: convert cursor positioning 2023-07-19 23:38:40 -04:00
Jacob Young
3f46e747a8 llvm: convert basic block creation 2023-07-19 23:38:40 -04:00
Jacob Young
8fde3a8f04 llvm: finish converting constants 2023-07-19 23:38:40 -04:00
Jacob Young
1f8407c356 llvm: cleanup management and implement more const functions 2023-07-19 23:38:40 -04:00
Jacob Young
7ec7fe5359 llvm: cleanup init 2023-07-19 23:38:40 -04:00
Jacob Young
ff8a49448c llvm: finish converting lowerValue 2023-07-19 23:38:40 -04:00
Jacob Young
2cb52235b9 llvm: convert all calls to constInt 2023-07-19 23:38:40 -04:00
Jacob Young
65fd401c06 llvm: remove more usages of llvm.Type 2023-07-19 23:38:40 -04:00
Jacob Young
d167bd4b56 llvm: finish converting lowerType 2023-07-19 23:38:40 -04:00
Jacob Young
3314fd83af llvm: compute data layout without help like a grownup compiler 2023-07-19 23:38:40 -04:00
Jacob Young
d195173ba2 llvm: start tracking more things without relying on the llvm api 2023-07-19 23:38:40 -04:00
Jacob Young
e7ea7d3480 test: fix cbe execution tests 2023-07-19 23:20:25 -04:00
notcancername
ce859cfcb8 cbe: fix bug where empty enum would be generated
fix a bug where an invalid empty enum would be emitted into the C
source file if the global error set was empty.
2023-07-19 23:20:25 -04:00
zooster
996eb01746
collconv -> callconv (#16453) 2023-07-20 00:40:47 +00:00
Frank Denis
32aeb2c2ec
Be more conservative in the description of Aegis256Mac (#16452)
It is assumed that generating a collision requires more than 2^156
ciphertext modifications. This is plenty enough for any practical
purposes, but it hasn't been proven to be >= 2^256.

Be consistent and conservative here; just claim the same security
as the other variants.
2023-07-19 23:59:24 +00:00