Commit Graph

95 Commits

Author SHA1 Message Date
Sahnvour
a60ecdc681 Hopefully fixed #1503 (at least improved) line accuracy of stack traces on windows. 2019-01-18 10:35:00 +01:00
Sahnvour
5ab8db7b3e removed unnecessary cast 2019-01-18 10:35:00 +01:00
Andrew Kelley
d8b6fa9134
Merge pull request #1859 from mgxm/fbsd2
Progress towards tier 1 support for FreeBSD x86_64
2018-12-29 12:49:23 -05:00
nebulaeonline
fdea12b2d9 msvc subsystem option handling; added uefi os type 2018-12-23 22:44:02 -05:00
Marcio Giaxa
e5b4748101 freebsd: initial stack trace
Stack trace is partially working, with only a few symbols missing. Uses
the same functions that we use in Linux to get the necessary debug info.
2018-12-19 18:42:00 -02:00
Andrew Kelley
e98ba5fc40
add mem.readVarInt, fix InStream.readVarInt, fix stack traces
fixes a regression from b883bc8
2018-12-13 06:38:14 -05:00
Andrew Kelley
b883bc873d
breaking API changes to all readInt/writeInt functions & more
* add `@bswap` builtin function. See #767
 * comptime evaluation facilities are improved to be able to
   handle a `@ptrCast` with a backing array.
 * `@truncate` allows "truncating" a u0 value to any integer
   type, and the result is always comptime known to be `0`.
 * when specifying pointer alignment in a type expression,
   the alignment value of pointers which do not have addresses
   at runtime is ignored, and always has the default/ABI alignment
 * threw in a fix to freebsd/x86_64.zig to update syntax from
   language changes
 * some improvements are pending #863

closes #638
closes #1733

std lib API changes
 * io.InStream().readIntNe renamed to readIntNative
 * io.InStream().readIntLe renamed to readIntLittle
 * io.InStream().readIntBe renamed to readIntBig
 * introduced io.InStream().readIntForeign
 * io.InStream().readInt has parameter order changed
 * io.InStream().readVarInt has parameter order changed
 * io.InStream().writeIntNe renamed to writeIntNative
 * introduced io.InStream().writeIntForeign
 * io.InStream().writeIntLe renamed to writeIntLittle
 * io.InStream().writeIntBe renamed to writeIntBig
 * io.InStream().writeInt has parameter order changed
 * mem.readInt has different parameters and semantics
 * introduced mem.readIntNative
 * introduced mem.readIntForeign
 * mem.readIntBE renamed to mem.readIntBig and different API
 * mem.readIntLE renamed to mem.readIntLittle and different API
 * introduced mem.readIntSliceNative
 * introduced mem.readIntSliceForeign
 * introduced mem.readIntSliceLittle
 * introduced mem.readIntSliceBig
 * introduced mem.readIntSlice
 * mem.writeInt has different parameters and semantics
 * introduced mem.writeIntNative
 * introduced mem.writeIntForeign
 * mem.writeIntBE renamed to mem.readIntBig and different semantics
 * mem.writeIntLE renamed to mem.readIntLittle and different semantics
 * introduced mem.writeIntSliceForeign
 * introduced mem.writeIntSliceNative
 * introduced mem.writeIntSliceBig
 * introduced mem.writeIntSliceLittle
 * introduced mem.writeIntSlice
 * removed mem.endianSwapIfLe
 * removed mem.endianSwapIfBe
 * removed mem.endianSwapIf
 * added mem.littleToNative
 * added mem.bigToNative
 * added mem.toNative
 * added mem.nativeTo
 * added mem.nativeToLittle
 * added mem.nativeToBig
2018-12-12 20:35:04 -05:00
Andrew Kelley
3a1612a0f5
std.debug: fix some issues with freestanding debug info 2018-12-02 23:46:45 -05:00
Andrew Kelley
5c3b8cb365
expose std.debug.DwarfInfo and delete unused function 2018-12-02 20:08:06 -05:00
Andrew Kelley
a436d2ab8c
std.debug.printSourceAtAddressDwarf
which works in freestanding mode
2018-12-02 19:34:11 -05:00
Andrew Kelley
4292ed9571
std.debug.StackIterator 2018-12-02 18:54:04 -05:00
Andrew Kelley
a40d160a5c
introduce std.io.SeekableStream
Relevant #764

