1/* 2 * Copyright © 2009 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice, 10 * this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright notice, 12 * this list of conditions and the following disclaimer in the documentation 13 * and/or other materials provided with the distribution. 14 * 3. Neither the name of Apple Inc. ("Apple") nor the names of its 15 * contributors may be used to endorse or promote products derived from this 16 * software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * @APPLE_LICENSE_HEADER_END@ 30 */ 31#include <stuff/bool.h> 32#include "llvm-c/Disassembler.h" 33 34/* Name of this program for error messages (argv[0]) */ 35extern char *progname; 36 37/* 38 * The flags to indicate the actions to perform. 39 */ 40extern enum bool fflag; /* print the fat headers */ 41extern enum bool aflag; /* print the archive header */ 42extern enum bool hflag; /* print the exec or mach header */ 43extern enum bool lflag; /* print the load commands */ 44extern enum bool Lflag; /* print the shared library names */ 45extern enum bool Dflag; /* print the shared library id name */ 46extern enum bool tflag; /* print the text */ 47extern enum bool dflag; /* print the data */ 48extern enum bool oflag; /* print the objctive-C info */ 49extern enum bool Oflag; /* print the objctive-C selector strings only */ 50extern enum bool rflag; /* print the relocation entries */ 51extern enum bool Sflag; /* print the contents of the __.SYMDEF file */ 52extern enum bool vflag; /* print verbosely (symbolicly) when possible */ 53extern enum bool Vflag; /* print dissassembled operands verbosely */ 54extern enum bool cflag; /* print the argument and environ strings of a core file */ 55extern enum bool iflag; /* print the shared library initialization table */ 56extern enum bool Wflag; /* print the mod time of an archive as an decimal number */ 57extern enum bool Xflag; /* don't print leading address in disassembly */ 58extern enum bool Zflag; /* don't use simplified ppc mnemonics in disassembly */ 59extern enum bool Bflag; /* force Thumb disassembly (ARM objects only) */ 60extern enum bool Qflag; /* use the HACKED llvm-mc disassembler */ 61extern enum bool qflag; /* use 'C' Public llvm-mc disassembler */ 62extern enum bool gflag; /* group the disassembly */ 63extern enum bool jflag; /* print opcode bytes */ 64extern char *pflag; /* procedure name to start disassembling from */ 65extern char *segname, 66 *sectname; /* name of the section to print the contents of */ 67extern char *mcpu; /* the arg of the -mcpu=arg flag */ 68 69uint32_t m68k_usrstack(void); 70uint32_t m88k_usrstack(void); 71uint32_t i386_usrstack(void); 72uint32_t hppa_usrstack(void); 73uint32_t sparc_usrstack(void); 74 75#ifndef STRUCT_INST 76#define STRUCT_INST 77 78struct inst { 79 uint64_t address; 80 char *label; 81 enum bool needs_tmp_label; 82 char *tmp_label; 83 enum bool print; 84 enum bool has_raw_target_address; 85 uint64_t raw_target_address; 86}; 87 88#endif /* !defined(STRUCT_INST) */ 89