diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-07-21 21:16:57 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-07-21 21:16:57 +0800 |
commit | ba97180acd4251d3acf08530faa4a724af74abd3 (patch) | |
tree | b754952bd2d173df30bf9b629b05cc2d067e8b18 | |
parent | 98557ce83fc57736cc373c8065354b16db6a1c44 (diff) | |
download | mipsel-linux-android-4.8-ba97180acd4251d3acf08530faa4a724af74abd3.tar.gz |
Update mipsel-linux-android-4.8 to 4.8.3 (darwin-x86)android-wear-5.0.0_r1android-l-preview_r2lollipop-wear-releasel-preview
Taken from NDK r10. See previous commit for build instructions
Change-Id: I1da4e54c1c68f7a7d320ff7815d6f16ee0f699b0
158 files changed, 3562 insertions, 505 deletions
@@ -6,16 +6,16 @@ toolchain/cloog.git 98972d5434ffcb4d11d2c81a46600e9a1cda9110 toolchain/isl.git b05d4572958c5d497da793f3317084bab90c3033 add isl-0.11.1.tar.bz2 needed by GCC 4.8 with graphite toolchain/ppl.git 8ba1875b4c5341d902321761022a6d2a0b5b19a4 add ppl-1.0.tar.bz2 toolchain/expat.git 40172a0ae9d40a068f1e1a48ffcf6a1ccf765ed5 expat package for building gdb-7.3 -toolchain/binutils.git e0bca373a85fa71b89d9ea42370433b3c0499b9d [2.24] fix MIPS static executable segfault -toolchain/gcc.git 5cd97bdbf2d97af4b0e4301f5f2b6c2a4301baf9 Merge "[4.6] Fix missing _U, _L, etc" -toolchain/gdb.git f2bc219a53b01a6c7af0bbc564985dfda0173ca1 [7.3.x] Fix gdb print extreme fp number +toolchain/binutils.git 8390634fd5fb311f01b82ba35a8db4b40b983cc8 Update Binutils 2.24 to include mips32r6, mips64r6 and MSA changes. +toolchain/gcc.git 1a6666161c7e53383194203abfbe0367a804416f Merge "Fix mips64el-linux-android-4.9 build" +toolchain/gdb.git 24237bc8bc3001a82d6cd9685719c4679f721792 fix some build errors toolchain/python.git 0d4194853e08d3244931523470331c00dfb94863 Fix python build inc_dirs[] and lib_dirs[] for linux/darwin toolchain/perl.git 1121daca35c6c692602621eab28d4de19f0b347d Add -Dcc_as_ld to configure toolchain/mclinker.git 5fca8b9c9c671d6c01f428c00ca131e65042a9fd Merge upstream mclinker 2.7 toolchain/yasm.git 87c09baff80ca5bbe938392d8f320e621707f317 test commit -toolchain/clang.git (release_34) 98b5404931ab99eb6468387b598527764370b133 [3.4] Add -fpic for aarch64-linux-android by default +toolchain/clang.git (release_34) 93fb9b3846bf0de34125b9b556d73dbe88c0175a Backport of clang svn@r211688 toolchain/llvm.git (release_34) 4e3e3137a7d3c271f5190ac9ef8af7848e5f67e2 Fix missing change for expandVAArg. -toolchain/compiler-rt.git (release_34) b065fccd8ab47b4de4610093fb98514fc5df2362 Alias __aeabi_fcmpun to __unordsf2. -toolchain/clang.git (release_33) 260f965f1273cd0aa8a1270885519df8e6317062 [ndk] Fix diagnostics for C-style cast to function type. +toolchain/compiler-rt.git (release_34) 4f9b4718e8d836317c224955a1e87b7bb5252ae1 Update clear_cache to trunk@208591 +toolchain/clang.git (release_33) 605eefd99fed56bcb7dec02f2776908b1df91646 Align with new GCC options for x86 Android These changes are based on revision 211688 from clang 3.5 toolchain/llvm.git (release_33) 8609a3469a8126eb6fb99ff65906bcc20c272d95 [ndk] Fix createBranchWeights() assertions. toolchain/compiler-rt.git (release_33) c880feaaa8829681a025d29a33704c18e21e87e1 Misc fixes for compiler_rt diff --git a/bin/mipsel-linux-android-addr2line b/bin/mipsel-linux-android-addr2line Binary files differindex 19de2fb..4e89db9 100755 --- a/bin/mipsel-linux-android-addr2line +++ b/bin/mipsel-linux-android-addr2line diff --git a/bin/mipsel-linux-android-ar b/bin/mipsel-linux-android-ar Binary files differindex 9e16c0e..10f06de 100755 --- a/bin/mipsel-linux-android-ar +++ b/bin/mipsel-linux-android-ar diff --git a/bin/mipsel-linux-android-as b/bin/mipsel-linux-android-as Binary files differindex f3819cf..4f0621e 100755 --- a/bin/mipsel-linux-android-as +++ b/bin/mipsel-linux-android-as diff --git a/bin/mipsel-linux-android-c++filt b/bin/mipsel-linux-android-c++filt Binary files differindex a17cae0..c0f46d9 100755 --- a/bin/mipsel-linux-android-c++filt +++ b/bin/mipsel-linux-android-c++filt diff --git a/bin/mipsel-linux-android-cpp b/bin/mipsel-linux-android-cpp Binary files differindex 4b99027..19dd53d 100755 --- a/bin/mipsel-linux-android-cpp +++ b/bin/mipsel-linux-android-cpp diff --git a/bin/mipsel-linux-android-g++ b/bin/mipsel-linux-android-g++ Binary files differindex 79677e5..81a2c7d 100755 --- a/bin/mipsel-linux-android-g++ +++ b/bin/mipsel-linux-android-g++ diff --git a/bin/mipsel-linux-android-gcc b/bin/mipsel-linux-android-gcc Binary files differindex b115c88..ff5b515 100755 --- a/bin/mipsel-linux-android-gcc +++ b/bin/mipsel-linux-android-gcc diff --git a/bin/mipsel-linux-android-gcov b/bin/mipsel-linux-android-gcov Binary files differindex 84c49f6..97c664e 100755 --- a/bin/mipsel-linux-android-gcov +++ b/bin/mipsel-linux-android-gcov diff --git a/bin/mipsel-linux-android-gdb b/bin/mipsel-linux-android-gdb Binary files differindex e3ba04c..83db6b4 100755 --- a/bin/mipsel-linux-android-gdb +++ b/bin/mipsel-linux-android-gdb diff --git a/bin/mipsel-linux-android-gprof b/bin/mipsel-linux-android-gprof Binary files differindex eb05d4f..00b36b3 100755 --- a/bin/mipsel-linux-android-gprof +++ b/bin/mipsel-linux-android-gprof diff --git a/bin/mipsel-linux-android-ld.bfd b/bin/mipsel-linux-android-ld.bfd Binary files differindex 27e083e..209c150 100755 --- a/bin/mipsel-linux-android-ld.bfd +++ b/bin/mipsel-linux-android-ld.bfd diff --git a/bin/mipsel-linux-android-ld.mcld b/bin/mipsel-linux-android-ld.mcld Binary files differindex 8f2f743..a41346f 100755 --- a/bin/mipsel-linux-android-ld.mcld +++ b/bin/mipsel-linux-android-ld.mcld diff --git a/bin/mipsel-linux-android-nm b/bin/mipsel-linux-android-nm Binary files differindex 13d4482..75ae498 100755 --- a/bin/mipsel-linux-android-nm +++ b/bin/mipsel-linux-android-nm diff --git a/bin/mipsel-linux-android-objcopy b/bin/mipsel-linux-android-objcopy Binary files differindex b50f21f..40ad4f3 100755 --- a/bin/mipsel-linux-android-objcopy +++ b/bin/mipsel-linux-android-objcopy diff --git a/bin/mipsel-linux-android-objdump b/bin/mipsel-linux-android-objdump Binary files differindex 39e8bad..5bca331 100755 --- a/bin/mipsel-linux-android-objdump +++ b/bin/mipsel-linux-android-objdump diff --git a/bin/mipsel-linux-android-ranlib b/bin/mipsel-linux-android-ranlib Binary files differindex 2f294be..35de6be 100755 --- a/bin/mipsel-linux-android-ranlib +++ b/bin/mipsel-linux-android-ranlib diff --git a/bin/mipsel-linux-android-readelf b/bin/mipsel-linux-android-readelf Binary files differindex d43a026..2d0fcef 100755 --- a/bin/mipsel-linux-android-readelf +++ b/bin/mipsel-linux-android-readelf diff --git a/bin/mipsel-linux-android-size b/bin/mipsel-linux-android-size Binary files differindex 0e612be..307c714 100755 --- a/bin/mipsel-linux-android-size +++ b/bin/mipsel-linux-android-size diff --git a/bin/mipsel-linux-android-strings b/bin/mipsel-linux-android-strings Binary files differindex 3644fc6..21830b3 100755 --- a/bin/mipsel-linux-android-strings +++ b/bin/mipsel-linux-android-strings diff --git a/bin/mipsel-linux-android-strip b/bin/mipsel-linux-android-strip Binary files differindex d7924c6..2d2ca9c 100755 --- a/bin/mipsel-linux-android-strip +++ b/bin/mipsel-linux-android-strip diff --git a/include/gdb/jit-reader.h b/include/gdb/jit-reader.h new file mode 100644 index 0000000..e9599a2 --- /dev/null +++ b/include/gdb/jit-reader.h @@ -0,0 +1,346 @@ +/* JIT declarations for GDB, the GNU Debugger. + + Copyright (C) 2011-2014 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef GDB_JIT_READER_H +#define GDB_JIT_READER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Versioning information. See gdb_reader_funcs. */ + +#define GDB_READER_INTERFACE_VERSION 1 + +/* Readers must be released under a GPL compatible license. To + declare that the reader is indeed released under a GPL compatible + license, invoke the macro GDB_DECLARE_GPL_COMPATIBLE in a source + file. */ + +#ifdef __cplusplus +#define GDB_DECLARE_GPL_COMPATIBLE_READER \ + extern "C" { \ + extern int plugin_is_GPL_compatible (void); \ + extern int plugin_is_GPL_compatible (void) \ + { \ + return 0; \ + } \ + } + +#else + +#define GDB_DECLARE_GPL_COMPATIBLE_READER \ + extern int plugin_is_GPL_compatible (void); \ + extern int plugin_is_GPL_compatible (void) \ + { \ + return 0; \ + } + +#endif + +/* Represents an address on the target system. */ + +typedef unsigned long GDB_CORE_ADDR; + +/* Return status codes. */ + +enum gdb_status { + GDB_FAIL = 0, + GDB_SUCCESS = 1 +}; + +struct gdb_object; +struct gdb_symtab; +struct gdb_block; +struct gdb_symbol_callbacks; + +/* An array of these are used to represent a map from code addresses to line + numbers in the source file. */ + +struct gdb_line_mapping +{ + int line; + GDB_CORE_ADDR pc; +}; + +/* Create a new GDB code object. Each code object can have one or + more symbol tables, each representing a compiled source file. */ + +typedef struct gdb_object *(gdb_object_open) (struct gdb_symbol_callbacks *cb); + +/* The callback used to create new symbol table. CB is the + gdb_symbol_callbacks which the structure is part of. FILE_NAME is + an (optionally NULL) file name to associate with this new symbol + table. + + Returns a new instance to gdb_symtab that can later be passed to + gdb_block_new, gdb_symtab_add_line_mapping and gdb_symtab_close. */ + +typedef struct gdb_symtab *(gdb_symtab_open) (struct gdb_symbol_callbacks *cb, + struct gdb_object *obj, + const char *file_name); + +/* Creates a new block in a given symbol table. A symbol table is a + forest of blocks, each block representing an code address range and + a corresponding (optionally NULL) NAME. In case the block + corresponds to a function, the NAME passed should be the name of + the function. + + If the new block to be created is a child of (i.e. is nested in) + another block, the parent block can be passed in PARENT. SYMTAB is + the symbol table the new block is to belong in. BEGIN, END is the + code address range the block corresponds to. + + Returns a new instance of gdb_block, which, as of now, has no use. + Note that the gdb_block returned must not be freed by the + caller. */ + +typedef struct gdb_block *(gdb_block_open) (struct gdb_symbol_callbacks *cb, + struct gdb_symtab *symtab, + struct gdb_block *parent, + GDB_CORE_ADDR begin, + GDB_CORE_ADDR end, + const char *name); + +/* Adds a PC to line number mapping for the symbol table SYMTAB. + NLINES is the number of elements in LINES, each element + corresponding to one (PC, line) pair. */ + +typedef void (gdb_symtab_add_line_mapping) (struct gdb_symbol_callbacks *cb, + struct gdb_symtab *symtab, + int nlines, + struct gdb_line_mapping *lines); + +/* Close the symtab SYMTAB. This signals to GDB that no more blocks + will be opened on this symtab. */ + +typedef void (gdb_symtab_close) (struct gdb_symbol_callbacks *cb, + struct gdb_symtab *symtab); + + +/* Closes the gdb_object OBJ and adds the emitted information into + GDB's internal structures. Once this is done, the debug + information will be picked up and used; this will usually be the + last operation in gdb_read_debug_info. */ + +typedef void (gdb_object_close) (struct gdb_symbol_callbacks *cb, + struct gdb_object *obj); + +/* Reads LEN bytes from TARGET_MEM in the target's virtual address + space into GDB_BUF. + + Returns GDB_FAIL on failure, and GDB_SUCCESS on success. */ + +typedef enum gdb_status (gdb_target_read) (GDB_CORE_ADDR target_mem, + void *gdb_buf, int len); + +/* The list of callbacks that are passed to read. These callbacks are + to be used to construct the symbol table. The functions have been + described above. */ + +struct gdb_symbol_callbacks +{ + gdb_object_open *object_open; + gdb_symtab_open *symtab_open; + gdb_block_open *block_open; + gdb_symtab_close *symtab_close; + gdb_object_close *object_close; + + gdb_symtab_add_line_mapping *line_mapping_add; + gdb_target_read *target_read; + + /* For internal use by GDB. */ + void *priv_data; +}; + +/* Forward declaration. */ + +struct gdb_reg_value; + +/* A function of this type is used to free a gdb_reg_value. See the + comment on `free' in struct gdb_reg_value. */ + +typedef void (gdb_reg_value_free) (struct gdb_reg_value *); + +/* Denotes the value of a register. */ + +struct gdb_reg_value +{ + /* The size of the register in bytes. The reader need not set this + field. This will be set for (defined) register values being read + from GDB using reg_get. */ + int size; + + /* Set to non-zero if the value for the register is known. The + registers for which the reader does not call reg_set are also + assumed to be undefined */ + int defined; + + /* Since gdb_reg_value is a variable sized structure, it will + usually be allocated on the heap. This function is expected to + contain the corresponding "free" function. + + When a pointer to gdb_reg_value is being sent from GDB to the + reader (via gdb_unwind_reg_get), the reader is expected to call + this function (with the same gdb_reg_value as argument) once it + is done with the value. + + When the function sends the a gdb_reg_value to GDB (via + gdb_unwind_reg_set), it is expected to set this field to point to + an appropriate cleanup routine (or to NULL if no cleanup is + required). */ + gdb_reg_value_free *free; + + /* The value of the register. */ + unsigned char value[1]; +}; + +/* get_frame_id in gdb_reader_funcs is to return a gdb_frame_id + corresponding to the current frame. The registers corresponding to + the current frame can be read using reg_get. Calling get_frame_id + on a particular frame should return the same gdb_frame_id + throughout its lifetime (i.e. till before it gets unwound). One + way to do this is by having the CODE_ADDRESS point to the + function's first instruction and STACK_ADDRESS point to the value + of the stack pointer when entering the function. */ + +struct gdb_frame_id +{ + GDB_CORE_ADDR code_address; + GDB_CORE_ADDR stack_address; +}; + +/* Forward declaration. */ + +struct gdb_unwind_callbacks; + +/* Returns the value of a particular register in the current frame. + The current frame is the frame that needs to be unwound into the + outer (earlier) frame. + + CB is the struct gdb_unwind_callbacks * the callback belongs to. + REGNUM is the DWARF register number of the register that needs to + be unwound. + + Returns the gdb_reg_value corresponding to the register requested. + In case the value of the register has been optimized away or + otherwise unavailable, the defined flag in the returned + gdb_reg_value will be zero. */ + +typedef struct gdb_reg_value *(gdb_unwind_reg_get) + (struct gdb_unwind_callbacks *cb, int regnum); + +/* Sets the previous value of a particular register. REGNUM is the + (DWARF) register number whose value is to be set. VAL is the value + the register is to be set to. + + VAL is *not* copied, so the memory allocated to it cannot be + reused. Once GDB no longer needs the value, it is deallocated + using the FREE function (see gdb_reg_value). + + A register can also be "set" to an undefined value by setting the + defined in VAL to zero. */ + +typedef void (gdb_unwind_reg_set) (struct gdb_unwind_callbacks *cb, int regnum, + struct gdb_reg_value *val); + +/* This struct is passed to unwind in gdb_reader_funcs, and is to be + used to unwind the current frame (current being the frame whose + registers can be read using reg_get) into the earlier frame. The + functions have been described above. */ + +struct gdb_unwind_callbacks +{ + gdb_unwind_reg_get *reg_get; + gdb_unwind_reg_set *reg_set; + gdb_target_read *target_read; + + /* For internal use by GDB. */ + void *priv_data; +}; + +/* Forward declaration. */ + +struct gdb_reader_funcs; + +/* Parse the debug info off a block of memory, pointed to by MEMORY + (already copied to GDB's address space) and MEMORY_SZ bytes long. + The implementation has to use the functions in CB to actually emit + the parsed data into GDB. SELF is the same structure returned by + gdb_init_reader. + + Return GDB_FAIL on failure and GDB_SUCCESS on success. */ + +typedef enum gdb_status (gdb_read_debug_info) (struct gdb_reader_funcs *self, + struct gdb_symbol_callbacks *cb, + void *memory, long memory_sz); + +/* Unwind the current frame, CB is the set of unwind callbacks that + are to be used to do this. + + Return GDB_FAIL on failure and GDB_SUCCESS on success. */ + +typedef enum gdb_status (gdb_unwind_frame) (struct gdb_reader_funcs *self, + struct gdb_unwind_callbacks *cb); + +/* Return the frame ID corresponding to the current frame, using C to + read the current register values. See the comment on struct + gdb_frame_id. */ + +typedef struct gdb_frame_id (gdb_get_frame_id) (struct gdb_reader_funcs *self, + struct gdb_unwind_callbacks *c); + +/* Called when a reader is being unloaded. This function should also + free SELF, if required. */ + +typedef void (gdb_destroy_reader) (struct gdb_reader_funcs *self); + +/* Called when the reader is loaded. Must either return a properly + populated gdb_reader_funcs or NULL. The memory allocated for the + gdb_reader_funcs is to be managed by the reader itself (i.e. if it + is allocated from the heap, it must also be freed in + gdb_destroy_reader). */ + +extern struct gdb_reader_funcs *gdb_init_reader (void); + +/* Pointer to the functions which implement the reader's + functionality. The individual functions have been documented + above. + + None of the fields are optional. */ + +struct gdb_reader_funcs +{ + /* Must be set to GDB_READER_INTERFACE_VERSION. */ + int reader_version; + + /* For use by the reader. */ + void *priv_data; + + gdb_read_debug_info *read; + gdb_unwind_frame *unwind; + gdb_get_frame_id *get_frame_id; + gdb_destroy_reader *destroy; +}; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/lib/gcc/mipsel-linux-android/4.8/crtbegin.o b/lib/gcc/mipsel-linux-android/4.8/crtbegin.o Binary files differindex 0db3ecb..4ae444e 100644 --- a/lib/gcc/mipsel-linux-android/4.8/crtbegin.o +++ b/lib/gcc/mipsel-linux-android/4.8/crtbegin.o diff --git a/lib/gcc/mipsel-linux-android/4.8/crtbeginS.o b/lib/gcc/mipsel-linux-android/4.8/crtbeginS.o Binary files differindex 088658c..dc25ee7 100644 --- a/lib/gcc/mipsel-linux-android/4.8/crtbeginS.o +++ b/lib/gcc/mipsel-linux-android/4.8/crtbeginS.o diff --git a/lib/gcc/mipsel-linux-android/4.8/crtbeginT.o b/lib/gcc/mipsel-linux-android/4.8/crtbeginT.o Binary files differindex 0db3ecb..4ae444e 100644 --- a/lib/gcc/mipsel-linux-android/4.8/crtbeginT.o +++ b/lib/gcc/mipsel-linux-android/4.8/crtbeginT.o diff --git a/lib/gcc/mipsel-linux-android/4.8/crtend.o b/lib/gcc/mipsel-linux-android/4.8/crtend.o Binary files differindex 0ee3b39..52612e9 100644 --- a/lib/gcc/mipsel-linux-android/4.8/crtend.o +++ b/lib/gcc/mipsel-linux-android/4.8/crtend.o diff --git a/lib/gcc/mipsel-linux-android/4.8/crtendS.o b/lib/gcc/mipsel-linux-android/4.8/crtendS.o Binary files differindex 0ee3b39..52612e9 100644 --- a/lib/gcc/mipsel-linux-android/4.8/crtendS.o +++ b/lib/gcc/mipsel-linux-android/4.8/crtendS.o diff --git a/lib/gcc/mipsel-linux-android/4.8/crtfastmath.o b/lib/gcc/mipsel-linux-android/4.8/crtfastmath.o Binary files differindex 288a75e..d73cc49 100644 --- a/lib/gcc/mipsel-linux-android/4.8/crtfastmath.o +++ b/lib/gcc/mipsel-linux-android/4.8/crtfastmath.o diff --git a/lib/gcc/mipsel-linux-android/4.8/include-fixed/stdio.h b/lib/gcc/mipsel-linux-android/4.8/include-fixed/stdio.h deleted file mode 100644 index 6de467d..0000000 --- a/lib/gcc/mipsel-linux-android/4.8/include-fixed/stdio.h +++ /dev/null @@ -1,441 +0,0 @@ -/* DO NOT EDIT THIS FILE. - - It has been auto-edited by fixincludes from: - - "/tmp/ndk-User/build/toolchain/prefix/sysroot/usr/include/stdio.h" - - This had to be done to correct non-standard usages in the - original, manufacturer supplied header file. */ - -/* $OpenBSD: stdio.h,v 1.35 2006/01/13 18:10:09 miod Exp $ */ -/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Chris Torek. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)stdio.h 5.17 (Berkeley) 6/3/91 - */ - -#ifndef _STDIO_H_ -#define _STDIO_H_ - -#include <sys/cdefs.h> -#include <sys/types.h> - -/* __gnuc_va_list and size_t must be defined by stdio.h according to Posix */ -#define __need___va_list -#include <stdarg.h> - -/* note that this forces stddef.h to *only* define size_t */ -#define __need_size_t -#include <stddef.h> - -#define __need_NULL -#include <stddef.h> - -#define _FSTDIO /* Define for new stdio with functions. */ - -typedef off_t fpos_t; /* stdio file position type */ - -/* - * NB: to fit things in six character monocase externals, the stdio - * code uses the prefix `__s' for stdio objects, typically followed - * by a three-character attempt at a mnemonic. - */ - -/* stdio buffers */ -struct __sbuf { - unsigned char *_base; - int _size; -}; - -/* - * stdio state variables. - * - * The following always hold: - * - * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), - * _lbfsize is -_bf._size, else _lbfsize is 0 - * if _flags&__SRD, _w is 0 - * if _flags&__SWR, _r is 0 - * - * This ensures that the getc and putc macros (or inline functions) never - * try to write or read from a file that is in `read' or `write' mode. - * (Moreover, they can, and do, automatically switch from read mode to - * write mode, and back, on "r+" and "w+" files.) - * - * _lbfsize is used only to make the inline line-buffered output stream - * code as compact as possible. - * - * _ub, _up, and _ur are used when ungetc() pushes back more characters - * than fit in the current _bf, or when ungetc() pushes back a character - * that does not match the previous one in _bf. When this happens, - * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff - * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. - * - * NOTE: if you change this structure, you also need to update the - * std() initializer in findfp.c. - */ -typedef struct __sFILE { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - - /* operations */ - void *_cookie; /* cookie passed to io functions */ - int (*_close)(void *); - int (*_read)(void *, char *, int); - fpos_t (*_seek)(void *, fpos_t, int); - int (*_write)(void *, const char *, int); - - /* extension data, to avoid further ABI breakage */ - struct __sbuf _ext; - /* data for long sequences of ungetc() */ - unsigned char *_up; /* saved _p when _p is doing ungetc data */ - int _ur; /* saved _r when _r is counting ungetc data */ - - /* tricks to meet minimum requirements even when malloc() fails */ - unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ - unsigned char _nbuf[1]; /* guarantee a getc() buffer */ - - /* separate buffer for fgetln() when line crosses buffer boundary */ - struct __sbuf _lb; /* buffer for fgetln() */ - - /* Unix stdio files get aligned to block boundaries on fseek() */ - int _blksize; /* stat.st_blksize (may be != _bf._size) */ - fpos_t _offset; /* current lseek offset */ -} FILE; - -__BEGIN_DECLS -extern FILE __sF[]; -__END_DECLS - -#define __SLBF 0x0001 /* line buffered */ -#define __SNBF 0x0002 /* unbuffered */ -#define __SRD 0x0004 /* OK to read */ -#define __SWR 0x0008 /* OK to write */ - /* RD and WR are never simultaneously asserted */ -#define __SRW 0x0010 /* open for reading & writing */ -#define __SEOF 0x0020 /* found EOF */ -#define __SERR 0x0040 /* found error */ -#define __SMBF 0x0080 /* _buf is from malloc */ -#define __SAPP 0x0100 /* fdopen()ed in append mode */ -#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ -#define __SOPT 0x0400 /* do fseek() optimisation */ -#define __SNPT 0x0800 /* do not do fseek() optimisation */ -#define __SOFF 0x1000 /* set iff _offset is in fact correct */ -#define __SMOD 0x2000 /* true => fgetln modified _p text */ -#define __SALC 0x4000 /* allocate string space dynamically */ - -/* - * The following three definitions are for ANSI C, which took them - * from System V, which brilliantly took internal interface macros and - * made them official arguments to setvbuf(), without renaming them. - * Hence, these ugly _IOxxx names are *supposed* to appear in user code. - * - * Although numbered as their counterparts above, the implementation - * does not rely on this. - */ -#define _IOFBF 0 /* setvbuf should set fully buffered */ -#define _IOLBF 1 /* setvbuf should set line buffered */ -#define _IONBF 2 /* setvbuf should set unbuffered */ - -#define BUFSIZ 1024 /* size of buffer used by setbuf */ - -#define EOF (-1) - -/* - * FOPEN_MAX is a minimum maximum, and should be the number of descriptors - * that the kernel can provide without allocation of a resource that can - * fail without the process sleeping. Do not use this for anything. - */ -#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */ -#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */ - -/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ -#if __BSD_VISIBLE || __XPG_VISIBLE -#define P_tmpdir "/tmp/" -#endif -#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ -#define TMP_MAX 308915776 - -#ifndef SEEK_SET -#define SEEK_SET 0 /* set file offset to offset */ -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 /* set file offset to current plus offset */ -#endif -#ifndef SEEK_END -#define SEEK_END 2 /* set file offset to EOF plus offset */ -#endif - -#define stdin (&__sF[0]) -#define stdout (&__sF[1]) -#define stderr (&__sF[2]) - -/* - * Functions defined in ANSI C standard. - */ -__BEGIN_DECLS -void clearerr(FILE *); -int fclose(FILE *); -int feof(FILE *); -int ferror(FILE *); -int fflush(FILE *); -int fgetc(FILE *); -int fgetpos(FILE *, fpos_t *); -char *fgets(char *, int, FILE *); -FILE *fopen(const char *, const char *); -int fprintf(FILE *, const char *, ...); -int fputc(int, FILE *); -int fputs(const char *, FILE *); -size_t fread(void *, size_t, size_t, FILE *); -FILE *freopen(const char *, const char *, FILE *); -int fscanf(FILE *, const char *, ...); -int fseek(FILE *, long, int); -int fseeko(FILE *, off_t, int); -int fsetpos(FILE *, const fpos_t *); -long ftell(FILE *); -off_t ftello(FILE *); -size_t fwrite(const void *, size_t, size_t, FILE *); -int getc(FILE *); -int getchar(void); -char *gets(char *); -#if __BSD_VISIBLE && !defined(__SYS_ERRLIST) -#define __SYS_ERRLIST - -extern int sys_nerr; /* perror(3) external variables */ -extern char *sys_errlist[]; -#endif -void perror(const char *); -int printf(const char *, ...); -int putc(int, FILE *); -int putchar(int); -int puts(const char *); -int remove(const char *); -int rename(const char *, const char *); -void rewind(FILE *); -int scanf(const char *, ...); -void setbuf(FILE *, char *); -int setvbuf(FILE *, char *, int, size_t); -int sprintf(char *, const char *, ...); -int sscanf(const char *, const char *, ...); -FILE *tmpfile(void); -char *tmpnam(char *); -int ungetc(int, FILE *); -int vfprintf(FILE *, const char *, __gnuc_va_list); -int vprintf(const char *, __gnuc_va_list); -int vsprintf(char *, const char *, __gnuc_va_list); - -#if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE -int snprintf(char *, size_t, const char *, ...) - __attribute__((__format__ (printf, 3, 4))) - __attribute__((__nonnull__ (3))); -int vfscanf(FILE *, const char *, __gnuc_va_list) - __attribute__((__format__ (scanf, 2, 0))) - __attribute__((__nonnull__ (2))); -int vscanf(const char *, __gnuc_va_list) - __attribute__((__format__ (scanf, 1, 0))) - __attribute__((__nonnull__ (1))); -int vsnprintf(char *, size_t, const char *, __gnuc_va_list) - __attribute__((__format__ (printf, 3, 0))) - __attribute__((__nonnull__ (3))); -int vsscanf(const char *, const char *, __gnuc_va_list) - __attribute__((__format__ (scanf, 2, 0))) - __attribute__((__nonnull__ (2))); -#endif /* __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE */ - -__END_DECLS - - -/* - * Functions defined in POSIX 1003.1. - */ -#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE -#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */ -#define L_cuserid 9 /* size for cuserid(); UT_NAMESIZE + 1 */ - -__BEGIN_DECLS -#if 0 /* MISSING FROM BIONIC */ -char *ctermid(char *); -char *cuserid(char *); -#endif /* MISSING */ -FILE *fdopen(int, const char *); -int fileno(FILE *); - -#if (__POSIX_VISIBLE >= 199209) -int pclose(FILE *); -FILE *popen(const char *, const char *); -#endif - -#if __POSIX_VISIBLE >= 199506 -void flockfile(FILE *); -int ftrylockfile(FILE *); -void funlockfile(FILE *); - -/* - * These are normally used through macros as defined below, but POSIX - * requires functions as well. - */ -int getc_unlocked(FILE *); -int getchar_unlocked(void); -int putc_unlocked(int, FILE *); -int putchar_unlocked(int); -#endif /* __POSIX_VISIBLE >= 199506 */ - -#if __XPG_VISIBLE -char *tempnam(const char *, const char *); -#endif -__END_DECLS - -#endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */ - -/* - * Routines that are purely local. - */ -#if __BSD_VISIBLE -__BEGIN_DECLS -int asprintf(char **, const char *, ...) - __attribute__((__format__ (printf, 2, 3))) - __attribute__((__nonnull__ (2))); -char *fgetln(FILE *, size_t *); -int fpurge(FILE *); -int getw(FILE *); -int putw(int, FILE *); -void setbuffer(FILE *, char *, int); -int setlinebuf(FILE *); -int vasprintf(char **, const char *, __gnuc_va_list) - __attribute__((__format__ (printf, 2, 0))) - __attribute__((__nonnull__ (2))); -__END_DECLS - -/* - * Stdio function-access interface. - */ -__BEGIN_DECLS -FILE *funopen(const void *, - int (*)(void *, char *, int), - int (*)(void *, const char *, int), - fpos_t (*)(void *, fpos_t, int), - int (*)(void *)); -__END_DECLS -#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) -#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) -#endif /* __BSD_VISIBLE */ - -/* - * Functions internal to the implementation. - */ -__BEGIN_DECLS -int __srget(FILE *); -int __swbuf(int, FILE *); -__END_DECLS - -/* - * The __sfoo macros are here so that we can - * define function versions in the C library. - */ -#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) -#if defined(__GNUC__) -static __inline int __sputc(int _c, FILE *_p) { - if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) - return (*_p->_p++ = _c); - else - return (__swbuf(_c, _p)); -} -#else -/* - * This has been tuned to generate reasonable code on the vax using pcc. - */ -#define __sputc(c, p) \ - (--(p)->_w < 0 ? \ - (p)->_w >= (p)->_lbfsize ? \ - (*(p)->_p = (c)), *(p)->_p != '\n' ? \ - (int)*(p)->_p++ : \ - __swbuf('\n', p) : \ - __swbuf((int)(c), p) : \ - (*(p)->_p = (c), (int)*(p)->_p++)) -#endif - -#define __sfeof(p) (((p)->_flags & __SEOF) != 0) -#define __sferror(p) (((p)->_flags & __SERR) != 0) -#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) -#define __sfileno(p) ((p)->_file) - -#define feof(p) __sfeof(p) -#define ferror(p) __sferror(p) - -#ifndef _POSIX_THREADS -#define clearerr(p) __sclearerr(p) -#endif - -#if __POSIX_VISIBLE -#define fileno(p) __sfileno(p) -#endif - -#ifndef lint -#ifndef _POSIX_THREADS -#define getc(fp) __sgetc(fp) -#endif /* _POSIX_THREADS */ -#define getc_unlocked(fp) __sgetc(fp) -/* - * The macro implementations of putc and putc_unlocked are not - * fully POSIX compliant; they do not set errno on failure - */ -#if __BSD_VISIBLE -#ifndef _POSIX_THREADS -#define putc(x, fp) __sputc(x, fp) -#endif /* _POSIX_THREADS */ -#define putc_unlocked(x, fp) __sputc(x, fp) -#endif /* __BSD_VISIBLE */ -#endif /* lint */ - -#define getchar() getc(stdin) -#define putchar(x) putc(x, stdout) -#define getchar_unlocked() getc_unlocked(stdin) -#define putchar_unlocked(c) putc_unlocked(c, stdout) - -#ifdef _GNU_SOURCE -/* - * glibc defines dprintf(int, const char*, ...), which is poorly named - * and likely to conflict with locally defined debugging printfs - * fdprintf is a better name, and some programs that use fdprintf use a - * #define fdprintf dprintf for compatibility - */ -int fdprintf(int, const char*, ...); -int vfdprintf(int, const char*, __gnuc_va_list); -#endif /* _GNU_SOURCE */ - -#endif /* _STDIO_H_ */ diff --git a/lib/gcc/mipsel-linux-android/4.8/libgcc.a b/lib/gcc/mipsel-linux-android/4.8/libgcc.a Binary files differindex ae2e5f2..2a7b526 100644 --- a/lib/gcc/mipsel-linux-android/4.8/libgcc.a +++ b/lib/gcc/mipsel-linux-android/4.8/libgcc.a diff --git a/lib/gcc/mipsel-linux-android/4.8/libgcov.a b/lib/gcc/mipsel-linux-android/4.8/libgcov.a Binary files differindex 52d4a62..3d2e188 100644 --- a/lib/gcc/mipsel-linux-android/4.8/libgcov.a +++ b/lib/gcc/mipsel-linux-android/4.8/libgcov.a diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbegin.o b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbegin.o Binary files differindex ca86478..240ee68 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbegin.o +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbegin.o diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginS.o b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginS.o Binary files differindex 0228743..6cf01ad 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginS.o +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginS.o diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginT.o b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginT.o Binary files differindex ca86478..240ee68 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginT.o +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtbeginT.o diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtend.o b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtend.o Binary files differindex 1fc859b..b00bf2b 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtend.o +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtend.o diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtendS.o b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtendS.o Binary files differindex 1fc859b..b00bf2b 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtendS.o +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtendS.o diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtfastmath.o b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtfastmath.o Binary files differindex eb0e8d5..01fdf59 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtfastmath.o +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/crtfastmath.o diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcc.a b/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcc.a Binary files differindex 1dac957..7cab02c 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcc.a +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcc.a diff --git a/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcov.a b/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcov.a Binary files differindex 408694c..811d404 100644 --- a/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcov.a +++ b/lib/gcc/mipsel-linux-android/4.8/mips-r2/libgcov.a diff --git a/lib/libmipsel-unknown-linux-android-sim.a b/lib/libmipsel-unknown-linux-android-sim.a Binary files differindex 2496468..c68cd23 100644 --- a/lib/libmipsel-unknown-linux-android-sim.a +++ b/lib/libmipsel-unknown-linux-android-sim.a diff --git a/lib/x86_64/libiberty.a b/lib/x86_64/libiberty.a Binary files differindex 668110f..f94193c 100644 --- a/lib/x86_64/libiberty.a +++ b/lib/x86_64/libiberty.a diff --git a/libexec/gcc/mipsel-linux-android/4.8/cc1 b/libexec/gcc/mipsel-linux-android/4.8/cc1 Binary files differindex 1fafa89..8d02964 100755 --- a/libexec/gcc/mipsel-linux-android/4.8/cc1 +++ b/libexec/gcc/mipsel-linux-android/4.8/cc1 diff --git a/libexec/gcc/mipsel-linux-android/4.8/cc1plus b/libexec/gcc/mipsel-linux-android/4.8/cc1plus Binary files differindex 4443d70..9d6aa7f 100755 --- a/libexec/gcc/mipsel-linux-android/4.8/cc1plus +++ b/libexec/gcc/mipsel-linux-android/4.8/cc1plus diff --git a/libexec/gcc/mipsel-linux-android/4.8/collect2 b/libexec/gcc/mipsel-linux-android/4.8/collect2 Binary files differindex a235f30..7d247b4 100755 --- a/libexec/gcc/mipsel-linux-android/4.8/collect2 +++ b/libexec/gcc/mipsel-linux-android/4.8/collect2 diff --git a/libexec/gcc/mipsel-linux-android/4.8/lto-wrapper b/libexec/gcc/mipsel-linux-android/4.8/lto-wrapper Binary files differindex 0701893..865ef23 100755 --- a/libexec/gcc/mipsel-linux-android/4.8/lto-wrapper +++ b/libexec/gcc/mipsel-linux-android/4.8/lto-wrapper diff --git a/libexec/gcc/mipsel-linux-android/4.8/lto1 b/libexec/gcc/mipsel-linux-android/4.8/lto1 Binary files differindex e8ae7d7..d032560 100755 --- a/libexec/gcc/mipsel-linux-android/4.8/lto1 +++ b/libexec/gcc/mipsel-linux-android/4.8/lto1 diff --git a/libexec/gcc/mipsel-linux-android/4.8/plugin/gengtype b/libexec/gcc/mipsel-linux-android/4.8/plugin/gengtype Binary files differindex 1353272..6ab5625 100755 --- a/libexec/gcc/mipsel-linux-android/4.8/plugin/gengtype +++ b/libexec/gcc/mipsel-linux-android/4.8/plugin/gengtype diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.x b/mipsel-linux-android/lib/ldscripts/elf32btsmip.x index e78ba99..b4ca2b9 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.x +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.x @@ -9,7 +9,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xbn b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xbn index 3207516..3ec8ebe 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xbn +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xbn @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xc b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xc index d531fd1..2636c21 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xc +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xc @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xd b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xd index 184f0e1..2f49729 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xd +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xd @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdc b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdc index e478277..c8a7226 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdc +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdc @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdw b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdw index 366802c..3de03ea 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdw +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xdw @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xn b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xn index eee3cb4..39feb3c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xn +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xn @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xr b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xr index 8e121a0..ae675ed 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xr +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xr @@ -10,7 +10,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } - .reginfo 0 : { *(.reginfo) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } + .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } .hash 0 : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xs b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xs index 0e7bdd9..672c5bb 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xs +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xs @@ -7,7 +7,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsc b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsc index cd616ed..e55d4aa 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsc +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsc @@ -8,7 +8,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsw b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsw index 70b1a52..1ef97ad 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsw +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xsw @@ -7,7 +7,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xu b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xu index 16e3778..52dcd79 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xu +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xu @@ -10,7 +10,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } - .reginfo 0 : { *(.reginfo) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } + .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } .hash 0 : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xw b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xw index 0669a31..54725ec 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmip.xw +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmip.xw @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } .hash : { *(.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.x b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.x index f189625..45ab909 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.x +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.x @@ -9,6 +9,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xbn b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xbn index 587cb97..be9b5ae 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xbn +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xbn @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xc b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xc index 279b891..f4c0ff2 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xc +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xc @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xd b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xd index 1fc574c..220ee7e 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xd +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xd @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdc b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdc index bb65542..e8a10f3 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdc +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdc @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdw b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdw index 0bd27a2..61926ab 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdw +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xdw @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xn b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xn index f8732d0..8dc74f2 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xn +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xn @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xr b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xr index 2de0183..210b848 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xr +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xr @@ -10,6 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xs b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xs index 8bc90d5..b085424 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xs +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xs @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsc b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsc index 0b47e37..f563dfb 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsc +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsc @@ -8,6 +8,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsw b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsw index 72dade3..f00ac8a 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsw +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xsw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xu b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xu index 0814b66..bf8f2ad 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xu +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xu @@ -10,6 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xw b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xw index 6c7503c..01e8c12 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xw +++ b/mipsel-linux-android/lib/ldscripts/elf32btsmipn32.xw @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.x b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.x index 630f66f..3e33881 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.x +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.x @@ -9,7 +9,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xbn b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xbn index 4785dcb..90decdd 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xbn +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xbn @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xc b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xc index 67465bd..a5aa4db 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xc +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xc @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xd b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xd index 0826831..c99b40c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xd +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xd @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdc b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdc index b9f8e85..d79ca84 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdc +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdc @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdw b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdw index fffe393..27382b4 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdw +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xdw @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xn b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xn index 117eac0..4522f40 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xn +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xn @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xr b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xr index 46651ea..03b225c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xr +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xr @@ -10,7 +10,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } - .reginfo 0 : { *(.reginfo) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } + .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash 0 : { *(.hash) } .gnu.hash 0 : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xs b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xs index 771ecc4..c4aed2c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xs +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xs @@ -7,7 +7,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsc b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsc index ab72099..1167e40 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsc +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsc @@ -8,7 +8,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsw b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsw index bd0f10d..c8106f6 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsw +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xsw @@ -7,7 +7,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xu b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xu index bdf0d6f..6d7c426 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xu +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xu @@ -10,7 +10,8 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } - .reginfo 0 : { *(.reginfo) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } + .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash 0 : { *(.hash) } .gnu.hash 0 : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xw b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xw index b92d852..f15aa90 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xw +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmip.xw @@ -8,7 +8,8 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x80000); . = 0x80000 + SIZEOF_HEADERS; .interp : { *(.interp) } - .reginfo : { *(.reginfo) } + .MIPS.abiflags : { *(.MIPS.abiflags) } + .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.x b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.x index 55d8e0d..4a27754 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.x +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.x @@ -9,6 +9,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xbn b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xbn index b1f9087..c236d66 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xbn +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xbn @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xc b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xc index a1638b8..6bd3c4e 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xc +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xc @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xd b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xd index 01fbee8..083215e 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xd +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xd @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdc b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdc index 071e6b6..e847e7a 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdc +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdc @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdw b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdw index 6f2a2ed..daad54f 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdw +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xdw @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xn b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xn index d5fe360..4894d23 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xn +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xn @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xr b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xr index 8340d74..38b7b0e 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xr +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xr @@ -10,6 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xs b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xs index 9ebc371..5a6725a 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xs +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xs @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsc b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsc index b26e9cd..4f3b7f4 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsc +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsc @@ -8,6 +8,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsw b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsw index 73cddbc..52ed430 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsw +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xsw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xu b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xu index cfe9fcb..fdc9fc3 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xu +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xu @@ -10,6 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ .interp 0 : { *(.interp) } + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .reginfo 0 : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xw b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xw index 76a95fe..2a1ca83 100644 --- a/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xw +++ b/mipsel-linux-android/lib/ldscripts/elf32ltsmipn32.xw @@ -8,6 +8,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } + .MIPS.abiflags : { *(.MIPS.abiflags) } .reginfo : { *(.reginfo) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.x b/mipsel-linux-android/lib/ldscripts/elf64btsmip.x index 2d469cd..8d7d75c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.x +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.x @@ -8,6 +8,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xbn b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xbn index 60ebe5d..7bb664e 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xbn +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xbn @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xc b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xc index 117a43b..51db00f 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xc +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xc @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xd b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xd index 7a833af..85c97eb 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xd +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xd @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdc b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdc index aac84f3..cdebc8b 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdc +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdc @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdw b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdw index 440d77c..c5a93f6 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdw +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xdw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xn b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xn index 7fe02cc..c890fca 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xn +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xn @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xr b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xr index 9bf491a..d3cd14b 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xr +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xr @@ -9,6 +9,7 @@ OUTPUT_ARCH(mips) SECTIONS { /* Read-only sections, merged into text segment: */ + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xs b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xs index 30bc562..926588a 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xs +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xs @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsc b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsc index f09b2fd..380f25b 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsc +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsc @@ -8,6 +8,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsw b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsw index 3b219ca..5b2f3c4 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsw +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xsw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xu b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xu index 53803cd..9b0c967 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xu +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xu @@ -9,6 +9,7 @@ OUTPUT_ARCH(mips) SECTIONS { /* Read-only sections, merged into text segment: */ + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xw b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xw index 3da5347..362a683 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64btsmip.xw +++ b/mipsel-linux-android/lib/ldscripts/elf64btsmip.xw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.x b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.x index ee27fd0..14991e4 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.x +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.x @@ -8,6 +8,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xbn b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xbn index 3db7f56..d943779 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xbn +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xbn @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xc b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xc index 1047e03..ee693ab 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xc +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xc @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xd b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xd index 8dd98de..003d77c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xd +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xd @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdc b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdc index 5f1ada7..7402d13 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdc +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdc @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdw b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdw index 63b4a0e..d5515b3 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdw +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xdw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xn b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xn index de12b00..9fb968e 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xn +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xn @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xr b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xr index 0a5a9e4..245b06c 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xr +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xr @@ -9,6 +9,7 @@ OUTPUT_ARCH(mips) SECTIONS { /* Read-only sections, merged into text segment: */ + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xs b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xs index a03ac25..325230a 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xs +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xs @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsc b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsc index 72db9b9..03ca941 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsc +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsc @@ -8,6 +8,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsw b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsw index 694d0ca..ca97721 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsw +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xsw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = 0 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xu b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xu index 9172f14..d2f4653 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xu +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xu @@ -9,6 +9,7 @@ OUTPUT_ARCH(mips) SECTIONS { /* Read-only sections, merged into text segment: */ + .MIPS.abiflags 0 : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic 0 : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xw b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xw index 0419c03..b5a3abf 100644 --- a/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xw +++ b/mipsel-linux-android/lib/ldscripts/elf64ltsmip.xw @@ -7,6 +7,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = 0x120000000); . = 0x120000000 + SIZEOF_HEADERS; + .MIPS.abiflags : { *(.MIPS.abiflags) } .MIPS.options : { *(.MIPS.options) } .note.gnu.build-id : { *(.note.gnu.build-id) } .dynamic : { *(.dynamic) } diff --git a/mipsel-linux-android/lib/libatomic.a b/mipsel-linux-android/lib/libatomic.a Binary files differindex b2187ab..6d7da4f 100644 --- a/mipsel-linux-android/lib/libatomic.a +++ b/mipsel-linux-android/lib/libatomic.a diff --git a/mipsel-linux-android/lib/libgomp.a b/mipsel-linux-android/lib/libgomp.a Binary files differindex 87d7a5b..38eeaf3 100644 --- a/mipsel-linux-android/lib/libgomp.a +++ b/mipsel-linux-android/lib/libgomp.a diff --git a/mipsel-linux-android/lib/mips-r2/libatomic.a b/mipsel-linux-android/lib/mips-r2/libatomic.a Binary files differindex 05adf55..af64684 100644 --- a/mipsel-linux-android/lib/mips-r2/libatomic.a +++ b/mipsel-linux-android/lib/mips-r2/libatomic.a diff --git a/mipsel-linux-android/lib/mips-r2/libgomp.a b/mipsel-linux-android/lib/mips-r2/libgomp.a Binary files differindex 4b6e054..993a291 100644 --- a/mipsel-linux-android/lib/mips-r2/libgomp.a +++ b/mipsel-linux-android/lib/mips-r2/libgomp.a diff --git a/share/gdb/python/gdb/FrameDecorator.py b/share/gdb/python/gdb/FrameDecorator.py new file mode 100644 index 0000000..1bbc5ab --- /dev/null +++ b/share/gdb/python/gdb/FrameDecorator.py @@ -0,0 +1,302 @@ +# Copyright (C) 2013-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import gdb + +# This small code snippet deals with problem of strings in Python 2.x +# and Python 3.x. Python 2.x has str and unicode classes which are +# sub-classes of basestring. In Python 3.x all strings are encoded +# and basestring has been removed. +try: + basestring +except NameError: + basestring = str + +class FrameDecorator(object): + """Basic implementation of a Frame Decorator""" + + """ This base frame decorator decorates a frame or another frame + decorator, and provides convenience methods. If this object is + wrapping a frame decorator, defer to that wrapped object's method + if it has one. This allows for frame decorators that have + sub-classed FrameDecorator object, but also wrap other frame + decorators on the same frame to correctly execute. + + E.g + + If the result of frame filters running means we have one gdb.Frame + wrapped by multiple frame decorators, all sub-classed from + FrameDecorator, the resulting hierarchy will be: + + Decorator1 + -- (wraps) Decorator2 + -- (wraps) FrameDecorator + -- (wraps) gdb.Frame + + In this case we have two frame decorators, both of which are + sub-classed from FrameDecorator. If Decorator1 just overrides the + 'function' method, then all of the other methods are carried out + by the super-class FrameDecorator. But Decorator2 may have + overriden other methods, so FrameDecorator will look at the + 'base' parameter and defer to that class's methods. And so on, + down the chain.""" + + # 'base' can refer to a gdb.Frame or another frame decorator. In + # the latter case, the child class will have called the super + # method and _base will be an object conforming to the Frame Filter + # class. + def __init__(self, base): + self._base = base + + @staticmethod + def _is_limited_frame(frame): + """Internal utility to determine if the frame is special or + limited.""" + sal = frame.find_sal() + + if (not sal.symtab or not sal.symtab.filename + or frame.type() == gdb.DUMMY_FRAME + or frame.type() == gdb.SIGTRAMP_FRAME): + + return True + + return False + + def elided(self): + """Return any elided frames that this class might be + wrapping, or None.""" + if hasattr(self._base, "elided"): + return self._base.elided() + + return None + + def function(self): + """ Return the name of the frame's function or an address of + the function of the frame. First determine if this is a + special frame. If not, try to determine filename from GDB's + frame internal function API. Finally, if a name cannot be + determined return the address. If this function returns an + address, GDB will attempt to determine the function name from + its internal minimal symbols store (for example, for inferiors + without debug-info).""" + + # Both gdb.Frame, and FrameDecorator have a method called + # "function", so determine which object this is. + if not isinstance(self._base, gdb.Frame): + if hasattr(self._base, "function"): + # If it is not a gdb.Frame, and there is already a + # "function" method, use that. + return self._base.function() + + frame = self.inferior_frame() + + if frame.type() == gdb.DUMMY_FRAME: + return "<function called from gdb>" + elif frame.type() == gdb.SIGTRAMP_FRAME: + return "<signal handler called>" + + func = frame.function() + + # If we cannot determine the function name, return the + # address. If GDB detects an integer value from this function + # it will attempt to find the function name from minimal + # symbols via its own internal functions. + if func == None: + pc = frame.pc() + return pc + + return str(func) + + def address(self): + """ Return the address of the frame's pc""" + + if hasattr(self._base, "address"): + return self._base.address() + + frame = self.inferior_frame() + return frame.pc() + + def filename(self): + """ Return the filename associated with this frame, detecting + and returning the appropriate library name is this is a shared + library.""" + + if hasattr(self._base, "filename"): + return self._base.filename() + + frame = self.inferior_frame() + sal = frame.find_sal() + if not sal.symtab or not sal.symtab.filename: + pc = frame.pc() + return gdb.solib_name(pc) + else: + return sal.symtab.filename + + def frame_args(self): + """ Return an iterable of frame arguments for this frame, if + any. The iterable object contains objects conforming with the + Symbol/Value interface. If there are no frame arguments, or + if this frame is deemed to be a special case, return None.""" + + if hasattr(self._base, "frame_args"): + return self._base.frame_args() + + frame = self.inferior_frame() + if self._is_limited_frame(frame): + return None + + args = FrameVars(frame) + return args.fetch_frame_args() + + def frame_locals(self): + """ Return an iterable of local variables for this frame, if + any. The iterable object contains objects conforming with the + Symbol/Value interface. If there are no frame locals, or if + this frame is deemed to be a special case, return None.""" + + if hasattr(self._base, "frame_locals"): + return self._base.frame_locals() + + frame = self.inferior_frame() + if self._is_limited_frame(frame): + return None + + args = FrameVars(frame) + return args.fetch_frame_locals() + + def line(self): + """ Return line number information associated with the frame's + pc. If symbol table/line information does not exist, or if + this frame is deemed to be a special case, return None""" + + if hasattr(self._base, "line"): + return self._base.line() + + frame = self.inferior_frame() + if self._is_limited_frame(frame): + return None + + sal = frame.find_sal() + if (sal): + return sal.line + else: + return None + + def inferior_frame(self): + """ Return the gdb.Frame underpinning this frame decorator.""" + + # If 'base' is a frame decorator, we want to call its inferior + # frame method. If '_base' is a gdb.Frame, just return that. + if hasattr(self._base, "inferior_frame"): + return self._base.inferior_frame() + return self._base + +class SymValueWrapper(object): + """A container class conforming to the Symbol/Value interface + which holds frame locals or frame arguments.""" + def __init__(self, symbol, value): + self.sym = symbol + self.val = value + + def value(self): + """ Return the value associated with this symbol, or None""" + return self.val + + def symbol(self): + """ Return the symbol, or Python text, associated with this + symbol, or None""" + return self.sym + +class FrameVars(object): + + """Utility class to fetch and store frame local variables, or + frame arguments.""" + + def __init__(self, frame): + self.frame = frame + self.symbol_class = { + gdb.SYMBOL_LOC_STATIC: True, + gdb.SYMBOL_LOC_REGISTER: True, + gdb.SYMBOL_LOC_ARG: True, + gdb.SYMBOL_LOC_REF_ARG: True, + gdb.SYMBOL_LOC_LOCAL: True, + gdb.SYMBOL_LOC_REGPARM_ADDR: True, + gdb.SYMBOL_LOC_COMPUTED: True + } + + def fetch_b(self, sym): + """ Local utility method to determine if according to Symbol + type whether it should be included in the iterator. Not all + symbols are fetched, and only symbols that return + True from this method should be fetched.""" + + # SYM may be a string instead of a symbol in the case of + # synthetic local arguments or locals. If that is the case, + # always fetch. + if isinstance(sym, basestring): + return True + + sym_type = sym.addr_class + + return self.symbol_class.get(sym_type, False) + + def fetch_frame_locals(self): + """Public utility method to fetch frame local variables for + the stored frame. Frame arguments are not fetched. If there + are no frame local variables, return an empty list.""" + lvars = [] + + try: + block = self.frame.block() + except RuntimeError: + block = None + + while block != None: + if block.is_global or block.is_static: + break + for sym in block: + if sym.is_argument: + continue; + if self.fetch_b(sym): + lvars.append(SymValueWrapper(sym, None)) + + block = block.superblock + + return lvars + + def fetch_frame_args(self): + """Public utility method to fetch frame arguments for the + stored frame. Frame arguments are the only type fetched. If + there are no frame argument variables, return an empty list.""" + + args = [] + + try: + block = self.frame.block() + except RuntimeError: + block = None + + while block != None: + if block.function != None: + break + block = block.superblock + + if block != None: + for sym in block: + if not sym.is_argument: + continue; + args.append(SymValueWrapper(sym, None)) + + return args diff --git a/share/gdb/python/gdb/FrameIterator.py b/share/gdb/python/gdb/FrameIterator.py new file mode 100644 index 0000000..c99a91e --- /dev/null +++ b/share/gdb/python/gdb/FrameIterator.py @@ -0,0 +1,51 @@ +# Copyright (C) 2013-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import gdb +import itertools + +class FrameIterator(object): + """A gdb.Frame iterator. Iterates over gdb.Frames or objects that + conform to that interface.""" + + def __init__(self, frame_obj): + """Initialize a FrameIterator. + + Arguments: + frame_obj the starting frame.""" + + super(FrameIterator, self).__init__() + self.frame = frame_obj + + def __iter__(self): + return self + + def next(self): + """next implementation. + + Returns: + The next oldest frame.""" + + result = self.frame + if result is None: + raise StopIteration + self.frame = result.older() + return result + + # Python 3.x requires __next__(self) while Python 2.x requires + # next(self). Define next(self), and for Python 3.x create this + # wrapper. + def __next__(self): + return self.next() diff --git a/share/gdb/python/gdb/__init__.py b/share/gdb/python/gdb/__init__.py index 43975c2..95a76c2 100644 --- a/share/gdb/python/gdb/__init__.py +++ b/share/gdb/python/gdb/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,6 +13,114 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import gdb.command.pretty_printers +import traceback +import os +import sys +import _gdb -gdb.command.pretty_printers.register_pretty_printer_commands() +if sys.version_info[0] > 2: + # Python 3 moved "reload" + from imp import reload + +from _gdb import * + +class _GdbFile (object): + # These two are needed in Python 3 + encoding = "UTF-8" + errors = "strict" + + def close(self): + # Do nothing. + return None + + def isatty(self): + return False + + def writelines(self, iterable): + for line in iterable: + self.write(line) + + def flush(self): + flush() + +class GdbOutputFile (_GdbFile): + def write(self, s): + write(s, stream=STDOUT) + +sys.stdout = GdbOutputFile() + +class GdbOutputErrorFile (_GdbFile): + def write(self, s): + write(s, stream=STDERR) + +sys.stderr = GdbOutputErrorFile() + +# Default prompt hook does nothing. +prompt_hook = None + +# Ensure that sys.argv is set to something. +# We do not use PySys_SetArgvEx because it did not appear until 2.6.6. +sys.argv = [''] + +# Initial pretty printers. +pretty_printers = [] + +# Initial type printers. +type_printers = [] +# Initial frame filters. +frame_filters = {} + +# Convenience variable to GDB's python directory +PYTHONDIR = os.path.dirname(os.path.dirname(__file__)) + +# Auto-load all functions/commands. + +# Packages to auto-load. + +packages = [ + 'function', + 'command' +] + +# pkgutil.iter_modules is not available prior to Python 2.6. Instead, +# manually iterate the list, collating the Python files in each module +# path. Construct the module name, and import. + +def auto_load_packages(): + for package in packages: + location = os.path.join(os.path.dirname(__file__), package) + if os.path.exists(location): + py_files = filter(lambda x: x.endswith('.py') + and x != '__init__.py', + os.listdir(location)) + + for py_file in py_files: + # Construct from foo.py, gdb.module.foo + modname = "%s.%s.%s" % ( __name__, package, py_file[:-3] ) + try: + if modname in sys.modules: + # reload modules with duplicate names + reload(__import__(modname)) + else: + __import__(modname) + except: + sys.stderr.write (traceback.format_exc() + "\n") + +auto_load_packages() + +def GdbSetPythonDirectory(dir): + """Update sys.path, reload gdb and auto-load packages.""" + global PYTHONDIR + + try: + sys.path.remove(PYTHONDIR) + except ValueError: + pass + sys.path.insert(0, dir) + + PYTHONDIR = dir + + # note that reload overwrites the gdb module without deleting existing + # attributes + reload(__import__(__name__)) + auto_load_packages() diff --git a/share/gdb/python/gdb/command/__init__.py b/share/gdb/python/gdb/command/__init__.py index ee2b61f..ca768c8 100644 --- a/share/gdb/python/gdb/command/__init__.py +++ b/share/gdb/python/gdb/command/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/share/gdb/python/gdb/command/bound_registers.py b/share/gdb/python/gdb/command/bound_registers.py new file mode 100644 index 0000000..24d4c45 --- /dev/null +++ b/share/gdb/python/gdb/command/bound_registers.py @@ -0,0 +1,45 @@ +# Pretty-printer utilities. +# Copyright (C) 2013-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import gdb.printing + +class BoundPrinter: + """Adds size field to a _rawbound128 type.""" + + def __init__ (self, val): + self.val = val + + def to_string (self): + upper = self.val["ubound"] + lower = self.val["lbound"] + size = (long) ((upper) - (lower)) + if size > -1: + size = size + 1 + result = '{lbound = %s, ubound = %s} : size %s' % (lower, upper, size) + return result + +# There are two pattern matching used: first one is related to a library +# second is related to the type. Since we are displaying a register all +# libraries are accepted. Type to be processed is the same present +# in the xml file. + +def build_pretty_printer (): + pp = gdb.printing.RegexpCollectionPrettyPrinter (".*") + pp.add_printer ('bound', '^__gdb_builtin_type_bound128', BoundPrinter) + return pp + +gdb.printing.register_pretty_printer (gdb.current_objfile (), + build_pretty_printer ()) diff --git a/share/gdb/python/gdb/command/explore.py b/share/gdb/python/gdb/command/explore.py new file mode 100644 index 0000000..fd79de3 --- /dev/null +++ b/share/gdb/python/gdb/command/explore.py @@ -0,0 +1,760 @@ +# GDB 'explore' command. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""Implementation of the GDB 'explore' command using the GDB Python API.""" + +import gdb +import sys + +if sys.version_info[0] > 2: + # Python 3 renamed raw_input to input + raw_input = input + +class Explorer(object): + """Internal class which invokes other explorers.""" + + # This map is filled by the Explorer.init_env() function + type_code_to_explorer_map = { } + + _SCALAR_TYPE_LIST = ( + gdb.TYPE_CODE_CHAR, + gdb.TYPE_CODE_INT, + gdb.TYPE_CODE_BOOL, + gdb.TYPE_CODE_FLT, + gdb.TYPE_CODE_VOID, + gdb.TYPE_CODE_ENUM, + ) + + @staticmethod + def guard_expr(expr): + length = len(expr) + guard = False + + if expr[0] == '(' and expr[length-1] == ')': + pass + else: + i = 0 + while i < length: + c = expr[i] + if (c == '_' or ('a' <= c and c <= 'z') or + ('A' <= c and c <= 'Z') or ('0' <= c and c <= '9')): + pass + else: + guard = True + break + i += 1 + + if guard: + return "(" + expr + ")" + else: + return expr + + @staticmethod + def explore_expr(expr, value, is_child): + """Main function to explore an expression value. + + Arguments: + expr: The expression string that is being explored. + value: The gdb.Value value of the expression. + is_child: Boolean value to indicate if the expression is a child. + An expression is a child if it is derived from the main + expression entered by the user. For example, if the user + entered an expression which evaluates to a struct, then + when exploring the fields of the struct, is_child is set + to True internally. + + Returns: + No return value. + """ + type_code = value.type.code + if type_code in Explorer.type_code_to_explorer_map: + explorer_class = Explorer.type_code_to_explorer_map[type_code] + while explorer_class.explore_expr(expr, value, is_child): + pass + else: + print ("Explorer for type '%s' not yet available.\n" % + str(value.type)) + + @staticmethod + def explore_type(name, datatype, is_child): + """Main function to explore a data type. + + Arguments: + name: The string representing the path to the data type being + explored. + datatype: The gdb.Type value of the data type being explored. + is_child: Boolean value to indicate if the name is a child. + A name is a child if it is derived from the main name + entered by the user. For example, if the user entered + the name of struct type, then when exploring the fields + of the struct, is_child is set to True internally. + + Returns: + No return value. + """ + type_code = datatype.code + if type_code in Explorer.type_code_to_explorer_map: + explorer_class = Explorer.type_code_to_explorer_map[type_code] + while explorer_class.explore_type(name, datatype, is_child): + pass + else: + print ("Explorer for type '%s' not yet available.\n" % + str(datatype)) + + @staticmethod + def init_env(): + """Initializes the Explorer environment. + This function should be invoked before starting any exploration. If + invoked before an exploration, it need not be invoked for subsequent + explorations. + """ + Explorer.type_code_to_explorer_map = { + gdb.TYPE_CODE_CHAR : ScalarExplorer, + gdb.TYPE_CODE_INT : ScalarExplorer, + gdb.TYPE_CODE_BOOL : ScalarExplorer, + gdb.TYPE_CODE_FLT : ScalarExplorer, + gdb.TYPE_CODE_VOID : ScalarExplorer, + gdb.TYPE_CODE_ENUM : ScalarExplorer, + gdb.TYPE_CODE_STRUCT : CompoundExplorer, + gdb.TYPE_CODE_UNION : CompoundExplorer, + gdb.TYPE_CODE_PTR : PointerExplorer, + gdb.TYPE_CODE_REF : ReferenceExplorer, + gdb.TYPE_CODE_TYPEDEF : TypedefExplorer, + gdb.TYPE_CODE_ARRAY : ArrayExplorer + } + + @staticmethod + def is_scalar_type(type): + """Checks whether a type is a scalar type. + A type is a scalar type of its type is + gdb.TYPE_CODE_CHAR or + gdb.TYPE_CODE_INT or + gdb.TYPE_CODE_BOOL or + gdb.TYPE_CODE_FLT or + gdb.TYPE_CODE_VOID or + gdb.TYPE_CODE_ENUM. + + Arguments: + type: The type to be checked. + + Returns: + 'True' if 'type' is a scalar type. 'False' otherwise. + """ + return type.code in Explorer._SCALAR_TYPE_LIST + + @staticmethod + def return_to_parent_value(): + """A utility function which prints that the current exploration session + is returning to the parent value. Useful when exploring values. + """ + print ("\nReturning to parent value...\n") + + @staticmethod + def return_to_parent_value_prompt(): + """A utility function which prompts the user to press the 'enter' key + so that the exploration session can shift back to the parent value. + Useful when exploring values. + """ + raw_input("\nPress enter to return to parent value: ") + + @staticmethod + def return_to_enclosing_type(): + """A utility function which prints that the current exploration session + is returning to the enclosing type. Useful when exploring types. + """ + print ("\nReturning to enclosing type...\n") + + @staticmethod + def return_to_enclosing_type_prompt(): + """A utility function which prompts the user to press the 'enter' key + so that the exploration session can shift back to the enclosing type. + Useful when exploring types. + """ + raw_input("\nPress enter to return to enclosing type: ") + + +class ScalarExplorer(object): + """Internal class used to explore scalar values.""" + + @staticmethod + def explore_expr(expr, value, is_child): + """Function to explore scalar values. + See Explorer.explore_expr and Explorer.is_scalar_type for more + information. + """ + print ("'%s' is a scalar value of type '%s'." % + (expr, value.type)) + print ("%s = %s" % (expr, str(value))) + + if is_child: + Explorer.return_to_parent_value_prompt() + Explorer.return_to_parent_value() + + return False + + @staticmethod + def explore_type(name, datatype, is_child): + """Function to explore scalar types. + See Explorer.explore_type and Explorer.is_scalar_type for more + information. + """ + if datatype.code == gdb.TYPE_CODE_ENUM: + if is_child: + print ("%s is of an enumerated type '%s'." % + (name, str(datatype))) + else: + print ("'%s' is an enumerated type." % name) + else: + if is_child: + print ("%s is of a scalar type '%s'." % + (name, str(datatype))) + else: + print ("'%s' is a scalar type." % name) + + if is_child: + Explorer.return_to_enclosing_type_prompt() + Explorer.return_to_enclosing_type() + + return False + + +class PointerExplorer(object): + """Internal class used to explore pointer values.""" + + @staticmethod + def explore_expr(expr, value, is_child): + """Function to explore pointer values. + See Explorer.explore_expr for more information. + """ + print ("'%s' is a pointer to a value of type '%s'" % + (expr, str(value.type.target()))) + option = raw_input("Continue exploring it as a pointer to a single " + "value [y/n]: ") + if option == "y": + deref_value = None + try: + deref_value = value.dereference() + str(deref_value) + except gdb.MemoryError: + print ("'%s' a pointer pointing to an invalid memory " + "location." % expr) + if is_child: + Explorer.return_to_parent_value_prompt() + return False + Explorer.explore_expr("*%s" % Explorer.guard_expr(expr), + deref_value, is_child) + return False + + option = raw_input("Continue exploring it as a pointer to an " + "array [y/n]: ") + if option == "y": + while True: + index = 0 + try: + index = int(raw_input("Enter the index of the element you " + "want to explore in '%s': " % expr)) + except ValueError: + break + element_expr = "%s[%d]" % (Explorer.guard_expr(expr), index) + element = value[index] + try: + str(element) + except gdb.MemoryError: + print ("Cannot read value at index %d." % index) + continue + Explorer.explore_expr(element_expr, element, True) + return False + + if is_child: + Explorer.return_to_parent_value() + return False + + @staticmethod + def explore_type(name, datatype, is_child): + """Function to explore pointer types. + See Explorer.explore_type for more information. + """ + target_type = datatype.target() + print ("\n%s is a pointer to a value of type '%s'." % + (name, str(target_type))) + + Explorer.explore_type("the pointee type of %s" % name, + target_type, + is_child) + return False + + +class ReferenceExplorer(object): + """Internal class used to explore reference (TYPE_CODE_REF) values.""" + + @staticmethod + def explore_expr(expr, value, is_child): + """Function to explore array values. + See Explorer.explore_expr for more information. + """ + referenced_value = value.referenced_value() + Explorer.explore_expr(expr, referenced_value, is_child) + return False + + @staticmethod + def explore_type(name, datatype, is_child): + """Function to explore pointer types. + See Explorer.explore_type for more information. + """ + target_type = datatype.target() + Explorer.explore_type(name, target_type, is_child) + return False + + +class ArrayExplorer(object): + """Internal class used to explore arrays.""" + + @staticmethod + def explore_expr(expr, value, is_child): + """Function to explore array values. + See Explorer.explore_expr for more information. + """ + target_type = value.type.target() + print ("'%s' is an array of '%s'." % (expr, str(target_type))) + index = 0 + try: + index = int(raw_input("Enter the index of the element you want to " + "explore in '%s': " % expr)) + except ValueError: + if is_child: + Explorer.return_to_parent_value() + return False + + element = None + try: + element = value[index] + str(element) + except gdb.MemoryError: + print ("Cannot read value at index %d." % index) + raw_input("Press enter to continue... ") + return True + + Explorer.explore_expr("%s[%d]" % (Explorer.guard_expr(expr), index), + element, True) + return True + + @staticmethod + def explore_type(name, datatype, is_child): + """Function to explore array types. + See Explorer.explore_type for more information. + """ + target_type = datatype.target() + print ("%s is an array of '%s'." % (name, str(target_type))) + + Explorer.explore_type("the array element of %s" % name, target_type, + is_child) + return False + + +class CompoundExplorer(object): + """Internal class used to explore struct, classes and unions.""" + + @staticmethod + def _print_fields(print_list): + """Internal function which prints the fields of a struct/class/union. + """ + max_field_name_length = 0 + for pair in print_list: + if max_field_name_length < len(pair[0]): + max_field_name_length = len(pair[0]) + + for pair in print_list: + print (" %*s = %s" % (max_field_name_length, pair[0], pair[1])) + + @staticmethod + def _get_real_field_count(fields): + real_field_count = 0; + for field in fields: + if not field.artificial: + real_field_count = real_field_count + 1 + + return real_field_count + + @staticmethod + def explore_expr(expr, value, is_child): + """Function to explore structs/classes and union values. + See Explorer.explore_expr for more information. + """ + datatype = value.type + type_code = datatype.code + fields = datatype.fields() + + if type_code == gdb.TYPE_CODE_STRUCT: + type_desc = "struct/class" + else: + type_desc = "union" + + if CompoundExplorer._get_real_field_count(fields) == 0: + print ("The value of '%s' is a %s of type '%s' with no fields." % + (expr, type_desc, str(value.type))) + if is_child: + Explorer.return_to_parent_value_prompt() + return False + + print ("The value of '%s' is a %s of type '%s' with the following " + "fields:\n" % (expr, type_desc, str(value.type))) + + has_explorable_fields = False + choice_to_compound_field_map = { } + current_choice = 0 + print_list = [ ] + for field in fields: + if field.artificial: + continue + field_full_name = Explorer.guard_expr(expr) + "." + field.name + if field.is_base_class: + field_value = value.cast(field.type) + else: + field_value = value[field.name] + literal_value = "" + if type_code == gdb.TYPE_CODE_UNION: + literal_value = ("<Enter %d to explore this field of type " + "'%s'>" % (current_choice, str(field.type))) + has_explorable_fields = True + else: + if Explorer.is_scalar_type(field.type): + literal_value = ("%s .. (Value of type '%s')" % + (str(field_value), str(field.type))) + else: + if field.is_base_class: + field_desc = "base class" + else: + field_desc = "field" + literal_value = ("<Enter %d to explore this %s of type " + "'%s'>" % + (current_choice, field_desc, + str(field.type))) + has_explorable_fields = True + + choice_to_compound_field_map[str(current_choice)] = ( + field_full_name, field_value) + current_choice = current_choice + 1 + + print_list.append((field.name, literal_value)) + + CompoundExplorer._print_fields(print_list) + print ("") + + if has_explorable_fields: + choice = raw_input("Enter the field number of choice: ") + if choice in choice_to_compound_field_map: + Explorer.explore_expr(choice_to_compound_field_map[choice][0], + choice_to_compound_field_map[choice][1], + True) + return True + else: + if is_child: + Explorer.return_to_parent_value() + else: + if is_child: + Explorer.return_to_parent_value_prompt() + + return False + + @staticmethod + def explore_type(name, datatype, is_child): + """Function to explore struct/class and union types. + See Explorer.explore_type for more information. + """ + type_code = datatype.code + type_desc = "" + if type_code == gdb.TYPE_CODE_STRUCT: + type_desc = "struct/class" + else: + type_desc = "union" + + fields = datatype.fields() + if CompoundExplorer._get_real_field_count(fields) == 0: + if is_child: + print ("%s is a %s of type '%s' with no fields." % + (name, type_desc, str(datatype))) + Explorer.return_to_enclosing_type_prompt() + else: + print ("'%s' is a %s with no fields." % (name, type_desc)) + return False + + if is_child: + print ("%s is a %s of type '%s' " + "with the following fields:\n" % + (name, type_desc, str(datatype))) + else: + print ("'%s' is a %s with the following " + "fields:\n" % + (name, type_desc)) + + has_explorable_fields = False + current_choice = 0 + choice_to_compound_field_map = { } + print_list = [ ] + for field in fields: + if field.artificial: + continue + if field.is_base_class: + field_desc = "base class" + else: + field_desc = "field" + rhs = ("<Enter %d to explore this %s of type '%s'>" % + (current_choice, field_desc, str(field.type))) + print_list.append((field.name, rhs)) + choice_to_compound_field_map[str(current_choice)] = ( + field.name, field.type, field_desc) + current_choice = current_choice + 1 + + CompoundExplorer._print_fields(print_list) + print ("") + + if len(choice_to_compound_field_map) > 0: + choice = raw_input("Enter the field number of choice: ") + if choice in choice_to_compound_field_map: + if is_child: + new_name = ("%s '%s' of %s" % + (choice_to_compound_field_map[choice][2], + choice_to_compound_field_map[choice][0], + name)) + else: + new_name = ("%s '%s' of '%s'" % + (choice_to_compound_field_map[choice][2], + choice_to_compound_field_map[choice][0], + name)) + Explorer.explore_type(new_name, + choice_to_compound_field_map[choice][1], True) + return True + else: + if is_child: + Explorer.return_to_enclosing_type() + else: + if is_child: + Explorer.return_to_enclosing_type_prompt() + + return False + + +class TypedefExplorer(object): + """Internal class used to explore values whose type is a typedef.""" + + @staticmethod + def explore_expr(expr, value, is_child): + """Function to explore typedef values. + See Explorer.explore_expr for more information. + """ + actual_type = value.type.strip_typedefs() + print ("The value of '%s' is of type '%s' " + "which is a typedef of type '%s'" % + (expr, str(value.type), str(actual_type))) + + Explorer.explore_expr(expr, value.cast(actual_type), is_child) + return False + + @staticmethod + def explore_type(name, datatype, is_child): + """Function to explore typedef types. + See Explorer.explore_type for more information. + """ + actual_type = datatype.strip_typedefs() + if is_child: + print ("The type of %s is a typedef of type '%s'." % + (name, str(actual_type))) + else: + print ("The type '%s' is a typedef of type '%s'." % + (name, str(actual_type))) + + Explorer.explore_type(name, actual_type, is_child) + return False + + +class ExploreUtils(object): + """Internal class which provides utilities for the main command classes.""" + + @staticmethod + def check_args(name, arg_str): + """Utility to check if adequate number of arguments are passed to an + explore command. + + Arguments: + name: The name of the explore command. + arg_str: The argument string passed to the explore command. + + Returns: + True if adequate arguments are passed, false otherwise. + + Raises: + gdb.GdbError if adequate arguments are not passed. + """ + if len(arg_str) < 1: + raise gdb.GdbError("ERROR: '%s' requires an argument." + % name) + return False + else: + return True + + @staticmethod + def get_type_from_str(type_str): + """A utility function to deduce the gdb.Type value from a string + representing the type. + + Arguments: + type_str: The type string from which the gdb.Type value should be + deduced. + + Returns: + The deduced gdb.Type value if possible, None otherwise. + """ + try: + # Assume the current language to be C/C++ and make a try. + return gdb.parse_and_eval("(%s *)0" % type_str).type.target() + except RuntimeError: + # If assumption of current language to be C/C++ was wrong, then + # lookup the type using the API. + try: + return gdb.lookup_type(type_str) + except RuntimeError: + return None + + @staticmethod + def get_value_from_str(value_str): + """A utility function to deduce the gdb.Value value from a string + representing the value. + + Arguments: + value_str: The value string from which the gdb.Value value should + be deduced. + + Returns: + The deduced gdb.Value value if possible, None otherwise. + """ + try: + return gdb.parse_and_eval(value_str) + except RuntimeError: + return None + + +class ExploreCommand(gdb.Command): + """Explore a value or a type valid in the current context. + + Usage: + + explore ARG + + - ARG is either a valid expression or a type name. + - At any stage of exploration, hit the return key (instead of a + choice, if any) to return to the enclosing type or value. + """ + + def __init__(self): + super(ExploreCommand, self).__init__(name = "explore", + command_class = gdb.COMMAND_DATA, + prefix = True) + + def invoke(self, arg_str, from_tty): + if ExploreUtils.check_args("explore", arg_str) == False: + return + + # Check if it is a value + value = ExploreUtils.get_value_from_str(arg_str) + if value is not None: + Explorer.explore_expr(arg_str, value, False) + return + + # If it is not a value, check if it is a type + datatype = ExploreUtils.get_type_from_str(arg_str) + if datatype is not None: + Explorer.explore_type(arg_str, datatype, False) + return + + # If it is neither a value nor a type, raise an error. + raise gdb.GdbError( + ("'%s' neither evaluates to a value nor is a type " + "in the current context." % + arg_str)) + + +class ExploreValueCommand(gdb.Command): + """Explore value of an expression valid in the current context. + + Usage: + + explore value ARG + + - ARG is a valid expression. + - At any stage of exploration, hit the return key (instead of a + choice, if any) to return to the enclosing value. + """ + + def __init__(self): + super(ExploreValueCommand, self).__init__( + name = "explore value", command_class = gdb.COMMAND_DATA) + + def invoke(self, arg_str, from_tty): + if ExploreUtils.check_args("explore value", arg_str) == False: + return + + value = ExploreUtils.get_value_from_str(arg_str) + if value is None: + raise gdb.GdbError( + (" '%s' does not evaluate to a value in the current " + "context." % + arg_str)) + return + + Explorer.explore_expr(arg_str, value, False) + + +class ExploreTypeCommand(gdb.Command): + """Explore a type or the type of an expression valid in the current + context. + + Usage: + + explore type ARG + + - ARG is a valid expression or a type name. + - At any stage of exploration, hit the return key (instead of a + choice, if any) to return to the enclosing type. + """ + + def __init__(self): + super(ExploreTypeCommand, self).__init__( + name = "explore type", command_class = gdb.COMMAND_DATA) + + def invoke(self, arg_str, from_tty): + if ExploreUtils.check_args("explore type", arg_str) == False: + return + + datatype = ExploreUtils.get_type_from_str(arg_str) + if datatype is not None: + Explorer.explore_type(arg_str, datatype, False) + return + + value = ExploreUtils.get_value_from_str(arg_str) + if value is not None: + print ("'%s' is of type '%s'." % (arg_str, str(value.type))) + Explorer.explore_type(str(value.type), value.type, False) + return + + raise gdb.GdbError(("'%s' is not a type or value in the current " + "context." % arg_str)) + + +Explorer.init_env() + +ExploreCommand() +ExploreValueCommand() +ExploreTypeCommand() diff --git a/share/gdb/python/gdb/command/frame_filters.py b/share/gdb/python/gdb/command/frame_filters.py new file mode 100644 index 0000000..450c5bf --- /dev/null +++ b/share/gdb/python/gdb/command/frame_filters.py @@ -0,0 +1,467 @@ +# Frame-filter commands. +# Copyright (C) 2013-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""GDB commands for working with frame-filters.""" + +import sys +import gdb +import copy +from gdb.FrameIterator import FrameIterator +from gdb.FrameDecorator import FrameDecorator +import gdb.frames +import itertools + +# GDB Commands. +class SetFilterPrefixCmd(gdb.Command): + """Prefix command for 'set' frame-filter related operations.""" + + def __init__(self): + super(SetFilterPrefixCmd, self).__init__("set frame-filter", + gdb.COMMAND_OBSCURE, + gdb.COMPLETE_NONE, True) + +class ShowFilterPrefixCmd(gdb.Command): + """Prefix command for 'show' frame-filter related operations.""" + def __init__(self): + super(ShowFilterPrefixCmd, self).__init__("show frame-filter", + gdb.COMMAND_OBSCURE, + gdb.COMPLETE_NONE, True) +class InfoFrameFilter(gdb.Command): + """List all registered Python frame-filters. + + Usage: info frame-filters + """ + + def __init__(self): + super(InfoFrameFilter, self).__init__("info frame-filter", + gdb.COMMAND_DATA) + @staticmethod + def enabled_string(state): + """Return "Yes" if filter is enabled, otherwise "No".""" + if state: + return "Yes" + else: + return "No" + + def list_frame_filters(self, frame_filters): + """ Internal worker function to list and print frame filters + in a dictionary. + + Arguments: + frame_filters: The name of the dictionary, as + specified by GDB user commands. + """ + + sorted_frame_filters = sorted(frame_filters.items(), + key=lambda i: gdb.frames.get_priority(i[1]), + reverse=True) + + if len(sorted_frame_filters) == 0: + print(" No frame filters registered.") + else: + print(" Priority Enabled Name") + for frame_filter in sorted_frame_filters: + name = frame_filter[0] + try: + priority = '{:<8}'.format( + str(gdb.frames.get_priority(frame_filter[1]))) + enabled = '{:<7}'.format( + self.enabled_string(gdb.frames.get_enabled(frame_filter[1]))) + except Exception: + e = sys.exc_info()[1] + print(" Error printing filter '"+name+"': "+str(e)) + else: + print(" %s %s %s" % (priority, enabled, name)) + + def print_list(self, title, filter_list, blank_line): + print(title) + self.list_frame_filters(filter_list) + if blank_line: + print("") + + def invoke(self, arg, from_tty): + self.print_list("global frame-filters:", gdb.frame_filters, True) + + cp = gdb.current_progspace() + self.print_list("progspace %s frame-filters:" % cp.filename, + cp.frame_filters, True) + + for objfile in gdb.objfiles(): + self.print_list("objfile %s frame-filters:" % objfile.filename, + objfile.frame_filters, False) + +# Internal enable/disable functions. + +def _enable_parse_arg(cmd_name, arg): + """ Internal worker function to take an argument from + enable/disable and return a tuple of arguments. + + Arguments: + cmd_name: Name of the command invoking this function. + args: The argument as a string. + + Returns: + A tuple containing the dictionary, and the argument, or just + the dictionary in the case of "all". + """ + + argv = gdb.string_to_argv(arg); + argc = len(argv) + if argv[0] == "all" and argc > 1: + raise gdb.GdbError(cmd_name + ": with 'all' " \ + "you may not specify a filter.") + else: + if argv[0] != "all" and argc != 2: + raise gdb.GdbError(cmd_name + " takes exactly two arguments.") + + return argv + +def _do_enable_frame_filter(command_tuple, flag): + """Worker for enabling/disabling frame_filters. + + Arguments: + command_type: A tuple with the first element being the + frame filter dictionary, and the second being + the frame filter name. + flag: True for Enable, False for Disable. + """ + + list_op = command_tuple[0] + op_list = gdb.frames.return_list(list_op) + + if list_op == "all": + for item in op_list: + gdb.frames.set_enabled(item, flag) + else: + frame_filter = command_tuple[1] + try: + ff = op_list[frame_filter] + except KeyError: + msg = "frame-filter '" + str(name) + "' not found." + raise gdb.GdbError(msg) + + gdb.frames.set_enabled(ff, flag) + +def _complete_frame_filter_list(text, word, all_flag): + """Worker for frame filter dictionary name completion. + + Arguments: + text: The full text of the command line. + word: The most recent word of the command line. + all_flag: Whether to include the word "all" in completion. + + Returns: + A list of suggested frame filter dictionary name completions + from text/word analysis. This list can be empty when there + are no suggestions for completion. + """ + if all_flag == True: + filter_locations = ["all", "global", "progspace"] + else: + filter_locations = ["global", "progspace"] + for objfile in gdb.objfiles(): + filter_locations.append(objfile.filename) + + # If the user just asked for completions with no completion + # hints, just return all the frame filter dictionaries we know + # about. + if (text == ""): + return filter_locations + + # Otherwise filter on what we know. + flist = filter(lambda x,y=text:x.startswith(y), filter_locations) + + # If we only have one completion, complete it and return it. + if len(flist) == 1: + flist[0] = flist[0][len(text)-len(word):] + + # Otherwise, return an empty list, or a list of frame filter + # dictionaries that the previous filter operation returned. + return flist + +def _complete_frame_filter_name(word, printer_dict): + """Worker for frame filter name completion. + + Arguments: + + word: The most recent word of the command line. + + printer_dict: The frame filter dictionary to search for frame + filter name completions. + + Returns: A list of suggested frame filter name completions + from word analysis of the frame filter dictionary. This list + can be empty when there are no suggestions for completion. + """ + + printer_keys = printer_dict.keys() + if (word == ""): + return printer_keys + + flist = filter(lambda x,y=word:x.startswith(y), printer_keys) + return flist + +class EnableFrameFilter(gdb.Command): + """GDB command to disable the specified frame-filter. + + Usage: enable frame-filter enable DICTIONARY [NAME] + + DICTIONARY is the name of the frame filter dictionary on which to + operate. If dictionary is set to "all", perform operations on all + dictionaries. Named dictionaries are: "global" for the global + frame filter dictionary, "progspace" for the program space's frame + filter dictionary. If either all, or the two named dictionaries + are not specified, the dictionary name is assumed to be the name + of the object-file name. + + NAME matches the name of the frame-filter to operate on. If + DICTIONARY is "all", NAME is ignored. + """ + def __init__(self): + super(EnableFrameFilter, self).__init__("enable frame-filter", + gdb.COMMAND_DATA) + def complete(self, text, word): + """Completion function for both frame filter dictionary, and + frame filter name.""" + if text.count(" ") == 0: + return _complete_frame_filter_list(text, word, True) + else: + printer_list = gdb.frames.return_list(text.split()[0].rstrip()) + return _complete_frame_filter_name(word, printer_list) + + def invoke(self, arg, from_tty): + command_tuple = _enable_parse_arg("enable frame-filter", arg) + _do_enable_frame_filter(command_tuple, True) + + +class DisableFrameFilter(gdb.Command): + """GDB command to disable the specified frame-filter. + + Usage: disable frame-filter disable DICTIONARY [NAME] + + DICTIONARY is the name of the frame filter dictionary on which to + operate. If dictionary is set to "all", perform operations on all + dictionaries. Named dictionaries are: "global" for the global + frame filter dictionary, "progspace" for the program space's frame + filter dictionary. If either all, or the two named dictionaries + are not specified, the dictionary name is assumed to be the name + of the object-file name. + + NAME matches the name of the frame-filter to operate on. If + DICTIONARY is "all", NAME is ignored. + """ + def __init__(self): + super(DisableFrameFilter, self).__init__("disable frame-filter", + gdb.COMMAND_DATA) + + def complete(self, text, word): + """Completion function for both frame filter dictionary, and + frame filter name.""" + if text.count(" ") == 0: + return _complete_frame_filter_list(text, word, True) + else: + printer_list = gdb.frames.return_list(text.split()[0].rstrip()) + return _complete_frame_filter_name(word, printer_list) + + def invoke(self, arg, from_tty): + command_tuple = _enable_parse_arg("disable frame-filter", arg) + _do_enable_frame_filter(command_tuple, False) + +class SetFrameFilterPriority(gdb.Command): + """GDB command to set the priority of the specified frame-filter. + + Usage: set frame-filter priority DICTIONARY NAME PRIORITY + + DICTIONARY is the name of the frame filter dictionary on which to + operate. Named dictionaries are: "global" for the global frame + filter dictionary, "progspace" for the program space's framefilter + dictionary. If either of these two are not specified, the + dictionary name is assumed to be the name of the object-file name. + + NAME matches the name of the frame filter to operate on. + + PRIORITY is the an integer to assign the new priority to the frame + filter. + """ + + def __init__(self): + super(SetFrameFilterPriority, self).__init__("set frame-filter " \ + "priority", + gdb.COMMAND_DATA) + + def _parse_pri_arg(self, arg): + """Internal worker to parse a priority from a tuple. + + Arguments: + arg: Tuple which contains the arguments from the command. + + Returns: + A tuple containing the dictionary, name and priority from + the arguments. + + Raises: + gdb.GdbError: An error parsing the arguments. + """ + + argv = gdb.string_to_argv(arg); + argc = len(argv) + if argc != 3: + print("set frame-filter priority " \ + "takes exactly three arguments.") + return None + + return argv + + def _set_filter_priority(self, command_tuple): + """Internal worker for setting priority of frame-filters, by + parsing a tuple and calling _set_priority with the parsed + tuple. + + Arguments: + command_tuple: Tuple which contains the arguments from the + command. + """ + + list_op = command_tuple[0] + frame_filter = command_tuple[1] + + # GDB returns arguments as a string, so convert priority to + # a number. + priority = int(command_tuple[2]) + + op_list = gdb.frames.return_list(list_op) + + try: + ff = op_list[frame_filter] + except KeyError: + msg = "frame-filter '" + str(name) + "' not found." + raise gdb.GdbError(msg) + + gdb.frames.set_priority(ff, priority) + + def complete(self, text, word): + """Completion function for both frame filter dictionary, and + frame filter name.""" + if text.count(" ") == 0: + return _complete_frame_filter_list(text, word, False) + else: + printer_list = gdb.frames.return_list(text.split()[0].rstrip()) + return _complete_frame_filter_name(word, printer_list) + + def invoke(self, arg, from_tty): + command_tuple = self._parse_pri_arg(arg) + if command_tuple != None: + self._set_filter_priority(command_tuple) + +class ShowFrameFilterPriority(gdb.Command): + """GDB command to show the priority of the specified frame-filter. + + Usage: show frame-filter priority DICTIONARY NAME + + DICTIONARY is the name of the frame filter dictionary on which to + operate. Named dictionaries are: "global" for the global frame + filter dictionary, "progspace" for the program space's framefilter + dictionary. If either of these two are not specified, the + dictionary name is assumed to be the name of the object-file name. + + NAME matches the name of the frame-filter to operate on. + """ + + def __init__(self): + super(ShowFrameFilterPriority, self).__init__("show frame-filter " \ + "priority", + gdb.COMMAND_DATA) + + def _parse_pri_arg(self, arg): + """Internal worker to parse a dictionary and name from a + tuple. + + Arguments: + arg: Tuple which contains the arguments from the command. + + Returns: + A tuple containing the dictionary, and frame filter name. + + Raises: + gdb.GdbError: An error parsing the arguments. + """ + + argv = gdb.string_to_argv(arg); + argc = len(argv) + if argc != 2: + print("show frame-filter priority " \ + "takes exactly two arguments.") + return None + + return argv + + def get_filter_priority(self, frame_filters, name): + """Worker for retrieving the priority of frame_filters. + + Arguments: + frame_filters: Name of frame filter dictionary. + name: object to select printers. + + Returns: + The priority of the frame filter. + + Raises: + gdb.GdbError: A frame filter cannot be found. + """ + + op_list = gdb.frames.return_list(frame_filters) + + try: + ff = op_list[name] + except KeyError: + msg = "frame-filter '" + str(name) + "' not found." + raise gdb.GdbError(msg) + + return gdb.frames.get_priority(ff) + + def complete(self, text, word): + """Completion function for both frame filter dictionary, and + frame filter name.""" + + if text.count(" ") == 0: + return _complete_frame_filter_list(text, word, False) + else: + printer_list = frame._return_list(text.split()[0].rstrip()) + return _complete_frame_filter_name(word, printer_list) + + def invoke(self, arg, from_tty): + command_tuple = self._parse_pri_arg(arg) + if command_tuple == None: + return + filter_name = command_tuple[1] + list_name = command_tuple[0] + try: + priority = self.get_filter_priority(list_name, filter_name); + except Exception: + e = sys.exc_info()[1] + print("Error printing filter priority for '"+name+"':"+str(e)) + else: + print("Priority of filter '" + filter_name + "' in list '" \ + + list_name + "' is: " + str(priority)) + +# Register commands +SetFilterPrefixCmd() +ShowFilterPrefixCmd() +InfoFrameFilter() +EnableFrameFilter() +DisableFrameFilter() +SetFrameFilterPriority() +ShowFrameFilterPriority() diff --git a/share/gdb/python/gdb/command/pretty_printers.py b/share/gdb/python/gdb/command/pretty_printers.py index 86923d7..a9027b3 100644 --- a/share/gdb/python/gdb/command/pretty_printers.py +++ b/share/gdb/python/gdb/command/pretty_printers.py @@ -1,5 +1,5 @@ # Pretty-printer commands. -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -124,21 +124,17 @@ class InfoPrettyPrinter(gdb.Command): """Print a list of pretty-printers.""" # A potential enhancement is to provide an option to list printers in # "lookup order" (i.e. unsorted). - sorted_pretty_printers = copy.copy(pretty_printers) - sorted_pretty_printers.sort(lambda x, y: - cmp(self.printer_name(x), - self.printer_name(y))) + sorted_pretty_printers = sorted (copy.copy(pretty_printers), + key = self.printer_name) for printer in sorted_pretty_printers: name = self.printer_name(printer) enabled = self.enabled_string(printer) if name_re.match(name): - print " %s%s" % (name, enabled) + print (" %s%s" % (name, enabled)) if (hasattr(printer, "subprinters") and printer.subprinters is not None): - sorted_subprinters = copy.copy(printer.subprinters) - sorted_subprinters.sort(lambda x, y: - cmp(self.printer_name(x), - self.printer_name(y))) + sorted_subprinters = sorted (copy.copy(printer.subprinters), + key = self.printer_name) for subprinter in sorted_subprinters: if (not subname_re or subname_re.match(subprinter.name)): @@ -148,9 +144,9 @@ class InfoPrettyPrinter(gdb.Command): def invoke1(self, title, printer_list, obj_name_to_match, object_re, name_re, subname_re): - """"Subroutine of invoke to simplify it.""" + """Subroutine of invoke to simplify it.""" if printer_list and object_re.match(obj_name_to_match): - print title + print (title) self.list_pretty_printers(printer_list, name_re, subname_re) def invoke(self, arg, from_tty): @@ -219,7 +215,7 @@ def show_pretty_printer_enabled_summary(): We count subprinters individually. """ (enabled_count, total_count) = count_all_enabled_printers() - print "%d of %d printers enabled" % (enabled_count, total_count) + print ("%d of %d printers enabled" % (enabled_count, total_count)) def do_enable_pretty_printer_1 (pretty_printers, name_re, subname_re, flag): @@ -301,7 +297,7 @@ def do_enable_pretty_printer (arg, flag): state = "enabled" else: state = "disabled" - print "%d %s %s" % (total, pluralize("printer", total), state) + print ("%d %s %s" % (total, pluralize("printer", total), state)) # Print the total list of printers currently enabled/disabled. # This is to further assist the user in determining whether the result @@ -368,3 +364,5 @@ def register_pretty_printer_commands(): InfoPrettyPrinter() EnablePrettyPrinter() DisablePrettyPrinter() + +register_pretty_printer_commands() diff --git a/share/gdb/python/gdb/command/prompt.py b/share/gdb/python/gdb/command/prompt.py new file mode 100644 index 0000000..e7dc3da --- /dev/null +++ b/share/gdb/python/gdb/command/prompt.py @@ -0,0 +1,66 @@ +# Extended prompt. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""GDB command for working with extended prompts.""" + +import gdb +import gdb.prompt + +class _ExtendedPrompt(gdb.Parameter): + + """Set the extended prompt. + +Usage: set extended-prompt VALUE + +Substitutions are applied to VALUE to compute the real prompt. + +The currently defined substitutions are: + +""" + # Add the prompt library's dynamically generated help to the + # __doc__ string. + __doc__ = __doc__ + gdb.prompt.prompt_help() + + set_doc = "Set the extended prompt." + show_doc = "Show the extended prompt." + + def __init__(self): + super(_ExtendedPrompt, self).__init__("extended-prompt", + gdb.COMMAND_SUPPORT, + gdb.PARAM_STRING_NOESCAPE) + self.value = '' + self.hook_set = False + + def get_show_string (self, pvalue): + if self.value is not '': + return "The extended prompt is: " + self.value + else: + return "The extended prompt is not set." + + def get_set_string (self): + if self.hook_set == False: + gdb.prompt_hook = self.before_prompt_hook + self.hook_set = True + return "" + + def before_prompt_hook(self, current): + if self.value is not '': + newprompt = gdb.prompt.substitute_prompt(self.value) + return newprompt.replace('\\', '\\\\') + else: + return None + +_ExtendedPrompt() diff --git a/share/gdb/python/gdb/command/type_printers.py b/share/gdb/python/gdb/command/type_printers.py new file mode 100644 index 0000000..9376be8 --- /dev/null +++ b/share/gdb/python/gdb/command/type_printers.py @@ -0,0 +1,125 @@ +# Type printer commands. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +import copy +import gdb + +"""GDB commands for working with type-printers.""" + +class InfoTypePrinter(gdb.Command): + """GDB command to list all registered type-printers. + + Usage: info type-printers + """ + + def __init__ (self): + super(InfoTypePrinter, self).__init__("info type-printers", + gdb.COMMAND_DATA) + + def list_type_printers(self, type_printers): + """Print a list of type printers.""" + # A potential enhancement is to provide an option to list printers in + # "lookup order" (i.e. unsorted). + sorted_type_printers = sorted (copy.copy(type_printers), + key = lambda x: x.name) + for printer in sorted_type_printers: + if printer.enabled: + enabled = '' + else: + enabled = " [disabled]" + print (" %s%s" % (printer.name, enabled)) + + def invoke(self, arg, from_tty): + """GDB calls this to perform the command.""" + sep = '' + for objfile in gdb.objfiles(): + if objfile.type_printers: + print ("%sType printers for %s:" % (sep, objfile.name)) + self.list_type_printers(objfile.type_printers) + sep = '\n' + if gdb.current_progspace().type_printers: + print ("%sType printers for program space:" % sep) + self.list_type_printers(gdb.current_progspace().type_printers) + sep = '\n' + if gdb.type_printers: + print ("%sGlobal type printers:" % sep) + self.list_type_printers(gdb.type_printers) + +class _EnableOrDisableCommand(gdb.Command): + def __init__(self, setting, name): + super(_EnableOrDisableCommand, self).__init__(name, gdb.COMMAND_DATA) + self.setting = setting + + def set_some(self, name, printers): + result = False + for p in printers: + if name == p.name: + p.enabled = self.setting + result = True + return result + + def invoke(self, arg, from_tty): + """GDB calls this to perform the command.""" + for name in arg.split(): + ok = False + for objfile in gdb.objfiles(): + if self.set_some(name, objfile.type_printers): + ok = True + if self.set_some(name, gdb.current_progspace().type_printers): + ok = True + if self.set_some(name, gdb.type_printers): + ok = True + if not ok: + print ("No type printer named '%s'" % name) + + def add_some(self, result, word, printers): + for p in printers: + if p.name.startswith(word): + result.append(p.name) + + def complete(self, text, word): + result = [] + for objfile in gdb.objfiles(): + self.add_some(result, word, objfile.type_printers) + self.add_some(result, word, gdb.current_progspace().type_printers) + self.add_some(result, word, gdb.type_printers) + return result + +class EnableTypePrinter(_EnableOrDisableCommand): + """GDB command to enable the specified type printer. + + Usage: enable type-printer NAME + + NAME is the name of the type-printer. + """ + + def __init__(self): + super(EnableTypePrinter, self).__init__(True, "enable type-printer") + +class DisableTypePrinter(_EnableOrDisableCommand): + """GDB command to disable the specified type-printer. + + Usage: disable type-printer NAME + + NAME is the name of the type-printer. + """ + + def __init__(self): + super(DisableTypePrinter, self).__init__(False, "disable type-printer") + +InfoTypePrinter() +EnableTypePrinter() +DisableTypePrinter() diff --git a/share/gdb/python/gdb/frames.py b/share/gdb/python/gdb/frames.py new file mode 100644 index 0000000..19172e7 --- /dev/null +++ b/share/gdb/python/gdb/frames.py @@ -0,0 +1,228 @@ +# Frame-filter commands. +# Copyright (C) 2013-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""Internal functions for working with frame-filters.""" + +import gdb +from gdb.FrameIterator import FrameIterator +from gdb.FrameDecorator import FrameDecorator +import itertools +import collections + +def get_priority(filter_item): + """ Internal worker function to return the frame-filter's priority + from a frame filter object. This is a fail free function as it is + used in sorting and filtering. If a badly implemented frame + filter does not implement the priority attribute, return zero + (otherwise sorting/filtering will fail and prevent other frame + filters from executing). + + Arguments: + filter_item: An object conforming to the frame filter + interface. + + Returns: + The priority of the frame filter from the "priority" + attribute, or zero. + """ + # Do not fail here, as the sort will fail. If a filter has not + # (incorrectly) set a priority, set it to zero. + return getattr(filter_item, "priority", 0) + +def set_priority(filter_item, priority): + """ Internal worker function to set the frame-filter's priority. + + Arguments: + filter_item: An object conforming to the frame filter + interface. + priority: The priority to assign as an integer. + """ + + filter_item.priority = priority + +def get_enabled(filter_item): + """ Internal worker function to return a filter's enabled state + from a frame filter object. This is a fail free function as it is + used in sorting and filtering. If a badly implemented frame + filter does not implement the enabled attribute, return False + (otherwise sorting/filtering will fail and prevent other frame + filters from executing). + + Arguments: + filter_item: An object conforming to the frame filter + interface. + + Returns: + The enabled state of the frame filter from the "enabled" + attribute, or False. + """ + + # If the filter class is badly implemented when called from the + # Python filter command, do not cease filter operations, just set + # enabled to False. + return getattr(filter_item, "enabled", False) + +def set_enabled(filter_item, state): + """ Internal Worker function to set the frame-filter's enabled + state. + + Arguments: + filter_item: An object conforming to the frame filter + interface. + state: True or False, depending on desired state. + """ + + filter_item.enabled = state + +def return_list(name): + """ Internal Worker function to return the frame filter + dictionary, depending on the name supplied as an argument. If the + name is not "all", "global" or "progspace", it is assumed to name + an object-file. + + Arguments: + name: The name of the list, as specified by GDB user commands. + + Returns: + A dictionary object for a single specified dictionary, or a + list containing all the items for "all" + + Raises: + gdb.GdbError: A dictionary of that name cannot be found. + """ + + # If all dictionaries are wanted in the case of "all" we + # cannot return a combined dictionary as keys() may clash in + # between different dictionaries. As we just want all the frame + # filters to enable/disable them all, just return the combined + # items() as a chained iterator of dictionary values. + if name == "all": + glob = gdb.frame_filters.values() + prog = gdb.current_progspace().frame_filters.values() + return_iter = itertools.chain(glob, prog) + for objfile in gdb.objfiles(): + return_iter = itertools.chain(return_iter, objfile.frame_filters.values()) + + return return_iter + + if name == "global": + return gdb.frame_filters + else: + if name == "progspace": + cp = gdb.current_progspace() + return cp.frame_filters + else: + for objfile in gdb.objfiles(): + if name == objfile.filename: + return objfile.frame_filters + + msg = "Cannot find frame-filter dictionary for '" + name + "'" + raise gdb.GdbError(msg) + +def _sort_list(): + """ Internal Worker function to merge all known frame-filter + lists, prune any filters with the state set to "disabled", and + sort the list on the frame-filter's "priority" attribute. + + Returns: + sorted_list: A sorted, pruned list of frame filters to + execute. + """ + + all_filters = return_list("all") + sorted_frame_filters = sorted(all_filters, key = get_priority, + reverse = True) + + sorted_frame_filters = filter(get_enabled, + sorted_frame_filters) + + return sorted_frame_filters + +def execute_frame_filters(frame, frame_low, frame_high): + """ Internal function called from GDB that will execute the chain + of frame filters. Each filter is executed in priority order. + After the execution completes, slice the iterator to frame_low - + frame_high range. + + Arguments: + frame: The initial frame. + + frame_low: The low range of the slice. If this is a negative + integer then it indicates a backward slice (ie bt -4) which + counts backward from the last frame in the backtrace. + + frame_high: The high range of the slice. If this is -1 then + it indicates all frames until the end of the stack from + frame_low. + + Returns: + frame_iterator: The sliced iterator after all frame + filters have had a change to execute, or None if no frame + filters are registered. + """ + + # Get a sorted list of frame filters. + sorted_list = list(_sort_list()) + + # Check to see if there are any frame-filters. If not, just + # return None and let default backtrace printing occur. + if len(sorted_list) == 0: + return None + + frame_iterator = FrameIterator(frame) + + # Apply a basic frame decorator to all gdb.Frames. This unifies + # the interface. Python 3.x moved the itertools.imap + # functionality to map(), so check if it is available. + if hasattr(itertools,"imap"): + frame_iterator = itertools.imap(FrameDecorator, frame_iterator) + else: + frame_iterator = map(FrameDecorator, frame_iterator) + + for ff in sorted_list: + frame_iterator = ff.filter(frame_iterator) + + # Slicing + + # Is this a slice from the end of the backtrace, ie bt -2? + if frame_low < 0: + count = 0 + slice_length = abs(frame_low) + # We cannot use MAXLEN argument for deque as it is 2.6 onwards + # and some GDB versions might be < 2.6. + sliced = collections.deque() + + for frame_item in frame_iterator: + if count >= slice_length: + sliced.popleft(); + count = count + 1 + sliced.append(frame_item) + + return iter(sliced) + + # -1 for frame_high means until the end of the backtrace. Set to + # None if that is the case, to indicate to itertools.islice to + # slice to the end of the iterator. + if frame_high == -1: + frame_high = None + else: + # As frames start from 0, add one to frame_high so islice + # correctly finds the end + frame_high = frame_high + 1; + + sliced = itertools.islice(frame_iterator, frame_low, frame_high) + + return sliced diff --git a/share/gdb/python/gdb/function/__init__.py b/share/gdb/python/gdb/function/__init__.py new file mode 100644 index 0000000..bcfadc3 --- /dev/null +++ b/share/gdb/python/gdb/function/__init__.py @@ -0,0 +1,14 @@ +# Copyright (C) 2012-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. diff --git a/share/gdb/python/gdb/function/strfns.py b/share/gdb/python/gdb/function/strfns.py new file mode 100644 index 0000000..9e2ed79 --- /dev/null +++ b/share/gdb/python/gdb/function/strfns.py @@ -0,0 +1,108 @@ +# Useful gdb string convenience functions. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""$_memeq, $_strlen, $_streq, $_regex""" + +import gdb +import re + + +class _MemEq(gdb.Function): + """$_memeq - compare bytes of memory + +Usage: + $_memeq(a, b, len) + +Returns: + True if len bytes at a and b compare equally. +""" + def __init__(self): + super(_MemEq, self).__init__("_memeq") + + def invoke(self, a, b, length): + if length < 0: + raise ValueError("length must be non-negative") + if length == 0: + return True + # The argument(s) to vector are [low_bound,]high_bound. + byte_vector = gdb.lookup_type("char").vector(length - 1) + ptr_byte_vector = byte_vector.pointer() + a_ptr = a.reinterpret_cast(ptr_byte_vector) + b_ptr = b.reinterpret_cast(ptr_byte_vector) + return a_ptr.dereference() == b_ptr.dereference() + + +class _StrLen(gdb.Function): + """$_strlen - compute string length + +Usage: + $_strlen(a) + +Returns: + Length of string a, assumed to be a string in the current language. +""" + def __init__(self): + super(_StrLen, self).__init__("_strlen") + + def invoke(self, a): + s = a.string() + return len(s) + + +class _StrEq(gdb.Function): + """$_streq - check string equality + +Usage: + $_streq(a, b) + +Returns: + True if a and b are identical strings in the current language. + +Example (amd64-linux): + catch syscall open + cond $bpnum $_streq((char*) $rdi, "foo") +""" + def __init__(self): + super(_StrEq, self).__init__("_streq") + + def invoke(self, a, b): + return a.string() == b.string() + + +class _RegEx(gdb.Function): + """$_regex - check if a string matches a regular expression + +Usage: + $_regex(string, regex) + +Returns: + True if string str (in the current language) matches the + regular expression regex. +""" + def __init__(self): + super(_RegEx, self).__init__("_regex") + + def invoke(self, string, regex): + s = string.string() + r = re.compile(regex.string()) + return bool(r.match(s)) + + +# GDB will import us automagically via gdb/__init__.py. +_MemEq() +_StrLen() +_StrEq() +_RegEx() diff --git a/share/gdb/python/gdb/printing.py b/share/gdb/python/gdb/printing.py index a030827..80227c8 100644 --- a/share/gdb/python/gdb/printing.py +++ b/share/gdb/python/gdb/printing.py @@ -1,5 +1,5 @@ # Pretty-printer utilities. -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,12 @@ import gdb import gdb.types import re +import sys +if sys.version_info[0] > 2: + # Python 3 removed basestring and long + basestring = str + long = int class PrettyPrinter(object): """A basic pretty-printer. @@ -206,3 +211,53 @@ class RegexpCollectionPrettyPrinter(PrettyPrinter): # Cannot find a pretty printer. Return None. return None + +# A helper class for printing enum types. This class is instantiated +# with a list of enumerators to print a particular Value. +class _EnumInstance: + def __init__(self, enumerators, val): + self.enumerators = enumerators + self.val = val + + def to_string(self): + flag_list = [] + v = long(self.val) + any_found = False + for (e_name, e_value) in self.enumerators: + if v & e_value != 0: + flag_list.append(e_name) + v = v & ~e_value + any_found = True + if not any_found or v != 0: + # Leftover value. + flag_list.append('<unknown: 0x%x>' % v) + return "0x%x [%s]" % (self.val, " | ".join(flag_list)) + +class FlagEnumerationPrinter(PrettyPrinter): + """A pretty-printer which can be used to print a flag-style enumeration. + A flag-style enumeration is one where the enumerators are or'd + together to create values. The new printer will print these + symbolically using '|' notation. The printer must be registered + manually. This printer is most useful when an enum is flag-like, + but has some overlap. GDB's built-in printing will not handle + this case, but this printer will attempt to.""" + + def __init__(self, enum_type): + super(FlagEnumerationPrinter, self).__init__(enum_type) + self.initialized = False + + def __call__(self, val): + if not self.initialized: + self.initialized = True + flags = gdb.lookup_type(self.name) + self.enumerators = [] + for field in flags.fields(): + self.enumerators.append((field.name, field.enumval)) + # Sorting the enumerators by value usually does the right + # thing. + self.enumerators.sort(key = lambda x: x.enumval) + + if self.enabled: + return _EnumInstance(self.enumerators, val) + else: + return None diff --git a/share/gdb/python/gdb/prompt.py b/share/gdb/python/gdb/prompt.py new file mode 100644 index 0000000..d99f2ea --- /dev/null +++ b/share/gdb/python/gdb/prompt.py @@ -0,0 +1,148 @@ +# Extended prompt utilities. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +""" Extended prompt library functions.""" + +import gdb +import os + +def _prompt_pwd(ignore): + "The current working directory." + return os.getcwdu() + +def _prompt_object_attr(func, what, attr, nattr): + """Internal worker for fetching GDB attributes.""" + if attr is None: + attr = nattr + try: + obj = func() + except gdb.error: + return '<no %s>' % what + if hasattr(obj, attr): + result = getattr(obj, attr) + if callable(result): + result = result() + return result + else: + return '<no attribute %s on current %s>' % (attr, what) + +def _prompt_frame(attr): + "The selected frame; an argument names a frame parameter." + return _prompt_object_attr(gdb.selected_frame, 'frame', attr, 'name') + +def _prompt_thread(attr): + "The selected thread; an argument names a thread parameter." + return _prompt_object_attr(gdb.selected_thread, 'thread', attr, 'num') + +def _prompt_version(attr): + "The version of GDB." + return gdb.VERSION + +def _prompt_esc(attr): + "The ESC character." + return '\033' + +def _prompt_bs(attr): + "A backslash." + return '\\' + +def _prompt_n(attr): + "A newline." + return '\n' + +def _prompt_r(attr): + "A carriage return." + return '\r' + +def _prompt_param(attr): + "A parameter's value; the argument names the parameter." + return gdb.parameter(attr) + +def _prompt_noprint_begin(attr): + "Begins a sequence of non-printing characters." + return '\001' + +def _prompt_noprint_end(attr): + "Ends a sequence of non-printing characters." + return '\002' + +prompt_substitutions = { + 'e': _prompt_esc, + '\\': _prompt_bs, + 'n': _prompt_n, + 'r': _prompt_r, + 'v': _prompt_version, + 'w': _prompt_pwd, + 'f': _prompt_frame, + 't': _prompt_thread, + 'p': _prompt_param, + '[': _prompt_noprint_begin, + ']': _prompt_noprint_end +} + +def prompt_help(): + """Generate help dynamically from the __doc__ strings of attribute + functions.""" + + result = '' + keys = sorted (prompt_substitutions.keys()) + for key in keys: + result += ' \\%s\t%s\n' % (key, prompt_substitutions[key].__doc__) + result += """ +A substitution can be used in a simple form, like "\\f". +An argument can also be passed to it, like "\\f{name}". +The meaning of the argument depends on the particular substitution.""" + return result + +def substitute_prompt(prompt): + "Perform substitutions on PROMPT." + + result = '' + plen = len(prompt) + i = 0 + while i < plen: + if prompt[i] == '\\': + i = i + 1 + if i >= plen: + break + cmdch = prompt[i] + + if cmdch in prompt_substitutions: + cmd = prompt_substitutions[cmdch] + + if i + 1 < plen and prompt[i + 1] == '{': + j = i + 1 + while j < plen and prompt[j] != '}': + j = j + 1 + # Just ignore formatting errors. + if j >= plen or prompt[j] != '}': + arg = None + else: + arg = prompt[i + 2 : j] + i = j + else: + arg = None + result += str(cmd(arg)) + else: + # Unrecognized escapes are turned into the escaped + # character itself. + result += prompt[i] + else: + result += prompt[i] + + i = i + 1 + + return result diff --git a/share/gdb/python/gdb/types.py b/share/gdb/python/gdb/types.py index 54fbe3c..5fa4eab 100644 --- a/share/gdb/python/gdb/types.py +++ b/share/gdb/python/gdb/types.py @@ -1,5 +1,5 @@ # Type utilities. -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,6 +86,91 @@ def make_enum_dict(enum_type): raise TypeError("not an enum type") enum_dict = {} for field in enum_type.fields(): - # The enum's value is stored in "bitpos". - enum_dict[field.name] = field.bitpos + # The enum's value is stored in "enumval". + enum_dict[field.name] = field.enumval return enum_dict + + +def deep_items (type_): + """Return an iterator that recursively traverses anonymous fields. + + Arguments: + type_: The type to traverse. It should be one of + gdb.TYPE_CODE_STRUCT or gdb.TYPE_CODE_UNION. + + Returns: + an iterator similar to gdb.Type.iteritems(), i.e., it returns + pairs of key, value, but for any anonymous struct or union + field that field is traversed recursively, depth-first. + """ + for k, v in type_.iteritems (): + if k: + yield k, v + else: + for i in deep_items (v.type): + yield i + +class TypePrinter(object): + """The base class for type printers. + + Instances of this type can be used to substitute type names during + 'ptype'. + + A type printer must have at least 'name' and 'enabled' attributes, + and supply an 'instantiate' method. + + The 'instantiate' method must either return None, or return an + object which has a 'recognize' method. This method must accept a + gdb.Type argument and either return None, meaning that the type + was not recognized, or a string naming the type. + """ + + def __init__(self, name): + self.name = name + self.enabled = True + + def instantiate(self): + return None + +# Helper function for computing the list of type recognizers. +def _get_some_type_recognizers(result, plist): + for printer in plist: + if printer.enabled: + inst = printer.instantiate() + if inst is not None: + result.append(inst) + return None + +def get_type_recognizers(): + "Return a list of the enabled type recognizers for the current context." + result = [] + + # First try the objfiles. + for objfile in gdb.objfiles(): + _get_some_type_recognizers(result, objfile.type_printers) + # Now try the program space. + _get_some_type_recognizers(result, gdb.current_progspace().type_printers) + # Finally, globals. + _get_some_type_recognizers(result, gdb.type_printers) + + return result + +def apply_type_recognizers(recognizers, type_obj): + """Apply the given list of type recognizers to the type TYPE_OBJ. + If any recognizer in the list recognizes TYPE_OBJ, returns the name + given by the recognizer. Otherwise, this returns None.""" + for r in recognizers: + result = r.recognize(type_obj) + if result is not None: + return result + return None + +def register_type_printer(locus, printer): + """Register a type printer. + PRINTER is the type printer instance. + LOCUS is either an objfile, a program space, or None, indicating + global registration.""" + + if locus is None: + locus = gdb + locus.type_printers.insert(0, printer) diff --git a/share/gdb/syscalls/amd64-linux.xml b/share/gdb/syscalls/amd64-linux.xml index ee0ea6d..6a04218 100644 --- a/share/gdb/syscalls/amd64-linux.xml +++ b/share/gdb/syscalls/amd64-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2009, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/arm-linux.xml b/share/gdb/syscalls/arm-linux.xml new file mode 100644 index 0000000..9d989bd --- /dev/null +++ b/share/gdb/syscalls/arm-linux.xml @@ -0,0 +1,398 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. This file is offered as-is, + without any warranty. --> + +<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd"> + +<!-- This file was generated using the following file: + + linux/arch/arm/include/uapi/asm/unistd.h + + The file mentioned above belongs to the Linux Kernel. + Some small hand-edits were made. --> + +<syscalls_info> + <syscall name="restart_syscall" number="0"/> + <syscall name="exit" number="1"/> + <syscall name="fork" number="2"/> + <syscall name="read" number="3"/> + <syscall name="write" number="4"/> + <syscall name="open" number="5"/> + <syscall name="close" number="6"/> + <syscall name="waitpid" number="7"/> <!-- removed --> + <syscall name="creat" number="8"/> + <syscall name="link" number="9"/> + <syscall name="unlink" number="10"/> + <syscall name="execve" number="11"/> + <syscall name="chdir" number="12"/> + <syscall name="time" number="13"/> + <syscall name="mknod" number="14"/> + <syscall name="chmod" number="15"/> + <syscall name="lchown" number="16"/> + <syscall name="break" number="17"/> <!-- removed --> + <syscall name="oldstat" number="18"/> <!-- removed --> + <syscall name="lseek" number="19"/> + <syscall name="getpid" number="20"/> + <syscall name="mount" number="21"/> + <syscall name="umount" number="22"/> + <syscall name="setuid" number="23"/> + <syscall name="getuid" number="24"/> + <syscall name="stime" number="25"/> + <syscall name="ptrace" number="26"/> + <syscall name="alarm" number="27"/> + <syscall name="oldfstat" number="28"/> <!-- removed --> + <syscall name="pause" number="29"/> + <syscall name="utime" number="30"/> + <syscall name="stty" number="31"/> <!-- removed --> + <syscall name="gtty" number="32"/> <!-- removed --> + <syscall name="access" number="33"/> + <syscall name="nice" number="34"/> + <syscall name="ftime" number="35"/> <!-- removed --> + <syscall name="sync" number="36"/> + <syscall name="kill" number="37"/> + <syscall name="rename" number="38"/> + <syscall name="mkdir" number="39"/> + <syscall name="rmdir" number="40"/> + <syscall name="dup" number="41"/> + <syscall name="pipe" number="42"/> + <syscall name="times" number="43"/> + <syscall name="prof" number="44"/> <!-- removed --> + <syscall name="brk" number="45"/> + <syscall name="setgid" number="46"/> + <syscall name="getgid" number="47"/> + <syscall name="signal" number="48"/> <!-- removed --> + <syscall name="geteuid" number="49"/> + <syscall name="getegid" number="50"/> + <syscall name="acct" number="51"/> + <syscall name="umount2" number="52"/> + <syscall name="lock" number="53"/> <!-- removed --> + <syscall name="ioctl" number="54"/> + <syscall name="fcntl" number="55"/> + <syscall name="mpx" number="56"/> <!-- removed --> + <syscall name="setpgid" number="57"/> + <syscall name="ulimit" number="58"/> <!-- removed --> + <syscall name="oldolduname" number="59"/> <!-- removed --> + <syscall name="umask" number="60"/> + <syscall name="chroot" number="61"/> + <syscall name="ustat" number="62"/> + <syscall name="dup2" number="63"/> + <syscall name="getppid" number="64"/> + <syscall name="getpgrp" number="65"/> + <syscall name="setsid" number="66"/> + <syscall name="sigaction" number="67"/> + <syscall name="sgetmask" number="68"/> <!-- removed --> + <syscall name="ssetmask" number="69"/> <!-- removed --> + <syscall name="setreuid" number="70"/> + <syscall name="setregid" number="71"/> + <syscall name="sigsuspend" number="72"/> + <syscall name="sigpending" number="73"/> + <syscall name="sethostname" number="74"/> + <syscall name="setrlimit" number="75"/> + <syscall name="getrlimit" number="76"/> + <syscall name="getrusage" number="77"/> + <syscall name="gettimeofday" number="78"/> + <syscall name="settimeofday" number="79"/> + <syscall name="getgroups" number="80"/> + <syscall name="setgroups" number="81"/> + <syscall name="select" number="82"/> + <syscall name="symlink" number="83"/> + <syscall name="oldlstat" number="84"/> <!-- removed --> + <syscall name="readlink" number="85"/> + <syscall name="uselib" number="86"/> + <syscall name="swapon" number="87"/> + <syscall name="reboot" number="88"/> + <syscall name="readdir" number="89"/> + <syscall name="mmap" number="90"/> + <syscall name="munmap" number="91"/> + <syscall name="truncate" number="92"/> + <syscall name="ftruncate" number="93"/> + <syscall name="fchmod" number="94"/> + <syscall name="fchown" number="95"/> + <syscall name="getpriority" number="96"/> + <syscall name="setpriority" number="97"/> + <syscall name="profil" number="98"/> <!-- removed --> + <syscall name="statfs" number="99"/> + <syscall name="fstatfs" number="100"/> + <syscall name="ioperm" number="101"/> <!-- removed --> + <syscall name="socketcall" number="102"/> + <syscall name="syslog" number="103"/> + <syscall name="setitimer" number="104"/> + <syscall name="getitimer" number="105"/> + <syscall name="stat" number="106"/> + <syscall name="lstat" number="107"/> + <syscall name="fstat" number="108"/> + <syscall name="olduname" number="109"/> <!-- removed --> + <syscall name="iopl" number="110"/> <!-- removed --> + <syscall name="vhangup" number="111"/> + <syscall name="idle" number="112"/> <!-- removed --> + <syscall name="syscall" number="113"/> + <syscall name="wait4" number="114"/> + <syscall name="swapoff" number="115"/> + <syscall name="sysinfo" number="116"/> + <syscall name="ipc" number="117"/> + <syscall name="fsync" number="118"/> + <syscall name="sigreturn" number="119"/> + <syscall name="clone" number="120"/> + <syscall name="setdomainname" number="121"/> + <syscall name="uname" number="122"/> + <syscall name="modify_ldt" number="123"/> <!-- removed --> + <syscall name="adjtimex" number="124"/> + <syscall name="mprotect" number="125"/> + <syscall name="sigprocmask" number="126"/> + <syscall name="create_module" number="127"/> <!-- removed --> + <syscall name="init_module" number="128"/> + <syscall name="delete_module" number="129"/> + <syscall name="get_kernel_syms" number="130"/> <!-- removed --> + <syscall name="quotactl" number="131"/> + <syscall name="getpgid" number="132"/> + <syscall name="fchdir" number="133"/> + <syscall name="bdflush" number="134"/> + <syscall name="sysfs" number="135"/> + <syscall name="personality" number="136"/> + <syscall name="afs_syscall" number="137"/> <!-- removed --> + <syscall name="setfsuid" number="138"/> + <syscall name="setfsgid" number="139"/> + <syscall name="_llseek" number="140"/> + <syscall name="getdents" number="141"/> + <syscall name="_newselect" number="142"/> + <syscall name="flock" number="143"/> + <syscall name="msync" number="144"/> + <syscall name="readv" number="145"/> + <syscall name="writev" number="146"/> + <syscall name="getsid" number="147"/> + <syscall name="fdatasync" number="148"/> + <syscall name="_sysctl" number="149"/> + <syscall name="mlock" number="150"/> + <syscall name="munlock" number="151"/> + <syscall name="mlockall" number="152"/> + <syscall name="munlockall" number="153"/> + <syscall name="sched_setparam" number="154"/> + <syscall name="sched_getparam" number="155"/> + <syscall name="sched_setscheduler" number="156"/> + <syscall name="sched_getscheduler" number="157"/> + <syscall name="sched_yield" number="158"/> + <syscall name="sched_get_priority_max" number="159"/> + <syscall name="sched_get_priority_min" number="160"/> + <syscall name="sched_rr_get_interval" number="161"/> + <syscall name="nanosleep" number="162"/> + <syscall name="mremap" number="163"/> + <syscall name="setresuid" number="164"/> + <syscall name="getresuid" number="165"/> + <syscall name="vm86" number="166"/> <!-- removed --> + <syscall name="query_module" number="167"/> <!-- removed --> + <syscall name="poll" number="168"/> + <syscall name="nfsservctl" number="169"/> + <syscall name="setresgid" number="170"/> + <syscall name="getresgid" number="171"/> + <syscall name="prctl" number="172"/> + <syscall name="rt_sigreturn" number="173"/> + <syscall name="rt_sigaction" number="174"/> + <syscall name="rt_sigprocmask" number="175"/> + <syscall name="rt_sigpending" number="176"/> + <syscall name="rt_sigtimedwait" number="177"/> + <syscall name="rt_sigqueueinfo" number="178"/> + <syscall name="rt_sigsuspend" number="179"/> + <syscall name="pread64" number="180"/> + <syscall name="pwrite64" number="181"/> + <syscall name="chown" number="182"/> + <syscall name="getcwd" number="183"/> + <syscall name="capget" number="184"/> + <syscall name="capset" number="185"/> + <syscall name="sigaltstack" number="186"/> + <syscall name="sendfile" number="187"/> + <syscall name="vfork" number="190"/> + <syscall name="ugetrlimit" number="191"/> + <syscall name="mmap2" number="192"/> + <syscall name="truncate64" number="193"/> + <syscall name="ftruncate64" number="194"/> + <syscall name="stat64" number="195"/> + <syscall name="lstat64" number="196"/> + <syscall name="fstat64" number="197"/> + <syscall name="lchown32" number="198"/> + <syscall name="getuid32" number="199"/> + <syscall name="getgid32" number="200"/> + <syscall name="geteuid32" number="201"/> + <syscall name="getegid32" number="202"/> + <syscall name="setreuid32" number="203"/> + <syscall name="setregid32" number="204"/> + <syscall name="getgroups32" number="205"/> + <syscall name="setgroups32" number="206"/> + <syscall name="fchown32" number="207"/> + <syscall name="setresuid32" number="208"/> + <syscall name="getresuid32" number="209"/> + <syscall name="setresgid32" number="210"/> + <syscall name="getresgid32" number="211"/> + <syscall name="chown32" number="212"/> + <syscall name="setuid32" number="213"/> + <syscall name="setgid32" number="214"/> + <syscall name="setfsuid32" number="215"/> + <syscall name="setfsgid32" number="216"/> + <syscall name="getdents64" number="217"/> + <syscall name="pivot_root" number="218"/> + <syscall name="mincore" number="219"/> + <syscall name="madvise" number="220"/> + <syscall name="fcntl64" number="221"/> + <syscall name="gettid" number="224"/> + <syscall name="readahead" number="225"/> + <syscall name="setxattr" number="226"/> + <syscall name="lsetxattr" number="227"/> + <syscall name="fsetxattr" number="228"/> + <syscall name="getxattr" number="229"/> + <syscall name="lgetxattr" number="230"/> + <syscall name="fgetxattr" number="231"/> + <syscall name="listxattr" number="232"/> + <syscall name="llistxattr" number="233"/> + <syscall name="flistxattr" number="234"/> + <syscall name="removexattr" number="235"/> + <syscall name="lremovexattr" number="236"/> + <syscall name="fremovexattr" number="237"/> + <syscall name="tkill" number="238"/> + <syscall name="sendfile64" number="239"/> + <syscall name="futex" number="240"/> + <syscall name="sched_setaffinity" number="241"/> + <syscall name="sched_getaffinity" number="242"/> + <syscall name="io_setup" number="243"/> + <syscall name="io_destroy" number="244"/> + <syscall name="io_getevents" number="245"/> + <syscall name="io_submit" number="246"/> + <syscall name="io_cancel" number="247"/> + <syscall name="exit_group" number="248"/> + <syscall name="lookup_dcookie" number="249"/> + <syscall name="epoll_create" number="250"/> + <syscall name="epoll_ctl" number="251"/> + <syscall name="epoll_wait" number="252"/> + <syscall name="remap_file_pages" number="253"/> + <syscall name="set_tid_address" number="256"/> + <syscall name="timer_create" number="257"/> + <syscall name="timer_settime" number="258"/> + <syscall name="timer_gettime" number="259"/> + <syscall name="timer_getoverrun" number="260"/> + <syscall name="timer_delete" number="261"/> + <syscall name="clock_settime" number="262"/> + <syscall name="clock_gettime" number="263"/> + <syscall name="clock_getres" number="264"/> + <syscall name="clock_nanosleep" number="265"/> + <syscall name="statfs64" number="266"/> + <syscall name="fstatfs64" number="267"/> + <syscall name="tgkill" number="268"/> + <syscall name="utimes" number="269"/> + <syscall name="arm_fadvise64_64" number="270"/> + <syscall name="pciconfig_iobase" number="271"/> + <syscall name="pciconfig_read" number="272"/> + <syscall name="pciconfig_write" number="273"/> + <syscall name="mq_open" number="274"/> + <syscall name="mq_unlink" number="275"/> + <syscall name="mq_timedsend" number="276"/> + <syscall name="mq_timedreceive" number="277"/> + <syscall name="mq_notify" number="278"/> + <syscall name="mq_getsetattr" number="279"/> + <syscall name="waitid" number="280"/> + <syscall name="socket" number="281"/> + <syscall name="bind" number="282"/> + <syscall name="connect" number="283"/> + <syscall name="listen" number="284"/> + <syscall name="accept" number="285"/> + <syscall name="getsockname" number="286"/> + <syscall name="getpeername" number="287"/> + <syscall name="socketpair" number="288"/> + <syscall name="send" number="289"/> + <syscall name="sendto" number="290"/> + <syscall name="recv" number="291"/> + <syscall name="recvfrom" number="292"/> + <syscall name="shutdown" number="293"/> + <syscall name="setsockopt" number="294"/> + <syscall name="getsockopt" number="295"/> + <syscall name="sendmsg" number="296"/> + <syscall name="recvmsg" number="297"/> + <syscall name="semop" number="298"/> + <syscall name="semget" number="299"/> + <syscall name="semctl" number="300"/> + <syscall name="msgsnd" number="301"/> + <syscall name="msgrcv" number="302"/> + <syscall name="msgget" number="303"/> + <syscall name="msgctl" number="304"/> + <syscall name="shmat" number="305"/> + <syscall name="shmdt" number="306"/> + <syscall name="shmget" number="307"/> + <syscall name="shmctl" number="308"/> + <syscall name="add_key" number="309"/> + <syscall name="request_key" number="310"/> + <syscall name="keyctl" number="311"/> + <syscall name="semtimedop" number="312"/> + <syscall name="vserver" number="313"/> + <syscall name="ioprio_set" number="314"/> + <syscall name="ioprio_get" number="315"/> + <syscall name="inotify_init" number="316"/> + <syscall name="inotify_add_watch" number="317"/> + <syscall name="inotify_rm_watch" number="318"/> + <syscall name="mbind" number="319"/> + <syscall name="get_mempolicy" number="320"/> + <syscall name="set_mempolicy" number="321"/> + <syscall name="openat" number="322"/> + <syscall name="mkdirat" number="323"/> + <syscall name="mknodat" number="324"/> + <syscall name="fchownat" number="325"/> + <syscall name="futimesat" number="326"/> + <syscall name="fstatat64" number="327"/> + <syscall name="unlinkat" number="328"/> + <syscall name="renameat" number="329"/> + <syscall name="linkat" number="330"/> + <syscall name="symlinkat" number="331"/> + <syscall name="readlinkat" number="332"/> + <syscall name="fchmodat" number="333"/> + <syscall name="faccessat" number="334"/> + <syscall name="pselect6" number="335"/> + <syscall name="ppoll" number="336"/> + <syscall name="unshare" number="337"/> + <syscall name="set_robust_list" number="338"/> + <syscall name="get_robust_list" number="339"/> + <syscall name="splice" number="340"/> + <syscall name="arm_sync_file_range" number="341"/> + <syscall name="tee" number="342"/> + <syscall name="vmsplice" number="343"/> + <syscall name="move_pages" number="344"/> + <syscall name="getcpu" number="345"/> + <syscall name="epoll_pwait" number="346"/> + <syscall name="kexec_load" number="347"/> + <syscall name="utimensat" number="348"/> + <syscall name="signalfd" number="349"/> + <syscall name="timerfd_create" number="350"/> + <syscall name="eventfd" number="351"/> + <syscall name="fallocate" number="352"/> + <syscall name="timerfd_settime" number="353"/> + <syscall name="timerfd_gettime" number="354"/> + <syscall name="signalfd4" number="355"/> + <syscall name="eventfd2" number="356"/> + <syscall name="epoll_create1" number="357"/> + <syscall name="dup3" number="358"/> + <syscall name="pipe2" number="359"/> + <syscall name="inotify_init1" number="360"/> + <syscall name="preadv" number="361"/> + <syscall name="pwritev" number="362"/> + <syscall name="rt_tgsigqueueinfo" number="363"/> + <syscall name="perf_event_open" number="364"/> + <syscall name="recvmmsg" number="365"/> + <syscall name="accept4" number="366"/> + <syscall name="fanotify_init" number="367"/> + <syscall name="fanotify_mark" number="368"/> + <syscall name="prlimit64" number="369"/> + <syscall name="name_to_handle_at" number="370"/> + <syscall name="open_by_handle_at" number="371"/> + <syscall name="clock_adjtime" number="372"/> + <syscall name="syncfs" number="373"/> + <syscall name="sendmmsg" number="374"/> + <syscall name="setns" number="375"/> + <syscall name="process_vm_readv" number="376"/> + <syscall name="process_vm_writev" number="377"/> + <syscall name="kcmp" number="378"/> + <syscall name="finit_module" number="379"/> + <syscall name="ARM_breakpoint" number="983041"/> + <syscall name="ARM_cacheflush" number="983042"/> + <syscall name="ARM_usr26" number="983043"/> + <syscall name="ARM_usr32" number="983044"/> + <syscall name="ARM_set_tls" number="983045"/> +</syscalls_info> diff --git a/share/gdb/syscalls/gdb-syscalls.dtd b/share/gdb/syscalls/gdb-syscalls.dtd index 0735ecd..3ad3625 100644 --- a/share/gdb/syscalls/gdb-syscalls.dtd +++ b/share/gdb/syscalls/gdb-syscalls.dtd @@ -1,4 +1,4 @@ -<!-- Copyright (C) 2009, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/i386-linux.xml b/share/gdb/syscalls/i386-linux.xml index 3cb1251..3d890bd 100644 --- a/share/gdb/syscalls/i386-linux.xml +++ b/share/gdb/syscalls/i386-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2009, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/mips-n32-linux.xml b/share/gdb/syscalls/mips-n32-linux.xml index da4aba2..5c7a95d 100644 --- a/share/gdb/syscalls/mips-n32-linux.xml +++ b/share/gdb/syscalls/mips-n32-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2011-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/mips-n64-linux.xml b/share/gdb/syscalls/mips-n64-linux.xml index fc951c8..0a81573 100644 --- a/share/gdb/syscalls/mips-n64-linux.xml +++ b/share/gdb/syscalls/mips-n64-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2011-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/mips-o32-linux.xml b/share/gdb/syscalls/mips-o32-linux.xml index 939ed4e..97641b6 100644 --- a/share/gdb/syscalls/mips-o32-linux.xml +++ b/share/gdb/syscalls/mips-o32-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2011-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/ppc-linux.xml b/share/gdb/syscalls/ppc-linux.xml index 54728e3..b25d08c 100644 --- a/share/gdb/syscalls/ppc-linux.xml +++ b/share/gdb/syscalls/ppc-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2009, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/ppc64-linux.xml b/share/gdb/syscalls/ppc64-linux.xml index 0b0b2ea..c31415a 100644 --- a/share/gdb/syscalls/ppc64-linux.xml +++ b/share/gdb/syscalls/ppc64-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2009, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2009-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/sparc-linux.xml b/share/gdb/syscalls/sparc-linux.xml index 3820809..24d8612 100644 --- a/share/gdb/syscalls/sparc-linux.xml +++ b/share/gdb/syscalls/sparc-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2010, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2010-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/syscalls/sparc64-linux.xml b/share/gdb/syscalls/sparc64-linux.xml index df8118b..13c0cb7 100644 --- a/share/gdb/syscalls/sparc64-linux.xml +++ b/share/gdb/syscalls/sparc64-linux.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2010, 2011 Free Software Foundation, Inc. +<!-- Copyright (C) 2010-2014 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/share/gdb/system-gdbinit/elinos.py b/share/gdb/system-gdbinit/elinos.py new file mode 100644 index 0000000..cd35aed --- /dev/null +++ b/share/gdb/system-gdbinit/elinos.py @@ -0,0 +1,91 @@ +# Copyright (C) 2011-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""Configure GDB using the ELinOS environment.""" + +import os +import glob +import gdb + + +def warn(msg): + print "warning: %s" % msg + + +def get_elinos_environment(): + """Return the ELinOS environment. + + If the ELinOS environment is properly set up, return a dictionary + which contains: + * The path to the ELinOS project at key 'project'; + * The path to the ELinOS CDK at key 'cdk'; + * The ELinOS target name at key 'target' (Eg. 'i486-linux'); + * A list of Xenomai install prefixes (which could be empty, if + the ELinOS project does not include Xenomai) at key 'xenomai'. + + If one of these cannot be found, print a warning; the corresponding + value in the returned dictionary will be None. + """ + result = {} + for key in ("project", "cdk", "target"): + var = "ELINOS_" + key.upper() + if var in os.environ: + result[key] = os.environ[var] + else: + warn("%s not set" % var) + result[key] = None + + if result["project"] is not None: + result["xenomai"] = glob.glob(result["project"] + "/xenomai-[0-9.]*") + else: + result["xenomai"] = [] + + return result + + +def elinos_init(): + """Initialize debugger environment for ELinOS. + + Let the debugger know where to find the ELinOS libraries on host. This + assumes that an ELinOS environment is properly set up. If some environment + variables are missing, warn about which library may be missing. + """ + elinos_env = get_elinos_environment() + + solib_dirs = [] + + # System libraries + if None in (elinos_env[key] for key in ("cdk", "target")): + warn("ELinOS system libraries will not be loaded") + else: + solib_prefix = "%s/%s" % (elinos_env["cdk"], elinos_env["target"]) + solib_dirs += ["%s/%s" % (solib_prefix, "lib")] + gdb.execute("set solib-absolute-prefix %s" % solib_prefix) + + # Xenomai libraries. Those are optional, so have a lighter warning + # if they cannot be located. + if elinos_env["project"] is None: + warn("Xenomai libraries may not be loaded") + else: + for dir in elinos_env['xenomai']: + solib_dirs += ["%s/%s" + % (dir, "xenomai-build/usr/realtime/lib")] + + if len(solib_dirs) != 0: + gdb.execute("set solib-search-path %s" % ":".join(solib_dirs)) + + +if __name__ == "__main__": + elinos_init() diff --git a/share/gdb/system-gdbinit/wrs-linux.py b/share/gdb/system-gdbinit/wrs-linux.py new file mode 100644 index 0000000..54ec9ec --- /dev/null +++ b/share/gdb/system-gdbinit/wrs-linux.py @@ -0,0 +1,25 @@ +# Copyright (C) 2011-2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +"""Configure GDB using the WRS/Linux environment.""" + +import os + +if 'ENV_PREFIX' in os.environ: + gdb.execute('set sysroot %s' % os.environ['ENV_PREFIX']) + +else: + print "warning: ENV_PREFIX environment variable missing." + print "The debugger will probably be unable to find the correct system libraries" |