Commit Graph

477 Commits

Author SHA1 Message Date
LemonBoy 41bca1ce76 unification: windows debug info 2020-02-22 12:05:50 +01:00
LemonBoy c060cae3ce unification: osx debug info 2020-02-22 11:51:45 +01:00
LemonBoy 8df4d7e4f4 unsure 2020-02-21 12:11:04 +01:00
LemonBoy a4d0d7f1de soldier on 2020-02-20 20:48:54 +01:00
LemonBoy 342a274948 tidy interface, const correctness 2020-02-20 20:18:51 +01:00
LemonBoy ce2efbdca6 Correctly count all the loaded modules on Windows 2020-02-20 19:41:29 +01:00
LemonBoy d5b583008a sudoku 2020-02-20 19:41:29 +01:00
LemonBoy fabab58528 less hideous 2020-02-20 19:41:29 +01:00
LemonBoy b9c02e4076 elvis entered the building 2020-02-20 19:41:29 +01:00
LemonBoy 2a350cf174 osx 2020-02-20 19:41:29 +01:00
LemonBoy b3f728585a windows widestring 2020-02-20 19:41:29 +01:00
LemonBoy 463f704431 wide 2020-02-20 19:41:29 +01:00
LemonBoy 99649794e9 win 2020-02-20 19:41:29 +01:00
LemonBoy b0b60cd468 tmp 2020-02-20 19:41:29 +01:00
LemonBoy 3620b67c26 debug: Split the DWARF stuff in its own file 2020-02-20 19:41:28 +01:00
Andrew Kelley 014f66e6de Merge pull request #4404 from ziglang/async-std
a big step towards std lib integration with async I/O
2020-02-10 00:22:59 -05:00
LemonBoy be02616c86 debug: Show a nice error message on SIGBUS 2020-02-07 16:06:33 +01:00
Andrew Kelley 0b5bcd2f56 more std lib async I/O integration
* `zig test` gainst `--test-evented-io` parameter and gains the ability
   to seamlessly run async tests.
 * `std.ChildProcess` opens its child process pipe with O_NONBLOCK when
   using evented I/O
 * `std.io.getStdErr()` gives a File that is blocking even in evented
   I/O mode.
 * Delete `std.event.fs`. The functionality is now merged into `std.fs`
   and async file system access (using a dedicated thread) is
   automatically handled.
 * `std.fs.File` can be configured to specify whether its handle is
   expected to block, and whether that is OK to block even when in
   async I/O mode. This makes async I/O work correctly for e.g. the
   file system as well as network.
 * `std.fs.File` has some deprecated functions removed.
 * Missing readv,writev,pread,pwrite,preadv,pwritev functions are added
   to `std.os` and `std.fs.File`. They are all integrated with async
   I/O.
 * `std.fs.Watch` is still bit rotted and needs to be audited in light
   of the new async/await syntax.
 * `std.io.OutStream` integrates with async I/O
 * linked list nodes in the std lib have default `null` values for
   `prev` and `next`.
 * Windows async I/O integration is enabled for reading/writing file
   handles.
 * Added `std.os.mode_t`. Integer sizes need to be audited.
 * Fixed #4403 which was causing compiler to crash.

This is working towards:

./zig test ../test/stage1/behavior.zig --test-evented-io

Which does not successfully build yet. I'd like to enable behavioral
tests and std lib tests with --test-evented-io in the test matrix in the
future, to prevent regressions.
2020-02-06 18:05:50 -05:00
LemonBoy cfcaf09cce debug: Improve the frame-walking strategy
Clean up the code a bit and introduce a few checks meant to avoid
overshooting the end of the frame chain.
The code is now stable enough not to cause panics during the call frame
walking.
2020-02-06 11:25:40 -05:00
Andrew Kelley 378d733439 Merge pull request #4345 from Rocknest/open-di
Fix double close in openElfDebugInfo
2020-02-05 15:56:56 -05:00
Rocknest f30feab1b9 Link the issue in doc comment 2020-02-05 17:19:00 +02:00
Rocknest a56183197d Fix double close in openElfDebugInfo 2020-02-05 17:18:30 +02:00
Michaël Larouche 9b11e5e1f1 Add InstallRawStep to Zig build system that does a similar job to llvm-objcopy. To use it, do 'exe.installRaw("kernel.bin");' where exe is a LibExeObjStep
Part of #2826
2020-02-03 15:07:34 -05:00
Andrew Kelley 65b1a4953f Merge pull request #4324 from fengb/testing-allocator
Remove debug.global_allocator in favor of testing.allocator
2020-01-30 10:01:40 -05:00
Andrew Kelley 0303e7bd8e Merge pull request #4319 from Rocknest/windows-traces
Bring windows segfault handler on par with linux
2020-01-30 09:26:39 -05:00
LemonBoy e77a102e24 Small DWARF fixups
* Clang doesn't seem to emit a DW_AT_low_pc together with DW_AT_ranges
  for asm files.
