From eef850ebde25a2dc3600f186d3793076528772dd Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Sun, 2 Aug 2020 18:33:22 +0200 Subject: [PATCH] Remove all references to radare2 --- .github/workflows/c-cpp.yml | 21 - README.md | 2 - bfd/Makefile.am | 2 +- bfd/Makefile.in | 2 +- bfd/pdb-types.h | 1304 ----------------------------------- gdb/Makefile.in | 4 +- gdb/aclocal.m4 | 344 --------- gdb/coffread.c | 9 +- gdb/configure | 232 +------ gdb/configure.ac | 2 - gdb/pdb.c | 242 ------- gdb/pdb.h | 3 - 12 files changed, 7 insertions(+), 2160 deletions(-) delete mode 100644 bfd/pdb-types.h diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index f4149c4..a477fae 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -7,27 +7,6 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Install radare2 dependencies - run: sudo apt install patch unzip git gcc make curl pkg-config xz-utils - - - name: Checkout radare2 - uses: actions/checkout@v2 - with: - path: radare2 - repository: radareorg/radare2 - ref: 4.5.0 - - - name: Build radare2 - working-directory: radare2 - run: | - sys/debian.sh - mv radare2_*_amd64.deb radare2_amd64.deb - mv radare2-dev_*_amd64.deb radare2-dev_amd64.deb - - - name: Install radare2 - working-directory: radare2 - run: sudo apt install ./radare2*.deb - - name: Checkout gdb-msvc uses: actions/checkout@v2 diff --git a/README.md b/README.md index 3617b13..b9d49d5 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ The main features of this patchset are: These features are implemented using libraries from [LLVM](https://llvm.org/). -**NOTE:** Currently, PDB symbol loading uses [radare2](https://github.com/radareorg/radare2)'s libr. This is being removed in favour of a better implementation that uses LLVM. - ## Building * `mkdir build && cd build` diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 7a011ca..b55bca5 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -719,7 +719,7 @@ SOURCE_HFILES = \ version.h vms.h \ wasm-module.h \ xcofflink.h xsym.h \ - pdb.h pdb-types.h + pdb.h ## ... and .h files which are in the build tree, minus config.h and bfd.h BUILD_HFILES = \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 695f69d..4df0eaf 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -1316,7 +1316,7 @@ SOURCE_HFILES = \ version.h vms.h \ wasm-module.h \ xcofflink.h xsym.h \ - pdb.h pdb-types.h + pdb.h BUILD_HFILES = \ bfdver.h elf32-target.h elf64-target.h targmatch.h bfd_stdint.h diff --git a/bfd/pdb-types.h b/bfd/pdb-types.h deleted file mode 100644 index 0ae3b13..0000000 --- a/bfd/pdb-types.h +++ /dev/null @@ -1,1304 +0,0 @@ -/* Includes code from radare2: - radare - LGPL - Copyright 2014 - inisider - (https://github.com/radareorg/radare2) */ - -#ifndef PDB_TYPES_H -#define PDB_TYPES_H - -#define _R_LIST_C -#include - -#define READ_PAGE_FAIL 0x01 - -// TODO: Move to a general macros in r_util/r_types - -/////////////////////////////////////////////////////////////////////////////// -#define GET_PAGE(pn, off, pos, page_size) { \ - (pn) = (pos) / (page_size); \ - (off) = (pos) % (page_size); \ -} - -/////////////////////////////////////////////////////////////////////////////// -#define READ_PAGES(start_indx, end_indx) { \ - for (i = start_indx; i < end_indx; i++) { \ - fseek(stream_file->fp, stream_file->pages[i] * stream_file->page_size, SEEK_SET); \ - fread(tmp, stream_file->page_size, 1, stream_file->fp); \ - tmp += stream_file->page_size; \ - } \ -} - -/////////////////////////////////////////////////////////////////////////////// -#define SWAP_UINT16(x) (((x) >> 8) | ((x) << 8)) - -/////////////////////////////////////////////////////////////////////////////// -#define SWAP_UINT32(x) (((x) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | ((x) << 24)) - -/////////////////////////////////////////////////////////////////////////////// -#define CAN_READ(curr_read_bytes, bytes_for_read, max_len) { \ - if ((((curr_read_bytes) + (bytes_for_read)) >= (max_len))) { \ - return 0; \ - } \ -} - -/////////////////////////////////////////////////////////////////////////////// -#define UPDATE_DATA(src, curr_read_bytes, bytes_for_read) { \ - (src) += (bytes_for_read); \ - (curr_read_bytes) += (bytes_for_read); \ -} - -/////////////////////////////////////////////////////////////////////////////// -#define PEEK_READ1(curr_read_bytes, max_len, dst, src, type_name) { \ - CAN_READ((curr_read_bytes), 1, (max_len)); \ - (dst) = *(type_name *) (src); \ -} -#define PEEK_READ2(curr_read_bytes, max_len, dst, src, type_name) { \ - CAN_READ((curr_read_bytes), 2, (max_len)); \ - (dst) = (type_name) r_read_le16 (src); \ -} -#define PEEK_READ4(curr_read_bytes, max_len, dst, src, type_name) { \ - CAN_READ((curr_read_bytes), 4, (max_len)); \ - (dst) = (type_name) r_read_le32 (src); \ -} -#define PEEK_READ8(curr_read_bytes, max_len, dst, src, type_name) { \ - CAN_READ((curr_read_bytes), 8, (max_len)); \ - (dst) = (type_name) r_read_le64 (src); \ -} -/////////////////////////////////////////////////////////////////////////////// -#define READ1(curr_read_bytes, max_len, dst, src, type_name) { \ - PEEK_READ1((curr_read_bytes), (max_len), (dst), (src), type_name); \ - UPDATE_DATA((src), (curr_read_bytes), 1); \ -} - -#define READ2(curr_read_bytes, max_len, dst, src, type_name) { \ - PEEK_READ2((curr_read_bytes), (max_len), (dst), (src), type_name); \ - UPDATE_DATA((src), (curr_read_bytes), 2); \ -} - -#define READ4(curr_read_bytes, max_len, dst, src, type_name) { \ - PEEK_READ4((curr_read_bytes), (max_len), (dst), (src), type_name); \ - UPDATE_DATA((src), (curr_read_bytes), 4); \ -} - -#define READ8(curr_read_bytes, max_len, dst, src, type_name) { \ - PEEK_READ8((curr_read_bytes), (max_len), (dst), (src), type_name); \ - UPDATE_DATA((src), (curr_read_bytes), 8); \ -} - -/////////////////////////////////////////////////////////////////////////////// -#define PAD_ALIGN(pad, curr_read_bytes, src, max_len) { \ - int tmp = 0; \ - if ((pad) > 0xF0) { \ - tmp = (pad) & 0x0F; \ - CAN_READ((curr_read_bytes), (tmp), (len)); \ - UPDATE_DATA((src), (curr_read_bytes), (tmp)); \ - } \ -} - -typedef struct R_STREAM_FILE_ { - // FILE *fp; - RBuffer *buf; - int *pages; - int page_size; - int pages_amount; - int end; - int pos; - int error; -} R_STREAM_FILE; - -typedef void (*free_func) (void *); -typedef void (*get_value_name) (void *type, char **res_name); -typedef void (*get_value) (void *type, int *res); -typedef void (*get_value_name_len) (void *type, int *res); -typedef void (*get_member_list) (void *type, RList **l); -typedef int (*get_arg_type_) (void *type, void **ret_type); -typedef int (*get_val_type) (void *type, void **ret_type); - -typedef get_val_type get_element_type_; -typedef get_val_type get_index_type_; -typedef get_val_type get_base_type_; -typedef get_arg_type_ get_derived_; -typedef get_arg_type_ get_vshape_; -typedef get_arg_type_ get_utype_; -typedef get_val_type get_return_type_; -typedef get_val_type get_class_type_; -typedef get_val_type get_this_type_; -typedef get_arg_type_ get_arglist_; -typedef get_arg_type_ get_index_; -typedef get_arg_type_ get_mlist_; -typedef get_arg_type_ get_modified_type_; -typedef get_value get_index_val; -typedef get_value_name get_print_type_; - -typedef enum { - eT_NOTYPE = 0x00000000, - eT_ABS = 0x00000001, - eT_SEGMENT = 0x00000002, - eT_VOID = 0x00000003, - - eT_HRESULT = 0x00000008, - eT_32PHRESULT = 0x00000408, - eT_64PHRESULT = 0x00000608, - - eT_PVOID = 0x00000103, - eT_PFVOID = 0x00000203, - eT_PHVOID = 0x00000303, - eT_32PVOID = 0x00000403, - eT_32PFVOID = 0x00000503, - eT_64PVOID = 0x00000603, - - eT_CURRENCY = 0x00000004, - eT_NBASICSTR = 0x00000005, - eT_FBASICSTR = 0x00000006, - eT_NOTTRANS = 0x00000007, - eT_BIT = 0x00000060, - eT_PASCHAR = 0x00000061, - - eT_CHAR = 0x00000010, - eT_PCHAR = 0x00000110, - eT_PFCHAR = 0x00000210, - eT_PHCHAR = 0x00000310, - eT_32PCHAR = 0x00000410, - eT_32PFCHAR = 0x00000510, - eT_64PCHAR = 0x00000610, - - eT_UCHAR = 0x00000020, - eT_PUCHAR = 0x00000120, - eT_PFUCHAR = 0x00000220, - eT_PHUCHAR = 0x00000320, - eT_32PUCHAR = 0x00000420, - eT_32PFUCHAR = 0x00000520, - eT_64PUCHAR = 0x00000620, - - eT_RCHAR = 0x00000070, - eT_PRCHAR = 0x00000170, - eT_PFRCHAR = 0x00000270, - eT_PHRCHAR = 0x00000370, - eT_32PRCHAR = 0x00000470, - eT_32PFRCHAR = 0x00000570, - eT_64PRCHAR = 0x00000670, - - eT_WCHAR = 0x00000071, - eT_PWCHAR = 0x00000171, - eT_PFWCHAR = 0x00000271, - eT_PHWCHAR = 0x00000371, - eT_32PWCHAR = 0x00000471, - eT_32PFWCHAR = 0x00000571, - eT_64PWCHAR = 0x00000671, - - eT_INT1 = 0x00000068, - eT_PINT1 = 0x00000168, - eT_PFINT1 = 0x00000268, - eT_PHINT1 = 0x00000368, - eT_32PINT1 = 0x00000468, - eT_32PFINT1 = 0x00000568, - eT_64PINT1 = 0x00000668, - - eT_UINT1 = 0x00000069, - eT_PUINT1 = 0x00000169, - eT_PFUINT1 = 0x00000269, - eT_PHUINT1 = 0x00000369, - eT_32PUINT1 = 0x00000469, - eT_32PFUINT1 = 0x00000569, - eT_64PUINT1 = 0x00000669, - - eT_SHORT = 0x00000011, - eT_PSHORT = 0x00000111, - eT_PFSHORT = 0x00000211, - eT_PHSHORT = 0x00000311, - eT_32PSHORT = 0x00000411, - eT_32PFSHORT = 0x00000511, - eT_64PSHORT = 0x00000611, - - eT_USHORT = 0x00000021, - eT_PUSHORT = 0x00000121, - eT_PFUSHORT = 0x00000221, - eT_PHUSHORT = 0x00000321, - eT_32PUSHORT = 0x00000421, - eT_32PFUSHORT = 0x00000521, - eT_64PUSHORT = 0x00000621, - - eT_INT2 = 0x00000072, - eT_PINT2 = 0x00000172, - eT_PFINT2 = 0x00000272, - eT_PHINT2 = 0x00000372, - eT_32PINT2 = 0x00000472, - eT_32PFINT2 = 0x00000572, - eT_64PINT2 = 0x00000672, - - eT_UINT2 = 0x00000073, - eT_PUINT2 = 0x00000173, - eT_PFUINT2 = 0x00000273, - eT_PHUINT2 = 0x00000373, - eT_32PUINT2 = 0x00000473, - eT_32PFUINT2 = 0x00000573, - eT_64PUINT2 = 0x00000673, - - eT_LONG = 0x00000012, - eT_PLONG = 0x00000112, - eT_PFLONG = 0x00000212, - eT_PHLONG = 0x00000312, - eT_32PLONG = 0x00000412, - eT_32PFLONG = 0x00000512, - eT_64PLONG = 0x00000612, - - eT_ULONG = 0x00000022, - eT_PULONG = 0x00000122, - eT_PFULONG = 0x00000222, - eT_PHULONG = 0x00000322, - eT_32PULONG = 0x00000422, - eT_32PFULONG = 0x00000522, - eT_64PULONG = 0x00000622, - - eT_INT4 = 0x00000074, - eT_PINT4 = 0x00000174, - eT_PFINT4 = 0x00000274, - eT_PHINT4 = 0x00000374, - eT_32PINT4 = 0x00000474, - eT_32PFINT4 = 0x00000574, - eT_64PINT4 = 0x00000674, - - eT_UINT4 = 0x00000075, - eT_PUINT4 = 0x00000175, - eT_PFUINT4 = 0x00000275, - eT_PHUINT4 = 0x00000375, - eT_32PUINT4 = 0x00000475, - eT_32PFUINT4 = 0x00000575, - eT_64PUINT4 = 0x00000675, - - eT_QUAD = 0x00000013, - eT_PQUAD = 0x00000113, - eT_PFQUAD = 0x00000213, - eT_PHQUAD = 0x00000313, - eT_32PQUAD = 0x00000413, - eT_32PFQUAD = 0x00000513, - eT_64PQUAD = 0x00000613, - - eT_UQUAD = 0x00000023, - eT_PUQUAD = 0x00000123, - eT_PFUQUAD = 0x00000223, - eT_PHUQUAD = 0x00000323, - eT_32PUQUAD = 0x00000423, - eT_32PFUQUAD = 0x00000523, - eT_64PUQUAD = 0x00000623, - - eT_INT8 = 0x00000076, - eT_PINT8 = 0x00000176, - eT_PFINT8 = 0x00000276, - eT_PHINT8 = 0x00000376, - eT_32PINT8 = 0x00000476, - eT_32PFINT8 = 0x00000576, - eT_64PINT8 = 0x00000676, - - eT_UINT8 = 0x00000077, - eT_PUINT8 = 0x00000177, - eT_PFUINT8 = 0x00000277, - eT_PHUINT8 = 0x00000377, - eT_32PUINT8 = 0x00000477, - eT_32PFUINT8 = 0x00000577, - eT_64PUINT8 = 0x00000677, - - eT_OCT = 0x00000014, - eT_POCT = 0x00000114, - eT_PFOCT = 0x00000214, - eT_PHOCT = 0x00000314, - eT_32POCT = 0x00000414, - eT_32PFOCT = 0x00000514, - eT_64POCT = 0x00000614, - - eT_UOCT = 0x00000024, - eT_PUOCT = 0x00000124, - eT_PFUOCT = 0x00000224, - eT_PHUOCT = 0x00000324, - eT_32PUOCT = 0x00000424, - eT_32PFUOCT = 0x00000524, - eT_64PUOCT = 0x00000624, - - eT_INT16 = 0x00000078, - eT_PINT16 = 0x00000178, - eT_PFINT16 = 0x00000278, - eT_PHINT16 = 0x00000378, - eT_32PINT16 = 0x00000478, - eT_32PFINT16 = 0x00000578, - eT_64PINT16 = 0x00000678, - - eT_UINT16 = 0x00000079, - eT_PUINT16 = 0x00000179, - eT_PFUINT16 = 0x00000279, - eT_PHUINT16 = 0x00000379, - eT_32PUINT16 = 0x00000479, - eT_32PFUINT16 = 0x00000579, - eT_64PUINT16 = 0x00000679, - - eT_REAL32 = 0x00000040, - eT_PREAL32 = 0x00000140, - eT_PFREAL32 = 0x00000240, - eT_PHREAL32 = 0x00000340, - eT_32PREAL32 = 0x00000440, - eT_32PFREAL32 = 0x00000540, - eT_64PREAL32 = 0x00000640, - - eT_REAL48 = 0x00000044, - eT_PREAL48 = 0x00000144, - eT_PFREAL48 = 0x00000244, - eT_PHREAL48 = 0x00000344, - eT_32PREAL48 = 0x00000444, - eT_32PFREAL48 = 0x00000544, - eT_64PREAL48 = 0x00000644, - - eT_REAL64 = 0x00000041, - eT_PREAL64 = 0x00000141, - eT_PFREAL64 = 0x00000241, - eT_PHREAL64 = 0x00000341, - eT_32PREAL64 = 0x00000441, - eT_32PFREAL64 = 0x00000541, - eT_64PREAL64 = 0x00000641, - - eT_REAL80 = 0x00000042, - eT_PREAL80 = 0x00000142, - eT_PFREAL80 = 0x00000242, - eT_PHREAL80 = 0x00000342, - eT_32PREAL80 = 0x00000442, - eT_32PFREAL80 = 0x00000542, - eT_64PREAL80 = 0x00000642, - - eT_REAL128 = 0x00000043, - eT_PREAL128 = 0x00000143, - eT_PFREAL128 = 0x00000243, - eT_PHREAL128 = 0x00000343, - eT_32PREAL128 = 0x00000443, - eT_32PFREAL128 = 0x00000543, - eT_64PREAL128 = 0x00000643, - - eT_CPLX32 = 0x00000050, - eT_PCPLX32 = 0x00000150, - eT_PFCPLX32 = 0x00000250, - eT_PHCPLX32 = 0x00000350, - eT_32PCPLX32 = 0x00000450, - eT_32PFCPLX32 = 0x00000550, - eT_64PCPLX32 = 0x00000650, - - eT_CPLX64 = 0x00000051, - eT_PCPLX64 = 0x00000151, - eT_PFCPLX64 = 0x00000251, - eT_PHCPLX64 = 0x00000351, - eT_32PCPLX64 = 0x00000451, - eT_32PFCPLX64 = 0x00000551, - eT_64PCPLX64 = 0x00000651, - - eT_CPLX80 = 0x00000052, - eT_PCPLX80 = 0x00000152, - eT_PFCPLX80 = 0x00000252, - eT_PHCPLX80 = 0x00000352, - eT_32PCPLX80 = 0x00000452, - eT_32PFCPLX80 = 0x00000552, - eT_64PCPLX80 = 0x00000652, - - eT_CPLX128 = 0x00000053, - eT_PCPLX128 = 0x00000153, - eT_PFCPLX128 = 0x00000253, - eT_PHCPLX128 = 0x00000353, - eT_32PCPLX128 = 0x00000453, - eT_32PFCPLX128 = 0x00000553, - eT_64PCPLX128 = 0x00000653, - - eT_BOOL08 = 0x00000030, - eT_PBOOL08 = 0x00000130, - eT_PFBOOL08 = 0x00000230, - eT_PHBOOL08 = 0x00000330, - eT_32PBOOL08 = 0x00000430, - eT_32PFBOOL08 = 0x00000530, - eT_64PBOOL08 = 0x00000630, - - eT_BOOL16 = 0x00000031, - eT_PBOOL16 = 0x00000131, - eT_PFBOOL16 = 0x00000231, - eT_PHBOOL16 = 0x00000331, - eT_32PBOOL16 = 0x00000431, - eT_32PFBOOL16 = 0x00000531, - eT_64PBOOL16 = 0x00000631, - - eT_BOOL32 = 0x00000032, - eT_PBOOL32 = 0x00000132, - eT_PFBOOL32 = 0x00000232, - eT_PHBOOL32 = 0x00000332, - eT_32PBOOL32 = 0x00000432, - eT_32PFBOOL32 = 0x00000532, - eT_64PBOOL32 = 0x00000632, - - eT_BOOL64 = 0x00000033, - eT_PBOOL64 = 0x00000133, - eT_PFBOOL64 = 0x00000233, - eT_PHBOOL64 = 0x00000333, - eT_32PBOOL64 = 0x00000433, - eT_32PFBOOL64 = 0x00000533, - eT_64PBOOL64 = 0x00000633, - - eT_NCVPTR = 0x000001F0, - eT_FCVPTR = 0x000002F0, - eT_HCVPTR = 0x000003F0, - eT_32NCVPTR = 0x000004F0, - eT_32FCVPTR = 0x000005F0, - eT_64NCVPTR = 0x000006F0, -} EBASE_TYPES; - -typedef enum { - eNEAR_C = 0x00000000, - eFAR_C = 0x00000001, - eNEAR_PASCAL = 0x00000002, - eFAR_PASCAL = 0x00000003, - eNEAR_FAST = 0x00000004, - eFAR_FAST = 0x00000005, - eSKIPPED = 0x00000006, - eNEAR_STD = 0x00000007, - eFAR_STD = 0x00000008, - eNEAR_SYS = 0x00000009, - eFAR_SYS = 0x0000000A, - eTHISCALL = 0x0000000B, - eMIPSCALL = 0x0000000C, - eGENERIC = 0x0000000D, - eALPHACALL = 0x0000000E, - ePPCCALL = 0x0000000F, - eSHCALL = 0x00000010, - eARMCALL = 0x00000011, - eAM33CALL = 0x00000012, - eTRICALL = 0x00000013, - eSH5CALL = 0x00000014, - eM32RCALL = 0x00000015, - eRESERVED = 0x00000016, - eMAX_CV_CALL -} ECV_CALL; - -typedef union { - struct { - ut8 scoped: 1; - ut8 reserved: 7; // swapped - ut8 packed: 1; - ut8 ctor: 1; - ut8 ovlops: 1; - ut8 isnested: 1; - ut8 cnested: 1; - ut8 opassign: 1; - ut8 opcast: 1; - ut8 fwdref: 1; - } bits; - ut16 cv_property; -} UCV_PROPERTY; - -typedef enum { - eMTvanilla = 0x00, - eMTvirtual = 0x01, - eMTstatic = 0x02, - eMTfriend = 0x03, - eMTintro = 0x04, - eMTpurevirt = 0x05, - eMTpureintro = 0x06, - eMT_MAX -} EMPROP; - -typedef enum { - ePrivate = 1, - eProtected = 2, - ePublic = 3, - eAccessMax -} EACCESS; - -//### CodeView bitfields and enums -//# NOTE: Construct assumes big-endian -//# ordering for BitStructs -typedef union { - struct { - ut8 access: 2; - ut8 mprop: 3; - ut8 pseudo: 1; - ut8 noinherit: 1; - ut8 noconstruct: 1; - ut8 padding: 7; - ut8 compgenx: 1; - } bits; - ut16 fldattr; -} UCV_fldattr; - -R_PACKED ( - typedef struct { - ut32 return_type; - ECV_CALL call_conv; - ut8 reserved; - ut16 parm_count; - ut32 arg_list; - ut8 pad; - }) SLF_PROCEDURE; - - R_PACKED( - typedef struct { - ut32 return_type; - ut32 class_type; - ut32 this_type; - ECV_CALL call_conv; // 1 byte - ut8 reserved; - ut16 parm_count; - ut32 arglist; - st32 this_adjust; - ut8 pad; - }) -SLF_MFUNCTION; - -R_PACKED ( - typedef struct { - ut32 count; - ut32 *arg_type; - ut8 pad; - }) SLF_ARGLIST; - - R_PACKED( - typedef struct { - ut32 modified_type; - union { - struct { - ut8 pad2: 8; - ut8 const_: 1; - ut8 volatile_: 1; - ut8 unaligned: 1; - ut8 pad1: 5; - } bits; - ut16 modifier; - } umodifier; - ut8 pad; - }) -SLF_MODIFIER; - -typedef enum { - ePTR_MODE_PTR = 0x00000000, - ePTR_MODE_REF = 0x00000001, - ePTR_MODE_PMEM = 0x00000002, - ePTR_MODE_PMFUNC = 0x00000003, - ePTR_MODE_RESERVED = 0x00000004, - eModeMax -} EMode; - -typedef enum { - ePTR_NEAR = 0x00000000, - ePTR_FAR = 0x00000001, - ePTR_HUGE = 0x00000002, - ePTR_BASE_SEG = 0x00000003, - ePTR_BASE_VAL = 0x00000004, - ePTR_BASE_SEGVAL = 0x00000005, - ePTR_BASE_ADDR = 0x00000006, - ePTR_BASE_SEGADDR = 0x00000007, - ePTR_BASE_TYPE = 0x00000008, - ePTR_BASE_SELF = 0x00000009, - ePTR_NEAR32 = 0x0000000A, - ePTR_FAR32 = 0x0000000B, - ePTR_64 = 0x0000000C, - ePTR_UNUSEDPTR = 0x0000000D, - eTypeMax -} EType; - -R_PACKED ( - typedef union { - struct { - ut8 pad[2]; - ut8 flat32: 1; - ut8 volatile_: 1; - ut8 const_: 1; - ut8 unaligned: 1; - ut8 restrict_: 1; - ut8 pad1: 3; - ut8 type: 5; - ut8 mode: 3; - } bits; - ut32 ptr_attr; - }) UPTR_ATTR; - - R_PACKED( - typedef struct { - ut32 utype; - UPTR_ATTR ptr_attr; - ut8 pad; - }) -SLF_POINTER; - -R_PACKED ( - typedef struct { - st32 stream_size; - st32 num_pages; - ut8 *stream_pages; - }) SPage; - - typedef struct { - // FILE *fp; - RBuffer *buf; - int *pages; - int pages_amount; - int indx; - int page_size; - int size; - R_STREAM_FILE stream_file; - // int fast_load; - // ... parent; - - free_func free_; - } R_PDB_STREAM; - - typedef struct R_PDB7_ROOT_STREAM { - R_PDB_STREAM pdb_stream; - int num_streams; - RList *streams_list; - } R_PDB7_ROOT_STREAM; - - typedef enum EStream_ { - ePDB_STREAM_ROOT = 0, // PDB_ROOT_DIRECTORY - ePDB_STREAM_PDB, // PDB STREAM INFO - ePDB_STREAM_TPI, // TYPE INFO - ePDB_STREAM_DBI, // DEBUG INFO - - ePDB_STREAM_GSYM, - ePDB_STREAM_SECT_HDR, - ePDB_STREAM_SECT__HDR_ORIG, - ePDB_STREAM_OMAP_TO_SRC, - ePDB_STREAM_OMAP_FROM_SRC, - ePDB_STREAM_FPO, - ePDB_STREAM_FPO_NEW, - ePDB_STREAM_XDATA, - ePDB_STREAM_PDATA, - ePDB_STREAM_TOKEN_RID_MAP, - ePDB_STREAM_MAX - } EStream; - - typedef void (*f_load) (void *parsed_pdb_stream, R_STREAM_FILE *stream); - - typedef struct { - R_PDB_STREAM *pdb_stream; - f_load load; - } SParsedPDBStream; - - R_PACKED( - typedef struct { - char *name; - ut32 size; - }) -SCString; - -R_PACKED ( - typedef struct { - SCString name; - }) SNoVal; - - R_PACKED( - typedef struct { - char value; - SCString name; - }) -SVal_LF_CHAR; - -R_PACKED ( - typedef struct { - st16 value; - SCString name; - }) SVal_LF_SHORT; - - R_PACKED( - typedef struct { - ut16 value; - SCString name; - }) -SVal_LF_USHORT; - -typedef struct { - st32 value; - SCString name; -} SVal_LF_LONG; - -typedef struct { - ut32 value; - SCString name; -} SVal_LF_ULONG; - -typedef struct { - st64 value; - SCString name; -} SVal_LF_QUADWORD; - -typedef struct { - ut64 value; - SCString name; -} SVal_LF_UQUADWORD; - -R_PACKED ( - typedef struct { - ut16 value_or_type; - void *name_or_val; - }) SVal; - - R_PACKED( - typedef struct { - ut32 element_type; - ut32 index_type; - SVal size; - ut8 pad; - }) -SLF_ARRAY; - -R_PACKED ( - typedef struct { - ut16 count; - UCV_PROPERTY prop; - ut32 field_list; - ut32 derived; - ut32 vshape; - SVal size; - ut8 pad; - }) SLF_STRUCTURE, SLF_CLASS; - - R_PACKED( - typedef struct { - ut16 count; - UCV_PROPERTY prop; - ut32 field_list; - SVal size; - ut32 pad; - }) -SLF_UNION; - -R_PACKED ( - typedef struct { - ut32 base_type; - ut8 length; - ut8 position; - ut8 pad; - }) SLF_BITFIELD; - - R_PACKED( - typedef struct { - ut16 count; - char *vt_descriptors; - ut8 pad; - }) -SLF_VTSHAPE; - -R_PACKED ( - typedef struct { - ut16 count; - UCV_PROPERTY prop; - ut32 utype; - ut32 field_list; - SCString name; - ut8 pad; - }) SLF_ENUM; - - R_PACKED( - typedef struct { - UCV_fldattr fldattr; - SVal enum_value; - ut8 pad; - - free_func free_; - }) -SLF_ENUMERATE; - -R_PACKED ( - typedef struct { - ut16 pad; - ut32 index; - SCString name; - - free_func free_; - }) SLF_NESTTYPE; - - R_PACKED( - typedef struct { - ut16 count; - ut32 mlist; - SCString name; - ut8 pad; - - free_func free_; - }) -SLF_METHOD; - -R_PACKED ( - typedef struct { - UCV_fldattr fldattr; - ut32 index; - SVal offset; - ut8 pad; - - // TODO: remove free_ - free_func free_; - }) SLF_MEMBER; - - R_PACKED( - typedef struct { - ut32 val; - SCString str_data; - }) -SLF_ONEMETHOD_VAL; - -R_PACKED ( - typedef struct { - UCV_fldattr fldattr; - ut32 index; - SLF_ONEMETHOD_VAL val; - ut8 pad; - }) SLF_ONEMETHOD; - - typedef struct { - // ELeafType leaf_type; - RList *substructs; - } SLF_FIELDLIST; - - typedef struct { - st32 off; - st32 cb; - } SOffCb; - - typedef struct { - st16 sn; - st16 padding; - st32 hash_key; - st32 buckets; - SOffCb hash_vals; - SOffCb ti_off; - SOffCb hash_adj; - } STPI; - - typedef struct { - ut32 version; - st32 hdr_size; - ut32 ti_min; - ut32 ti_max; - ut32 follow_size; - STPI tpi; - } STPIHeader; - - typedef enum { - eLF_MODIFIER_16t = 0x00000001, - eLF_POINTER_16t = 0x00000002, - eLF_ARRAY_16t = 0x00000003, - eLF_CLASS_16t = 0x00000004, - eLF_STRUCTURE_16t = 0x00000005, - eLF_UNION_16t = 0x00000006, - eLF_ENUM_16t = 0x00000007, - eLF_PROCEDURE_16t = 0x00000008, - eLF_MFUNCTION_16t = 0x00000009, - eLF_VTSHAPE = 0x0000000A, - eLF_COBOL0_16t = 0x0000000B, - eLF_COBOL1 = 0x0000000C, - eLF_BARRAY_16t = 0x0000000D, - eLF_LABEL = 0x0000000E, - eLF_NULL = 0x0000000F, - eLF_NOTTRAN = 0x00000010, - eLF_DIMARRAY_16t = 0x00000011, - eLF_VFTPATH_16t = 0x00000012, - eLF_PRECOMP_16t = 0x00000013, - eLF_ENDPRECOMP = 0x00000014, - eLF_OEM_16t = 0x00000015, - eLF_TYPESERVER_ST = 0x00000016, - eLF_SKIP_16t = 0x00000200, - eLF_ARGLIST_16t = 0x00000201, - eLF_DEFARG_16t = 0x00000202, - eLF_LIST = 0x00000203, - eLF_FIELDLIST_16t = 0x00000204, - eLF_DERIVED_16t = 0x00000205, - eLF_BITFIELD_16t = 0x00000206, - eLF_METHODLIST_16t = 0x00000207, - eLF_DIMCONU_16t = 0x00000208, - eLF_DIMCONLU_16t = 0x00000209, - eLF_DIMVARU_16t = 0x0000020A, - eLF_DIMVARLU_16t = 0x0000020B, - eLF_REFSYM = 0x0000020C, - eLF_BCLASS_16t = 0x00000400, - eLF_VBCLASS_16t = 0x00000401, - eLF_IVBCLASS_16t = 0x00000402, - eLF_ENUMERATE_ST = 0x00000403, - eLF_FRIENDFCN_16t = 0x00000404, - eLF_INDEX_16t = 0x00000405, - eLF_MEMBER_16t = 0x00000406, - eLF_STMEMBER_16t = 0x00000407, - eLF_METHOD_16t = 0x00000408, - eLF_NESTTYPE_16t = 0x00000409, - eLF_VFUNCTAB_16t = 0x0000040A, - eLF_FRIENDCLS_16t = 0x0000040B, - eLF_ONEMETHOD_16t = 0x0000040C, - eLF_VFUNCOFF_16t = 0x0000040D, - eLF_TI16_MAX = 0x00001000, - eLF_MODIFIER = 0x00001001, - eLF_POINTER = 0x00001002, - eLF_ARRAY_ST = 0x00001003, - eLF_CLASS_ST = 0x00001004, - eLF_STRUCTURE_ST = 0x00001005, - eLF_UNION_ST = 0x00001006, - eLF_ENUM_ST = 0x00001007, - eLF_PROCEDURE = 0x00001008, - eLF_MFUNCTION = 0x00001009, - eLF_COBOL0 = 0x0000100A, - eLF_BARRAY = 0x0000100B, - eLF_DIMARRAY_ST = 0x0000100C, - eLF_VFTPATH = 0x0000100D, - eLF_PRECOMP_ST = 0x0000100E, - eLF_OEM = 0x0000100F, - eLF_ALIAS_ST = 0x00001010, - eLF_OEM2 = 0x00001011, - eLF_SKIP = 0x00001200, - eLF_ARGLIST = 0x00001201, - eLF_DEFARG_ST = 0x00001202, - eLF_FIELDLIST = 0x00001203, - eLF_DERIVED = 0x00001204, - eLF_BITFIELD = 0x00001205, - eLF_METHODLIST = 0x00001206, - eLF_DIMCONU = 0x00001207, - eLF_DIMCONLU = 0x00001208, - eLF_DIMVARU = 0x00001209, - eLF_DIMVARLU = 0x0000120A, - eLF_BCLASS = 0x00001400, - eLF_VBCLASS = 0x00001401, - eLF_IVBCLASS = 0x00001402, - eLF_FRIENDFCN_ST = 0x00001403, - eLF_INDEX = 0x00001404, - eLF_MEMBER_ST = 0x00001405, - eLF_STMEMBER_ST = 0x00001406, - eLF_METHOD_ST = 0x00001407, - eLF_NESTTYPE_ST = 0x00001408, - eLF_VFUNCTAB = 0x00001409, - eLF_FRIENDCLS = 0x0000140A, - eLF_ONEMETHOD_ST = 0x0000140B, - eLF_VFUNCOFF = 0x0000140C, - eLF_NESTTYPEEX_ST = 0x0000140D, - eLF_MEMBERMODIFY_ST = 0x0000140E, - eLF_MANAGED_ST = 0x0000140F, - eLF_ST_MAX = 0x00001500, - eLF_TYPESERVER = 0x00001501, - eLF_ENUMERATE = 0x00001502, - eLF_ARRAY = 0x00001503, - eLF_CLASS = 0x00001504, - eLF_STRUCTURE = 0x00001505, - eLF_UNION = 0x00001506, - eLF_ENUM = 0x00001507, - eLF_DIMARRAY = 0x00001508, - eLF_PRECOMP = 0x00001509, - eLF_ALIAS = 0x0000150A, - eLF_DEFARG = 0x0000150B, - eLF_FRIENDFCN = 0x0000150C, - eLF_MEMBER = 0x0000150D, - eLF_STMEMBER = 0x0000150E, - eLF_METHOD = 0x0000150F, - eLF_NESTTYPE = 0x00001510, - eLF_ONEMETHOD = 0x00001511, - eLF_NESTTYPEEX = 0x00001512, - eLF_MEMBERMODIFY = 0x00001513, - eLF_MANAGED = 0x00001514, - eLF_TYPESERVER2 = 0x00001515, - eLF_CHAR = 0x00008000, - eLF_SHORT = 0x00008001, - eLF_USHORT = 0x00008002, - eLF_LONG = 0x00008003, - eLF_ULONG = 0x00008004, - eLF_REAL32 = 0x00008005, - eLF_REAL64 = 0x00008006, - eLF_REAL80 = 0x00008007, - eLF_REAL128 = 0x00008008, - eLF_QUADWORD = 0x00008009, - eLF_UQUADWORD = 0x0000800A, - eLF_REAL48 = 0x0000800B, - eLF_COMPLEX32 = 0x0000800C, - eLF_COMPLEX64 = 0x0000800D, - eLF_COMPLEX80 = 0x0000800E, - eLF_COMPLEX128 = 0x0000800F, - eLF_VARSTRING = 0x00008010, - eLF_OCTWORD = 0x00008017, - eLF_UOCTWORD = 0x00008018, - eLF_DECIMAL = 0x00008019, - eLF_DATE = 0x0000801A, - eLF_UTF8STRING = 0x0000801B, - eLF_PAD0 = 0x000000F0, - eLF_PAD1 = 0x000000F1, - eLF_PAD2 = 0x000000F2, - eLF_PAD3 = 0x000000F3, - eLF_PAD4 = 0x000000F4, - eLF_PAD5 = 0x000000F5, - eLF_PAD6 = 0x000000F6, - eLF_PAD7 = 0x000000F7, - eLF_PAD8 = 0x000000F8, - eLF_PAD9 = 0x000000F9, - eLF_PAD10 = 0x000000FA, - eLF_PAD11 = 0x000000FB, - eLF_PAD12 = 0x000000FC, - eLF_PAD13 = 0x000000FD, - eLF_PAD14 = 0x000000FE, - eLF_PAD15 = 0x000000FF, - eLF_MAX = 0xFFFFFFFF - } ELeafType; - - R_PACKED( - typedef struct { - ELeafType leaf_type; - void *type_info; - - free_func free_; - get_value_name get_name; - get_value get_val; - get_value_name_len get_name_len; - get_member_list get_members; - get_arg_type_ get_arg_type; - get_element_type_ get_element_type; - get_index_type_ get_index_type; - get_base_type_ get_base_type; - get_derived_ get_derived; - get_vshape_ get_vshape; - get_utype_ get_utype; - get_return_type_ get_return_type; - get_class_type_ get_class_type; - get_this_type_ get_this_type; - get_arglist_ get_arglist; - get_index_ get_index; - get_mlist_ get_mlist; - get_modified_type_ get_modified_type; - get_value is_fwdref; - get_print_type_ get_print_type; - - }) -STypeInfo; - -R_PACKED ( - typedef struct { - ut16 length; - ut32 tpi_idx; - STypeInfo type_data; - - // free_func free_; - }) SType; - - typedef struct { - STPIHeader header; - RList *types; - - free_func free_; - } STpiStream; - - typedef struct { - ut32 data1; - ut16 data2; - ut16 data3; - ut8 data4[8]; - } SGUID; - - typedef struct { - ut32 version; - ut32 time_date_stamp; - ut32 age; - SGUID guid; - ut32 cb_names; - char *names; - - free_func free_; - } SPDBInfoStream/*D*/; - -// dbi stream structures start here - - typedef enum { - eIMAGE_FILE_MACHINE_UNKNOWN = 0x0, - eIMAGE_FILE_MACHINE_I386 = 0x014c, - eIMAGE_FILE_MACHINE_IA64 = 0x0200, - eIMAGE_FILE_MACHINE_AMD64 = 0x8664, - eMaxMachine - } EMachine; - - R_PACKED( - typedef struct { - ut16 section; - ut16 padding1; - st32 offset; - st32 size; - ut32 flags; - st32 module; - st16 padding2; - ut32 data_crc; - ut32 reloc_crc; - }) -SSymbolRange; - -R_PACKED ( - typedef struct { - ut32 opened; - SSymbolRange range; - ut16 flags; - st16 stream; - ut32 symSize; - ut32 oldLineSize; - ut32 lineSize; - st16 nSrcFiles; - st16 padding1; - ut32 offsets; - ut32 niSource; - ut32 niCompiler; - SCString modName; - SCString objName; - }) SDBIExHeader; - - R_PACKED( - typedef struct { - st16 sn_fpo; - st16 sn_exception; - st16 sn_fixup; - st16 sn_omap_to_src; - st16 sn_omap_from_src; - st16 sn_section_hdr; - st16 sn_token_rid_map; - st16 sn_xdata; - st16 sn_pdata; - st16 sn_new_fpo; - st16 sn_section_hdr_orig; - }) -SDbiDbgHeader; - -R_PACKED ( - typedef struct { - ut32 magic; - ut32 version; - ut32 age; - st16 gssymStream; - ut16 vers; - st16 pssymStream; - ut16 pdbver; - st16 symrecStream; - ut16 pdbver2; - ut32 module_size; - ut32 seccon_size; - ut32 secmap_size; - ut32 filinf_size; - ut32 tsmap_size; - ut32 mfc_index; - ut32 dbghdr_size; - ut32 ecinfo_size; - ut16 flags; - EMachine machine; // read just 2 bytes - ut32 resvd; - }) SDBIHeader; - - typedef struct { - SDBIHeader dbi_header; - SDbiDbgHeader dbg_header; - RList *dbiexhdrs; - - free_func free_; - } SDbiStream; -// end of dbi stream structures - -// start of FPO stream structures - typedef union { - struct { - ut8 cbRegs: 3; - ut8 fHashSEH: 1; - ut8 fUseBp: 1; - ut8 reserved: 1; - ut8 cbFrame: 2; - ut8 cbProlog: 8; - } bits; - ut16 bit_values; - } UBit_values; - - R_PACKED( - typedef struct { - ut32 ul_off_start; - ut32 cb_proc_size; - ut32 cdw_locals; - ut16 cdw_params; - UBit_values bit_values; - }) -SFPO_DATA; - -typedef struct { - RList *fpo_data_list; -} SFPOStream; - -typedef enum { - eSEH = 1, - eCPPEH = 2, - eFnStart = 4, - eFPO_DATA_FLAGS_MAX -} EFPO_DATA_FLAGS; - -R_PACKED ( - typedef struct { - ut32 ul_off_start; - ut32 cb_proc_size; - ut32 cdw_locals; - ut32 cdw_params; - ut32 max_stack; - ut32 programm_string_offset; - ut16 cb_prolog; - ut16 cb_save_regs; - EFPO_DATA_FLAGS flags; - }) SFPO_DATA_V2; - - typedef struct { - RList *fpo_data_list; - } SFPONewStream; -// end of FPO stream structures - -// GDATA structrens - typedef struct { - RList *globals_list; - } SGDATAStream; - - R_PACKED ( - typedef struct { - ut16 leaf_type; - ut32 symtype; - ut32 offset; - ut16 segment; - SCString name; - }) -SGlobal; -// end GDATA structures - -// PE stream structures -// TODO: Support 64bit addressing! -typedef union { - ut32 physical_address; - ut32 virtual_address; -} UMISC; - -#define PDB_SIZEOF_SECTION_NAME 8 - -R_PACKED ( - typedef struct { - char name[PDB_SIZEOF_SECTION_NAME]; - UMISC misc; - ut32 virtual_address; - ut32 size_of_raw_data; - ut32 pointer_to_raw_data; - ut32 pointer_to_relocations; - ut32 pointer_to_line_numbers; - ut16 number_of_relocations; - ut16 number_of_line_numbers; - ut32 charactestics; - }) SIMAGE_SECTION_HEADER; - - typedef struct { - RList *sections_hdrs; - } SPEStream; -// end PE stream structures - -// omap structures - typedef struct { - ut32 from; - ut32 to; - } SOmapEntry; - - typedef struct { - RList *omap_entries; - ut32 *froms; - } SOmapStream; -// end of omap structures - - typedef void (*parse_stream_) (void *stream, R_STREAM_FILE *stream_file); - - typedef struct { - int indx; - parse_stream_ parse_stream; - void *stream; - EStream type; - free_func free; - } SStreamParseFunc; - -#endif // PDB_TYPES_H \ No newline at end of file diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 07a325d..af5bb0d 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -561,7 +561,7 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR)) DEFS = @DEFS@ GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \ -DLOCALEDIR="\"$(localedir)\"" $(DEFS) \ - @RADARE_CFLAGS@ @LLVM_LDFLAGS@ + @LLVM_LDFLAGS@ # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory. GLOBAL_CFLAGS = $(MH_CFLAGS) @@ -614,7 +614,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF) $(ZLIB) \ $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \ $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \ $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) \ - @RADARE_LIBS@ @LLVM_LIBS@ + @LLVM_LIBS@ CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 index 06fd62b..571202c 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 @@ -12,350 +12,6 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 11 (pkg-config-0.29.1) - -dnl Copyright © 2004 Scott James Remnant . -dnl Copyright © 2012-2015 Dan Nicholson -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR - -dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, -dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], -dnl [DESCRIPTION], [DEFAULT]) -dnl ------------------------------------------ -dnl -dnl Prepare a "--with-" configure option using the lowercase -dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and -dnl PKG_CHECK_MODULES in a single macro. -AC_DEFUN([PKG_WITH_MODULES], -[ -m4_pushdef([with_arg], m4_tolower([$1])) - -m4_pushdef([description], - [m4_default([$5], [build with ]with_arg[ support])]) - -m4_pushdef([def_arg], [m4_default([$6], [auto])]) -m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) -m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) - -m4_case(def_arg, - [yes],[m4_pushdef([with_without], [--without-]with_arg)], - [m4_pushdef([with_without],[--with-]with_arg)]) - -AC_ARG_WITH(with_arg, - AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, - [AS_TR_SH([with_]with_arg)=def_arg]) - -AS_CASE([$AS_TR_SH([with_]with_arg)], - [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], - [auto],[PKG_CHECK_MODULES([$1],[$2], - [m4_n([def_action_if_found]) $3], - [m4_n([def_action_if_not_found]) $4])]) - -m4_popdef([with_arg]) -m4_popdef([description]) -m4_popdef([def_arg]) - -])dnl PKG_WITH_MODULES - -dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, -dnl [DESCRIPTION], [DEFAULT]) -dnl ----------------------------------------------- -dnl -dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES -dnl check._[VARIABLE-PREFIX] is exported as make variable. -AC_DEFUN([PKG_HAVE_WITH_MODULES], -[ -PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) - -AM_CONDITIONAL([HAVE_][$1], - [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) -])dnl PKG_HAVE_WITH_MODULES - -dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, -dnl [DESCRIPTION], [DEFAULT]) -dnl ------------------------------------------------------ -dnl -dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after -dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make -dnl and preprocessor variable. -AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], -[ -PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) - -AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], - [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) -])dnl PKG_HAVE_DEFINE_WITH_MODULES - # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/gdb/coffread.c b/gdb/coffread.c index 69786ab..e5334f2 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -44,8 +44,6 @@ #include "psymtab.h" #include "build-id.h" -#include "pdb.h" - /* The objfile we are currently reading. */ static struct objfile *coffread_objfile; @@ -635,9 +633,6 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) coff_symtab_read (reader, (long) symtab_offset, num_symbols, objfile); - /* Try reading additional symbols from PDB. */ - read_pdb(objfile, reader); - /* Install any minimal symbols that have been collected as the current minimal symbols for this objfile. */ @@ -733,8 +728,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) gdb_bfd_ref_ptr debug_bfd (try_load_pdb_bfd (objfile)); if (debug_bfd.get ()) { - //symbol_file_add_separate (debug_bfd.get (), debug_bfd->filename, - // symfile_flags, objfile); + symbol_file_add_separate (debug_bfd.get (), debug_bfd->filename, + symfile_flags, objfile); } } } diff --git a/gdb/configure b/gdb/configure index b6d28e9..89630c9 100755 --- a/gdb/configure +++ b/gdb/configure @@ -627,11 +627,6 @@ LLVM_LIBS LLVM_LDFLAGS LLVM_CXXFLAGS LLVM_CONFIG_FOUND -RADARE_LIBS -RADARE_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG GCORE_TRANSFORM_NAME GDB_TRANSFORM_NAME XSLTPROC @@ -937,12 +932,7 @@ MAKEINFO MAKEINFOFLAGS YACC YFLAGS -XMKMF -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -RADARE_CFLAGS -RADARE_LIBS' +XMKMF' ac_subdirs_all='testsuite gdbtk gdbserver' @@ -1682,14 +1672,6 @@ Some influential environment variables: This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. XMKMF Path to xmkmf, Makefile generator for X Window System - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - RADARE_CFLAGS - C compiler flags for RADARE, overriding pkg-config - RADARE_LIBS linker flags for RADARE, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -19029,218 +19011,6 @@ ac_config_files="$ac_config_files gcore" ac_config_files="$ac_config_files Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile" - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RADARE" >&5 -$as_echo_n "checking for RADARE... " >&6; } - -if test -n "$RADARE_CFLAGS"; then - pkg_cv_RADARE_CFLAGS="$RADARE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"r_bin r_util\""; } >&5 - ($PKG_CONFIG --exists --print-errors "r_bin r_util") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_RADARE_CFLAGS=`$PKG_CONFIG --cflags "r_bin r_util" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$RADARE_LIBS"; then - pkg_cv_RADARE_LIBS="$RADARE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"r_bin r_util\""; } >&5 - ($PKG_CONFIG --exists --print-errors "r_bin r_util") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_RADARE_LIBS=`$PKG_CONFIG --libs "r_bin r_util" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - RADARE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "r_bin r_util" 2>&1` - else - RADARE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "r_bin r_util" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$RADARE_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (r_bin r_util) were not met: - -$RADARE_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables RADARE_CFLAGS -and RADARE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables RADARE_CFLAGS -and RADARE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - RADARE_CFLAGS=$pkg_cv_RADARE_CFLAGS - RADARE_LIBS=$pkg_cv_RADARE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - # Extract the first word of "llvm-config", so it can be a program name with args. set dummy llvm-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/gdb/configure.ac b/gdb/configure.ac index 2c0d49f..a31faa5 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2233,8 +2233,6 @@ GDB_AC_TRANSFORM([gcore], [GCORE_TRANSFORM_NAME]) AC_CONFIG_FILES([gcore], [chmod +x gcore]) AC_CONFIG_FILES([Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile]) -PKG_CHECK_MODULES([RADARE], [r_bin r_util]) - AC_CHECK_PROG(LLVM_CONFIG_FOUND, llvm-config, yes) AS_IF([test x"$LLVM_CONFIG_FOUND" != x"yes"], [AC_MSG_ERROR([Please make sure llvm-config is in your PATH.])]) AC_SUBST([LLVM_CXXFLAGS], [$(llvm-config --cxxflags)]) diff --git a/gdb/pdb.c b/gdb/pdb.c index 5700690..cebe03c 100644 --- a/gdb/pdb.c +++ b/gdb/pdb.c @@ -1,32 +1,7 @@ -/* Includes code from radare2: - radare - LGPL - Copyright 2014 - inisider - (https://github.com/radareorg/radare2) */ - -/* - -HACK: Honestly, this whole thing is a hack: - -1. radare's PDB functions aren't great for external use, -2. few if any edge cases work, -3. we pretend our PDB symbols are minisyms, and -4. no tests. - -*/ - #include "pdb.h" extern const bfd_target pdb_vec; //from targets.c -//BEGIN HACK (conflicting symbols) -#undef QUIT - -#include - -#undef QUIT -#define QUIT maybe_quit () -#undef B_SET -//END HACK (conflicting symbols) - #include "objfiles.h" #include "gdb/fileio.h" @@ -45,118 +20,6 @@ extern "C" { #include "psympriv.h" -#include "bfd/pdb-types.h" - -struct find_section_by_name_args { - const char *name; - asection **resultp; -}; - -static void -find_section_by_name_filter (bfd *abfd, asection *sect, void *obj) -{ - (void) abfd; - - auto *args = (struct find_section_by_name_args *) obj; - - if (strcmp (sect->name, args->name) == 0) - *args->resultp = sect; -} - -static struct bfd_section * -section_by_name (const char *name, struct objfile *objfile) -{ - asection *sect = nullptr; - struct find_section_by_name_args args{}; - args.name = name; - args.resultp = § - bfd_map_over_sections (objfile->obfd, find_section_by_name_filter, &args); - return sect; -} - -static std::unique_ptr -get_r_pdb (const std::string & path) -{ - R_PDB pdb = {nullptr}; - if (std::ifstream (path).good ()) - { - if (init_pdb_parser (&pdb, path.c_str ())) - return std::make_unique (pdb); - } - else if (path.rfind ("target:", 0) == 0) - { - auto target = find_target_at (process_stratum); - if (!target) - { - return nullptr; - } - - void *buffer; - size_t length; - - { //begin read PDB into buffer - int errno; - - auto fd = target->fileio_open (nullptr, - path.c_str () + sizeof ("target:") - 1, - FILEIO_O_RDONLY, - 0 /* mode */, - true /* warn_if_slow */, - &errno); - - if (fd == -1) - { - return nullptr; - } - - struct stat st{}; - if (target->fileio_fstat (fd, &st, &errno) == -1) - { - return nullptr; - } - - length = st.st_size; - buffer = xmalloc (length); - - file_ptr pos = 0, bytes; - while (length > pos) - { - bytes = target->fileio_pread (fd, - (gdb_byte *) buffer + pos, - length - pos, - pos, - &errno); - if (bytes == 0) - { - break; - } - else if (bytes == -1) - { - xfree (buffer); - return nullptr; - } - else - { - pos += bytes; - } - } - assert (pos == length); - - target->fileio_close (fd, &errno); - } //end read PDB into buffer - - auto r_buffer = r_buf_new_with_bytes ((const ut8 *) buffer, length); - if (init_pdb_parser_with_buf (&pdb, r_buffer)) - { - xfree (buffer); - return std::make_unique (pdb); - } - - xfree (buffer); - } - return nullptr; -} - static gdb::optional get_codeview_pdb_path (objfile *objfile) { @@ -242,23 +105,6 @@ get_pdb_paths (struct objfile *objfile) return paths; } -static std::tuple, std::string> -load_pdb (objfile *objfile) -{ - auto paths = get_pdb_paths (objfile); - - if (paths.empty ()) return {nullptr, std::string ()}; - - for (auto & path : paths) - { - auto p = get_r_pdb (path); - if (p) - return {std::move (p), path}; - } - - return {nullptr, std::string ()}; -} - gdb_bfd_ref_ptr try_load_pdb_bfd (objfile *objfile) { @@ -285,94 +131,6 @@ try_load_pdb_bfd (objfile *objfile) return nullptr; } -void -read_pdb (struct objfile *objfile, minimal_symbol_reader & reader) -{ - std::unique_ptr pdb; - std::string pdb_path; - std::tie (pdb, pdb_path) = load_pdb (objfile); - - if (!pdb) - return; - - if (pdb->pdb_parse (pdb.get ())) - { - SStreamParseFunc *omap = nullptr, *sctns = nullptr, *sctns_orig = nullptr, *gsym = nullptr, *tmp; - SIMAGE_SECTION_HEADER *sctn_header; - SGDATAStream *gsym_data_stream; - SPEStream *pe_stream = nullptr; - SGlobal *gdata; - RListIter *it; - RList *l; - - l = pdb->pdb_streams2; - it = r_list_iterator (l); - while (r_list_iter_next (it)) - { - tmp = (SStreamParseFunc *) r_list_iter_get (it); - switch (tmp->type) - { - case ePDB_STREAM_SECT__HDR_ORIG: - sctns_orig = tmp; - break; - case ePDB_STREAM_SECT_HDR: - sctns = tmp; - break; - case ePDB_STREAM_OMAP_FROM_SRC: - omap = tmp; - break; - case ePDB_STREAM_GSYM: - gsym = tmp; - break; - default: - break; - } - } - if (!gsym) - { - eprintf ("There is no global symbols in current PDB.\n"); - return; - } - gsym_data_stream = (SGDATAStream *) gsym->stream; - if ((omap != nullptr) && (sctns_orig != nullptr)) - { - pe_stream = (SPEStream *) sctns_orig->stream; - } - else if (sctns) - { - pe_stream = (SPEStream *) sctns->stream; - } - if (!pe_stream) - { - return; - } - - printf_filtered (_("Reading symbols from %s...\n"), pdb_path.c_str ()); - - it = r_list_iterator (gsym_data_stream->globals_list); - while (r_list_iter_next (it)) - { - gdata = (SGlobal *) r_list_iter_get (it); - sctn_header = (SIMAGE_SECTION_HEADER *) r_list_get_n (pe_stream->sections_hdrs, - gdata->segment - 1); - if (sctn_header) - { - asection *sect = section_by_name (sctn_header->name, objfile); - - auto section = sect ? sect->index : -1; - auto section_address = sect ? bfd_section_vma (sect) : 0; - auto address = section_address + gdata->offset; - if (address == 0) - continue; //we don't want to record unresolved symbols or something? - auto type = mst_text; //FIXME - reader.record_with_info (gdata->name.name, address, type, section); - } - } - } - - pdb->finish_pdb_parse (pdb.get ()); -} - static void pdb_sym_new_init (objfile *objfile) { diff --git a/gdb/pdb.h b/gdb/pdb.h index f9b4f4b..aefdb9f 100644 --- a/gdb/pdb.h +++ b/gdb/pdb.h @@ -9,9 +9,6 @@ #include "minsyms.h" #include "gdb_bfd.h" -extern void -read_pdb (struct objfile *objfile, minimal_symbol_reader & reader); - extern gdb_bfd_ref_ptr try_load_pdb_bfd (objfile *objfile);