mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
e5b1b0458e
One way of using llvm-symbolizer is to interactively within a process write a line from a parent process to llvm-symbolizer's stdin, and then read the output, then write the next line, read, etc. This worked as long as all the lines were good. However, this didn't work prior to this patch if any of the inputs were bad inputs, because the output is not flushed after a bad input, meaning the parent process is sat waiting for output, whilst llvm-symbolizer is sat waiting for input. This patch flushes the output after every invocation of symbolizeInput when reading from stdin. It also removes unnecessary flushing when llvm-symbolizer is not reading addresses from stdin, which should give a slight performance boost in these situations. Reviewed by: ikudrin Differential Revision: https://reviews.llvm.org/D62371 llvm-svn: 362511
18 lines
586 B
ArmAsm
18 lines
586 B
ArmAsm
# REQUIRES: x86-registered-target
|
|
|
|
## If a process spawns llvm-symbolizer, and wishes to feed it addresses one at a
|
|
## time, llvm-symbolizer needs to flush its output after each input has been
|
|
## processed or the parent process will not be able to read the output and may
|
|
## deadlock. This test runs a script that simulates this situation for both a
|
|
## a good and bad input.
|
|
|
|
foo:
|
|
nop
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -g
|
|
# RUN: %python %p/Inputs/flush-output.py llvm-symbolizer %t.o \
|
|
# RUN: | FileCheck %s
|
|
|
|
# CHECK: flush-output.s:10
|
|
# CHECK: bad
|