* Keep reading the other CUs if the lookup fails.
2020-01-30 09:11:02 -05:00
Rocknest a5f18c2b2a Fix one more edge case 2020-01-30 10:00:28 +02:00
Benjamin Feng b077f3ab7d Promoted "leak_count_allocator" to the main testing.allocator 2020-01-29 22:22:00 -06:00
Benjamin Feng 0c137934cb Move FailingAllocator to testing 2020-01-29 17:38:42 -06:00
Rocknest c0c9c601d4 Fix off-by-one error 2020-01-29 23:48:52 +02:00
Rocknest 4a4d6f2be9 Reorganize definitions 2020-01-29 23:15:17 +02:00
Benjamin Feng aa9caf5064 Create leak_count_allocator 2020-01-29 14:37:01 -06:00
Rocknest b7cd60a354 Changing stuff and seeing what happens 2020-01-29 21:09:00 +02:00
Benjamin Feng 4d134a01f5 Move debug.global_allocator to testing.allocator 2020-01-29 12:21:29 -06:00
Rocknest 3500b41bfe Add an advanced segfault handler on windows 2020-01-29 17:27:53 +02:00
Andrew Kelley 4591389497 Merge pull request #4300 from LemonBoy/debug-windows
More debug fixes - This time Windows gets a treat
2020-01-27 09:46:39 -05:00
LemonBoy d5c2a20d8e Unify the two DWARF interpreters
* Let's consolidate the special-cased DWARF interpreter for OSX with the
  general purpose one

* Drop the assumption that all the debug data is contained in a single
  contiguous slice of memory. This is a good news for freestanding
  targets and paves the way for supporting compressed debug sections.
2020-01-27 09:46:20 -05:00
LemonBoy 7336b750bd Fix stack-trace address calculation on Windows
Let's always subtract 1 from the return address so that we're sure to be
inside the callee.

Fixes some edge case where the stack trace skipped the first entry.
2020-01-27 13:12:01 +01:00
LemonBoy f8e015c85f Handle S_GPROC32 symbols in PDB files
Fixes some incomplete stack traces on Windows.
2020-01-27 13:10:35 +01:00
Andrew Kelley 51ac8eb08e fix regression in windows stack traces tty detection 2020-01-26 18:28:52 -05:00
Andrew Kelley 3839ea8978 fix debug info code not being freestanding compatible
in stack tracing code, the idea was to detect the tty settings at the
top of the stack and pass the information down. somewhere along the way
this got changed so that setTtyColor was assuming the global stderr_file
was related to the output stream the stack trace was being printed to.

now, tty_color is changed to tty_config, and it is an enum rather than a
bool, telling how tty colors are expected to be handled. windows is
still incorrectly looking at stderr_file.
2020-01-26 09:55:04 -05:00
LemonBoy aaa2f9ab2f Fix handling of DW_LNE_end_sequence
The DWARF specification states that LNE_end_sequence should just reset
the state machine, it's not an error.
2020-01-25 20:03:50 -05:00
LemonBoy 8516ee392c Fix parsing of DW_AT_Ranges debug entry
Follow the specification about what the base address is and how it can
be changed by some entries in the list itself.
2020-01-25 16:12:11 -05:00
LemonBoy b8601e9252 Adjust tests & work around a nasty ICE 2020-01-21 23:17:02 +01:00
LemonBoy bc82e0f3d3 Refactor some code in the debug output 2020-01-21 20:51:57 +01:00
LemonBoy 7fe13f4a86 Pointer alignment fixes for the stdlib 2020-01-08 20:03:03 +01:00
Andrew Kelley 53913acaf7 zig fmt and update extern fn to callconv(.C) 2020-01-06 15:34:50 -05:00
LemonBoy 563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
Andrew Kelley 8918cb06fc sentinel slicing improvements
* add runtime safety for slicing pointers, arrays, and slices.
 * slicing without a sentinel value results in non-sentineled slice
 * improved `std.debug.panic` handling of panic-during-panic
2019-12-20 18:28:59 -05:00
Andrew Kelley f8cd981c04 use -fsanitize=undefined for C code in safe build modes
closes #3569
2019-12-16 13:06:02 -05:00