unicorn/qemu
Markus Armbruster 97ad660361
error: On abort, report where the error was created
This is particularly useful when we abort in error_propagate(),
because there the stack backtrace doesn't lead to where the error was
created. Looks like this:

Unexpected error in parse_block_error_action() at .../qemu/blockdev.c:322:
qemu-system-x86_64: -drive if=none,werror=foo: 'foo' invalid write error action
Aborted (core dumped)

Note: to get this example output, I monkey-patched drive_new() to pass
&error_abort to blockdev_init().

To keep the error handling boiler plate from growing even more, all
error_setFOO() become macros expanding into error_setFOO_internal()
with additional __FILE__, __LINE__, __func__ arguments. Not exactly
pretty, but it works.

The macro trickery breaks down when you take the address of an
error_setFOO(). Fortunately, we do that in just one place: qemu-ga's
Windows VSS provider and requester DLL wants to call
error_setg_win32() through a function pointer "to avoid linking glib
to the DLL". Use error_setg_win32_internal() there. The use of the
function pointer is already wrapped in a macro, so the churn isn't
bad.

Code size increases by some 35KiB for me (0.7%). Tolerable. Could be
less if we passed relative rather than absolute source file names to
the compiler, or forwent reporting __func__.

Backports commit 1e9b65bb1bad51735cab6c861c29b592dccabf0e from qemu
2018-02-17 15:23:37 -05:00
..
crypto crypto: move built-in AES implementation into crypto/ 2018-02-17 15:23:17 -05:00
default-configs
docs
fpu
hw osdep.h: Move some compiler-specific things to compiler.h 2018-02-17 15:23:28 -05:00
include error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
qapi qerror: Clean up QERR_ macros to expand into a single string 2018-02-17 15:23:09 -05:00
qobject qerror: Finally unused, clean up 2018-02-17 15:23:10 -05:00
qom qom: Add recursive version of object_child_for_each 2018-02-17 15:23:35 -05:00
scripts
target-arm target-arm: Add AArch64 access to PAR_EL1 2018-02-17 15:23:36 -05:00
target-i386 target-i386: Remove x86_cpu_compat_set_features() 2018-02-17 15:23:26 -05:00
target-m68k cpu-exec: Purge all uses of ENV_GET_CPU() 2018-02-17 15:23:18 -05:00
target-mips target-mips: simplify LWL/LDL mask generation 2018-02-17 15:23:27 -05:00
target-sparc cpu-exec: Purge all uses of ENV_GET_CPU() 2018-02-17 15:23:18 -05:00
tcg tcg/i386: use softmmu fast path for unaligned accesses 2018-02-17 15:23:33 -05:00
util error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
aarch64.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
aarch64eb.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
accel.c
arm.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
armeb.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
CODING_STYLE
configure
COPYING
COPYING.LIB
cpu-exec.c cpu-exec: Purge all uses of ENV_GET_CPU() 2018-02-17 15:23:18 -05:00
cpus.c cpu-exec: Purge all uses of ENV_GET_CPU() 2018-02-17 15:23:18 -05:00
cputlb.c cputlb: Add functions for flushing TLB for a single MMU index 2018-02-17 15:23:31 -05:00
exec.c exec.c: Use pow2floor() rather than hand-calculation 2018-02-17 15:23:35 -05:00
gen_all_header.sh
glib_compat.c crypto: introduce new module for computing hash digests 2018-02-17 15:23:17 -05:00
HACKING
header_gen.py error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
ioport.c
LICENSE
m68k.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
Makefile
Makefile.objs crypto: introduce new module for computing hash digests 2018-02-17 15:23:17 -05:00
Makefile.target
memory_mapping.c memory_mapping: Rework cpu related includes 2018-02-17 15:23:15 -05:00
memory.c osdep.h: Move some compiler-specific things to compiler.h 2018-02-17 15:23:28 -05:00
mips64.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
mips64el.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
mips.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
mipsel.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
powerpc.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
qapi-schema.json
qemu-log.c
qemu-timer.c
rules.mak
softmmu_template.h
sparc64.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
sparc.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00
tcg-runtime.c
translate-all.c translate-all: Change tb_flush() env argument to cpu 2018-02-17 15:23:18 -05:00
translate-all.h translate-all: remove unnecessary argument to tb_invalidate_phys_range 2018-02-13 09:04:51 -05:00
unicorn_common.h
VERSION
vl.c exec: Add semihosting stubs 2018-02-17 15:23:33 -05:00
vl.h
x86_64.h error: On abort, report where the error was created 2018-02-17 15:23:37 -05:00