dwarf debug info is modified to use this instead of std.os.File
directly to make it easier for bare metal projects to take advantage
of debug info parsing
2018-12-02 18:36:18 -05:00
Andrew Kelley
e3bf40742d
Merge branch 'master' into freebsd2 2018-11-27 20:36:44 -05:00
Sahnvour
1fb15be05f stack traces: fix for windows 2018-11-27 20:34:55 -05:00
Andrew Kelley
4dafdc00d5
zig fmt 2018-11-19 17:28:18 -05:00
Andrew Kelley
9493738e54
Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2 2018-11-19 17:24:41 -05:00
Andrew Kelley
ba361f31c6
more fixes related to readStruct API 2018-11-15 16:16:08 -05:00
Jimmi Holst Christensen
8139c5a516
New Zig formal grammar (#1685)
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-13 05:08:37 -08:00
emekoi
8e69a18d8c made colored output more consistent (#1706)
* made colored output more consistent
* added os.supportsAnsiEscapeCodes
2018-11-08 00:36:36 -05:00
Andrew Kelley
2b395d4ede
remove @minValue,@maxValue; add std.math.minInt,maxInt
closes #1466
closes #1476
2018-10-26 15:01:51 -04:00
Greg V
7a3f0a55d9 Add freebsd to more things 2018-10-20 15:15:01 +03:00
Andrew Kelley
d5648d2640
remove implicit cast from T to *const T
closes #1465
2018-10-15 18:23:47 -04:00
Jimmi Holst Christensen
378d3e4403
Solve the return type ambiguity (#1628)
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
2018-10-15 09:51:15 -04:00
Andrew Kelley
9d4eaf1e07
update std lib API for I/O
std.io.FileInStream -> std.os.File.InStream
std.io.FileInStream.init(file) -> file.inStream()
std.io.FileOutStream -> std.os.File.OutStream
std.io.FileOutStream.init(file) -> file.outStream()

remove a lot of error code possibilities from os functions

std.event.net.socketRead -> std.event.net.read
std.event.net.socketWrite -> std.event.net.write
add std.event.net.readv
add std.event.net.writev
add std.event.net.readvPosix
add std.event.net.writevPosix
add std.event.net.OutStream
add std.event.net.InStream

add std.event.io.InStream
add std.event.io.OutStream
2018-09-30 17:28:35 -04:00
Jimmi Holst Christensen
1428ef3b07 Expose failing_allocator as *Allocator instead of const FailingAllocator 2018-09-30 01:23:05 +02:00
Andrew Kelley
3f776af3fa
fix alignment of structs
closes #1248
closes #1052
closes #1154
2018-09-14 19:08:59 -04:00
Andrew Kelley
a757533386 fix zig fmt on windows
closes #1069
2018-09-12 14:26:21 -04:00
Andrew Kelley
832caefc2a fix regressions 2018-09-02 18:35:32 -04:00
Andrew Kelley
4cd50865bf fix source file lookup 2018-09-02 17:58:50 -04:00
Andrew Kelley
98dc943c07 rework code to avoid duplicate operations 2018-09-02 15:58:08 -04:00
Andrew Kelley
6ddbd345aa figuring out where /names stream is 2018-08-31 19:50:03 -04:00
Andrew Kelley
b36b93fb3e awareness of debug subsections 2018-08-31 15:02:41 -04:00
Andrew Kelley
44f908d2e6 figuring out which module an address belongs in 2018-08-30 15:33:50 -04:00
Andrew Kelley
686663239a printing info from the ModuleInfo substream of DebugInfo 2018-08-29 19:00:24 -04:00
Andrew Kelley
f1b71053de use RtlCaptureStackBackTrace on windows 2018-08-29 16:35:51 -04:00
Andrew Kelley
833477abf5 fix unresolved path preventing PDB loading 2018-08-28 18:55:51 -04:00
Andrew Kelley
41723f842c Merge branch 'windows-coff-issue721' of https://github.com/Sahnvour/zig into Sahnvour-windows-coff-issue721 2018-08-28 17:32:32 -04:00
Andrew Kelley
ac36f98e72 fix stack traces on linux 2018-08-25 03:07:37 -04:00
Andrew Kelley
32901926f0 compilation unit cwd dir appears to be unnecessary on macos 2018-08-24 15:43:48 -04:00
Andrew Kelley
4e7c255e4d macos stack traces have address-to-line translation 2018-08-24 14:55:55 -04:00
Andrew Kelley
95e197667e macos stack traces have the compilation unit in them 2018-08-24 11:30:36 -04:00
Andrew Kelley
3173c90f14 macos stack traces: read debug info sections from .o files 2018-08-23 23:08:34 -04:00
Andrew Kelley
5c1ec20c9a MacOS stack traces use the already mmapped executable
...rather than trying to find the executable on the file system.

Also use a more robust PIE offset calculation based on the
available metadata.

And for the last function, use the data that tells the end
rather than assuming 4K.

Also they print in a consistent way with Linux stack traces.
2018-08-23 16:23:33 -04:00
Andrew Kelley
8f96553be8 rename std.debug.ElfStackTrace to std.debug.DebugInfo 2018-08-22 21:35:49 -04:00
Andrew Kelley
ea1b21dbdb fix linux
* error.BadFd is not a valid error code. it would always be a bug to
   get this error code.
 * merge error.Io with existing error.InputOutput
 * merge error.PathNotFound with existing error.FileNotFound.
   Not all OS's support both.
 * add os.File.openReadC
 * add error.BadPathName for windows file operations with invalid
   characters
 * add os.toPosixPath to help stack allocate a null terminating byte
 * add some TODOs for other functions to investigate removing the
   allocator requirement
 * optimize some implementations to use the alternate functions when
   a null byte is already available
 * add a missing error.SkipZigTest
 * os.selfExePath uses a non-allocating API
 * os.selfExeDirPath uses a non-allocating API
 * os.path.real uses a non-allocating API
 * add os.path.realAlloc and os.path.realC
 * convert many windows syscalls to use the W versions (See #534)
2018-08-21 20:31:50 -04:00
Andrew Kelley
bda5539e9d *WIP* std.os assumes comptime-known max path size
this allows us to remove the requirement of allocators for a lot
of functions

See #1392
2018-08-21 00:46:42 -04:00
Shawn Landden
bb93886791 do not use an allocator when we don't need to because of the existance of PATH_MAX 2018-08-19 21:42:48 -07:00
Andrew Kelley
e3ae2cfb52 add std.event.RwLock and a few more std changes
* add std.event.RwLock and std.event.RwLocked
 * std.debug.warn does its printing locked
 * add std.Mutex, however it's currently implemented as a spinlock
 * rename std.event.Group.cancelAll to std.event.Group.deinit and change
   the docs and assumptions.
 * add std.HashMap.clone
2018-08-01 16:26:37 -04:00
Andrew Kelley
cc45527333 introduce std.event.fs for async file system functions
only works on linux so far
2018-07-30 13:44:36 -04:00
Andrew Kelley
09304aab77 fix cancel and await semantics 2018-07-29 23:25:40 -04:00