Initial Upload -- gdb 7.6 without python

master
Soft Ginger 2013-08-01 08:33:51 +08:00
parent 97bd2da59d
commit 09ec0de459
81 changed files with 98288 additions and 0 deletions

BIN
local/bin/gdb.exe Normal file

Binary file not shown.

BIN
local/bin/gdbserver.exe Normal file

Binary file not shown.

441
local/include/ansidecl.h Normal file
View File

@ -0,0 +1,441 @@
/* ANSI and traditional C compatability macros
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 2 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, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* ANSI and traditional C compatibility macros
ANSI C is assumed if __STDC__ is #defined.
Macro ANSI C definition Traditional C definition
----- ---- - ---------- ----------- - ----------
ANSI_PROTOTYPES 1 not defined
PTR `void *' `char *'
PTRCONST `void *const' `char *'
LONG_DOUBLE `long double' `double'
const not defined `'
volatile not defined `'
signed not defined `'
VA_START(ap, var) va_start(ap, var) va_start(ap)
Note that it is safe to write "void foo();" indicating a function
with no return value, in all K+R compilers we have been able to test.
For declaring functions with prototypes, we also provide these:
PARAMS ((prototype))
-- for functions which take a fixed number of arguments. Use this
when declaring the function. When defining the function, write a
K+R style argument list. For example:
char *strcpy PARAMS ((char *dest, char *source));
...
char *
strcpy (dest, source)
char *dest;
char *source;
{ ... }
VPARAMS ((prototype, ...))
-- for functions which take a variable number of arguments. Use
PARAMS to declare the function, VPARAMS to define it. For example:
int printf PARAMS ((const char *format, ...));
...
int
printf VPARAMS ((const char *format, ...))
{
...
}
For writing functions which take variable numbers of arguments, we
also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
thoroughly than the simple VA_START() macro mentioned above.
VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
corresponding to the list of fixed arguments. Then use va_arg
normally to get the variable arguments, or pass your va_list object
around. You do not declare the va_list yourself; VA_OPEN does it
for you.
Here is a complete example:
int
printf VPARAMS ((const char *format, ...))
{
int result;
VA_OPEN (ap, format);
VA_FIXEDARG (ap, const char *, format);
result = vfprintf (stdout, format, ap);
VA_CLOSE (ap);
return result;
}
You can declare variables either before or after the VA_OPEN,
VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
and end of a block. They must appear at the same nesting level,
and any variables declared after VA_OPEN go out of scope at
VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
pairs in a single function in case you need to traverse the
argument list more than once.
For ease of writing code which uses GCC extensions but needs to be
portable to other compilers, we provide the GCC_VERSION macro that
simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
wrappers around __attribute__. Also, __extension__ will be #defined
to nothing if it doesn't work. See below.
This header also defines a lot of obsolete macros:
CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
AND, DOTS, NOARGS. Don't use them. */
#ifndef _ANSIDECL_H
#define _ANSIDECL_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* Every source file includes this file,
so they will all get the switch for lint. */
/* LINTLIBRARY */
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
older preprocessors. Thus we can't define something like this:
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
and then test "#if HAVE_GCC_VERSION(2,7)".
So instead we use the macro below and test it against specific values. */
/* This macro simplifies testing whether we are using gcc, and if it
is of a particular minimum version. (Both major & minor numbers are
significant.) This macro will evaluate to 0 if we are not using
gcc at all. */
#ifndef GCC_VERSION
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif /* GCC_VERSION */
#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
C++ compilers, does not define __STDC__, though it acts as if this
was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
#define ANSI_PROTOTYPES 1
#define PTR void *
#define PTRCONST void *const
#define LONG_DOUBLE long double
/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in
a #ifndef. */
#ifndef PARAMS
#define PARAMS(ARGS) ARGS
#endif
#define VPARAMS(ARGS) ARGS
#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
/* variadic function helper macros */
/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
use without inhibiting further decls and without declaring an
actual variable. */
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
#define VA_CLOSE(AP) } va_end(AP); }
#define VA_FIXEDARG(AP, T, N) struct Qdmy
#undef const
#undef volatile
#undef signed
/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
it too, but it's not in C89. */
#undef inline
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
/* it's a keyword */
#else
# if GCC_VERSION >= 2007
# define inline __inline__ /* __inline__ prevents -pedantic warnings */
# else
# define inline /* nothing */
# endif
#endif
/* These are obsolete. Do not use. */
#ifndef IN_GCC
#define CONST const
#define VOLATILE volatile
#define SIGNED signed
#define PROTO(type, name, arglist) type name arglist
#define EXFUN(name, proto) name proto
#define DEFUN(name, arglist, args) name(args)
#define DEFUN_VOID(name) name(void)
#define AND ,
#define DOTS , ...
#define NOARGS void
#endif /* ! IN_GCC */
#else /* Not ANSI C. */
#undef ANSI_PROTOTYPES
#define PTR char *
#define PTRCONST PTR
#define LONG_DOUBLE double
#define PARAMS(args) ()
#define VPARAMS(args) (va_alist) va_dcl
#define VA_START(va_list, var) va_start(va_list)
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
#define VA_CLOSE(AP) } va_end(AP); }
#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
/* some systems define these in header files for non-ansi mode */
#undef const
#undef volatile
#undef signed
#undef inline
#define const
#define volatile
#define signed
#define inline
#ifndef IN_GCC
#define CONST
#define VOLATILE
#define SIGNED
#define PROTO(type, name, arglist) type name ()
#define EXFUN(name, proto) name()
#define DEFUN(name, arglist, args) name arglist args;
#define DEFUN_VOID(name) name()
#define AND ;
#define DOTS
#define NOARGS
#endif /* ! IN_GCC */
#endif /* ANSI C. */
/* Define macros for some gcc attributes. This permits us to use the
macros freely, and know that they will come into play for the
version of gcc in which they are supported. */
#if (GCC_VERSION < 2007)
# define __attribute__(x)
#endif
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
#ifndef ATTRIBUTE_MALLOC
# if (GCC_VERSION >= 2096)
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
# else
# define ATTRIBUTE_MALLOC
# endif /* GNUC >= 2.96 */
#endif /* ATTRIBUTE_MALLOC */
/* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For
g++ an attribute on a label must be followed by a semicolon. */
#ifndef ATTRIBUTE_UNUSED_LABEL
# ifndef __cplusplus
# if GCC_VERSION >= 2093
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
# else
# define ATTRIBUTE_UNUSED_LABEL
# endif
# else
# if GCC_VERSION >= 4005
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ;
# else
# define ATTRIBUTE_UNUSED_LABEL
# endif
# endif
#endif
/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend
couldn't parse attributes placed after the identifier name, and now
the entire compiler is built with C++. */
#ifndef ATTRIBUTE_UNUSED
#if GCC_VERSION >= 3004
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#else
#define ATTRIBUTE_UNUSED
#endif
#endif /* ATTRIBUTE_UNUSED */
/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
identifier name. */
#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
#else /* !__cplusplus || GNUC >= 3.4 */
# define ARG_UNUSED(NAME) NAME
#endif /* !__cplusplus || GNUC >= 3.4 */
#ifndef ATTRIBUTE_NORETURN
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif /* ATTRIBUTE_NORETURN */
/* Attribute `nonnull' was valid as of gcc 3.3. */
#ifndef ATTRIBUTE_NONNULL
# if (GCC_VERSION >= 3003)
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
# else
# define ATTRIBUTE_NONNULL(m)
# endif /* GNUC >= 3.3 */
#endif /* ATTRIBUTE_NONNULL */
/* Attribute `pure' was valid as of gcc 3.0. */
#ifndef ATTRIBUTE_PURE
# if (GCC_VERSION >= 3000)
# define ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
# define ATTRIBUTE_PURE
# endif /* GNUC >= 3.0 */
#endif /* ATTRIBUTE_PURE */
/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
This was the case for the `printf' format attribute by itself
before GCC 3.3, but as of 3.3 we need to add the `nonnull'
attribute to retain this behavior. */
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
#endif /* ATTRIBUTE_PRINTF */
/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on
a function pointer. Format attributes were allowed on function
pointers as of gcc 3.1. */
#ifndef ATTRIBUTE_FPTR_PRINTF
# if (GCC_VERSION >= 3001)
# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n)
# else
# define ATTRIBUTE_FPTR_PRINTF(m, n)
# endif /* GNUC >= 3.1 */
# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2)
# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3)
# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4)
# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5)
# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6)
#endif /* ATTRIBUTE_FPTR_PRINTF */
/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
NULL format specifier was allowed as of gcc 3.3. */
#ifndef ATTRIBUTE_NULL_PRINTF
# if (GCC_VERSION >= 3003)
# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
# else
# define ATTRIBUTE_NULL_PRINTF(m, n)
# endif /* GNUC >= 3.3 */
# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
#endif /* ATTRIBUTE_NULL_PRINTF */
/* Attribute `sentinel' was valid as of gcc 3.5. */
#ifndef ATTRIBUTE_SENTINEL
# if (GCC_VERSION >= 3005)
# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
# else
# define ATTRIBUTE_SENTINEL
# endif /* GNUC >= 3.5 */
#endif /* ATTRIBUTE_SENTINEL */
#ifndef ATTRIBUTE_ALIGNED_ALIGNOF
# if (GCC_VERSION >= 3000)
# define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
# else
# define ATTRIBUTE_ALIGNED_ALIGNOF(m)
# endif /* GNUC >= 3.0 */
#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
/* Useful for structures whose layout must much some binary specification
regardless of the alignment and padding qualities of the compiler. */
#ifndef ATTRIBUTE_PACKED
# define ATTRIBUTE_PACKED __attribute__ ((packed))
#endif
/* Attribute `hot' and `cold' was valid as of gcc 4.3. */
#ifndef ATTRIBUTE_COLD
# if (GCC_VERSION >= 4003)
# define ATTRIBUTE_COLD __attribute__ ((__cold__))
# else
# define ATTRIBUTE_COLD
# endif /* GNUC >= 4.3 */
#endif /* ATTRIBUTE_COLD */
#ifndef ATTRIBUTE_HOT
# if (GCC_VERSION >= 4003)
# define ATTRIBUTE_HOT __attribute__ ((__hot__))
# else
# define ATTRIBUTE_HOT
# endif /* GNUC >= 4.3 */
#endif /* ATTRIBUTE_HOT */
/* We use __extension__ in some places to suppress -pedantic warnings
about GCC extensions. This feature didn't work properly before
gcc 2.8. */
#if GCC_VERSION < 2008
#define __extension__
#endif
/* This is used to declare a const variable which should be visible
outside of the current compilation unit. Use it as
EXPORTED_CONST int i = 1;
This is because the semantics of const are different in C and C++.
"extern const" is permitted in C but it looks strange, and gcc
warns about it when -Wc++-compat is not used. */
#ifdef __cplusplus
#define EXPORTED_CONST extern const
#else
#define EXPORTED_CONST const
#endif
/* Be conservative and only use enum bitfields with C++ or GCC.
FIXME: provide a complete autoconf test for buggy enum bitfields. */
#ifdef __cplusplus
#define ENUM_BITFIELD(TYPE) enum TYPE
#elif (GCC_VERSION > 2000)
#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
#else
#define ENUM_BITFIELD(TYPE) unsigned int
#endif
#ifdef __cplusplus
}
#endif
#endif /* ansidecl.h */

6959
local/include/bfd.h Normal file

File diff suppressed because it is too large Load Diff

842
local/include/bfdlink.h Normal file
View File

@ -0,0 +1,842 @@
/* bfdlink.h -- header file for BFD link routines
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
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, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#ifndef BFDLINK_H
#define BFDLINK_H
/* Which symbols to strip during a link. */
enum bfd_link_strip
{
strip_none, /* Don't strip any symbols. */
strip_debugger, /* Strip debugging symbols. */
strip_some, /* keep_hash is the list of symbols to keep. */
strip_all /* Strip all symbols. */
};
/* Which local symbols to discard during a link. This is irrelevant
if strip_all is used. */
enum bfd_link_discard
{
discard_sec_merge, /* Discard local temporary symbols in SEC_MERGE
sections. */
discard_none, /* Don't discard any locals. */
discard_l, /* Discard local temporary symbols. */
discard_all /* Discard all locals. */
};
/* Describes the type of hash table entry structure being used.
Different hash table structure have different fields and so
support different linking features. */
enum bfd_link_hash_table_type
{
bfd_link_generic_hash_table,
bfd_link_elf_hash_table
};
/* These are the possible types of an entry in the BFD link hash
table. */
enum bfd_link_hash_type
{
bfd_link_hash_new, /* Symbol is new. */
bfd_link_hash_undefined, /* Symbol seen before, but undefined. */
bfd_link_hash_undefweak, /* Symbol is weak and undefined. */
bfd_link_hash_defined, /* Symbol is defined. */
bfd_link_hash_defweak, /* Symbol is weak and defined. */
bfd_link_hash_common, /* Symbol is common. */
bfd_link_hash_indirect, /* Symbol is an indirect link. */
bfd_link_hash_warning /* Like indirect, but warn if referenced. */
};
enum bfd_link_common_skip_ar_symbols
{
bfd_link_common_skip_none,
bfd_link_common_skip_text,
bfd_link_common_skip_data,
bfd_link_common_skip_all
};
struct bfd_link_hash_common_entry
{
unsigned int alignment_power; /* Alignment. */
asection *section; /* Symbol section. */
};
/* The linking routines use a hash table which uses this structure for
its elements. */
struct bfd_link_hash_entry
{
/* Base hash table entry structure. */
struct bfd_hash_entry root;
/* Type of this entry. */
ENUM_BITFIELD (bfd_link_hash_type) type : 8;
unsigned int non_ir_ref : 1;
/* A union of information depending upon the type. */
union
{
/* Nothing is kept for bfd_hash_new. */
/* bfd_link_hash_undefined, bfd_link_hash_undefweak. */
struct
{
/* Undefined and common symbols are kept in a linked list through
this field. This field is present in all of the union element
so that we don't need to remove entries from the list when we
change their type. Removing entries would either require the
list to be doubly linked, which would waste more memory, or
require a traversal. When an undefined or common symbol is
created, it should be added to this list, the head of which is in
the link hash table itself. As symbols are defined, they need
not be removed from the list; anything which reads the list must
doublecheck the symbol type.
Weak symbols are not kept on this list.
Defined and defweak symbols use this field as a reference marker.
If the field is not NULL, or this structure is the tail of the
undefined symbol list, the symbol has been referenced. If the
symbol is undefined and becomes defined, this field will
automatically be non-NULL since the symbol will have been on the
undefined symbol list. */
struct bfd_link_hash_entry *next;
bfd *abfd; /* BFD symbol was found in. */
} undef;
/* bfd_link_hash_defined, bfd_link_hash_defweak. */
struct
{
struct bfd_link_hash_entry *next;
asection *section; /* Symbol section. */
bfd_vma value; /* Symbol value. */
} def;
/* bfd_link_hash_indirect, bfd_link_hash_warning. */
struct
{
struct bfd_link_hash_entry *next;
struct bfd_link_hash_entry *link; /* Real symbol. */
const char *warning; /* Warning (bfd_link_hash_warning only). */
} i;
/* bfd_link_hash_common. */
struct
{
struct bfd_link_hash_entry *next;
/* The linker needs to know three things about common
symbols: the size, the alignment, and the section in
which the symbol should be placed. We store the size
here, and we allocate a small structure to hold the
section and the alignment. The alignment is stored as a
power of two. We don't store all the information
directly because we don't want to increase the size of
the union; this structure is a major space user in the
linker. */
struct bfd_link_hash_common_entry *p;
bfd_size_type size; /* Common symbol size. */
} c;
} u;
};
/* This is the link hash table. It is a derived class of
bfd_hash_table. */
struct bfd_link_hash_table
{
/* The hash table itself. */
struct bfd_hash_table table;
/* A linked list of undefined and common symbols, linked through the
next field in the bfd_link_hash_entry structure. */
struct bfd_link_hash_entry *undefs;
/* Entries are added to the tail of the undefs list. */
struct bfd_link_hash_entry *undefs_tail;
/* The type of the link hash table. */
enum bfd_link_hash_table_type type;
};
/* Look up an entry in a link hash table. If FOLLOW is TRUE, this
follows bfd_link_hash_indirect and bfd_link_hash_warning links to
the real symbol. */
extern struct bfd_link_hash_entry *bfd_link_hash_lookup
(struct bfd_link_hash_table *, const char *, bfd_boolean create,
bfd_boolean copy, bfd_boolean follow);
/* Look up an entry in the main linker hash table if the symbol might
be wrapped. This should only be used for references to an
undefined symbol, not for definitions of a symbol. */
extern struct bfd_link_hash_entry *bfd_wrapped_link_hash_lookup
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
bfd_boolean, bfd_boolean);
/* Traverse a link hash table. */
extern void bfd_link_hash_traverse
(struct bfd_link_hash_table *,
bfd_boolean (*) (struct bfd_link_hash_entry *, void *),
void *);
/* Add an entry to the undefs list. */
extern void bfd_link_add_undef
(struct bfd_link_hash_table *, struct bfd_link_hash_entry *);
/* Remove symbols from the undefs list that don't belong there. */
extern void bfd_link_repair_undef_list
(struct bfd_link_hash_table *table);
/* Read symbols and cache symbol pointer array in outsymbols. */
extern bfd_boolean bfd_generic_link_read_symbols (bfd *);
struct bfd_sym_chain
{
struct bfd_sym_chain *next;
const char *name;
};
/* How to handle unresolved symbols.
There are four possibilities which are enumerated below: */
enum report_method
{
/* This is the initial value when then link_info structure is created.
It allows the various stages of the linker to determine whether they
allowed to set the value. */
RM_NOT_YET_SET = 0,
RM_IGNORE,
RM_GENERATE_WARNING,
RM_GENERATE_ERROR
};
typedef enum {with_flags, without_flags} flag_type;
/* A section flag list. */
struct flag_info_list
{
flag_type with;
const char *name;
bfd_boolean valid;
struct flag_info_list *next;
};
/* Section flag info. */
struct flag_info
{
flagword only_with_flags;
flagword not_with_flags;
struct flag_info_list *flag_list;
bfd_boolean flags_initialized;
};
struct bfd_elf_dynamic_list;
struct bfd_elf_version_tree;
/* This structure holds all the information needed to communicate
between BFD and the linker when doing a link. */
struct bfd_link_info
{
/* TRUE if BFD should generate a shared object (or a pie). */
unsigned int shared: 1;
/* TRUE if generating an executable, position independent or not. */
unsigned int executable : 1;
/* TRUE if generating a position independent executable. */
unsigned int pie: 1;
/* TRUE if BFD should generate a relocatable object file. */
unsigned int relocatable: 1;
/* TRUE if BFD should pre-bind symbols in a shared object. */
unsigned int symbolic: 1;
/* TRUE if executable should not contain copy relocs.
Setting this true may result in a non-sharable text segment. */
unsigned int nocopyreloc: 1;
/* TRUE if BFD should export all symbols in the dynamic symbol table
of an executable, rather than only those used. */
unsigned int export_dynamic: 1;
/* TRUE if a default symbol version should be created and used for
exported symbols. */
unsigned int create_default_symver: 1;
/* TRUE if unreferenced sections should be removed. */
unsigned int gc_sections: 1;
/* TRUE if every symbol should be reported back via the notice
callback. */
unsigned int notice_all: 1;
/* TRUE if we are loading LTO outputs. */
unsigned int loading_lto_outputs: 1;
/* TRUE if global symbols in discarded sections should be stripped. */
unsigned int strip_discarded: 1;
/* TRUE if all data symbols should be dynamic. */
unsigned int dynamic_data: 1;
/* Which symbols to strip. */
ENUM_BITFIELD (bfd_link_strip) strip : 2;
/* Which local symbols to discard. */
ENUM_BITFIELD (bfd_link_discard) discard : 2;
/* Criteria for skipping symbols when determining
whether to include an object from an archive. */
ENUM_BITFIELD (bfd_link_common_skip_ar_symbols) common_skip_ar_symbols : 2;
/* What to do with unresolved symbols in an object file.
When producing executables the default is GENERATE_ERROR.
When producing shared libraries the default is IGNORE. The
assumption with shared libraries is that the reference will be
resolved at load/execution time. */
ENUM_BITFIELD (report_method) unresolved_syms_in_objects : 2;
/* What to do with unresolved symbols in a shared library.
The same defaults apply. */
ENUM_BITFIELD (report_method) unresolved_syms_in_shared_libs : 2;
/* TRUE if shared objects should be linked directly, not shared. */
unsigned int static_link: 1;
/* TRUE if symbols should be retained in memory, FALSE if they
should be freed and reread. */
unsigned int keep_memory: 1;
/* TRUE if BFD should generate relocation information in the final
executable. */
unsigned int emitrelocations: 1;
/* TRUE if PT_GNU_RELRO segment should be created. */
unsigned int relro: 1;
/* TRUE if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
should be created. */
unsigned int eh_frame_hdr: 1;
/* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
unsigned int warn_shared_textrel: 1;
/* TRUE if we should error when adding a DT_TEXTREL. */
unsigned int error_textrel: 1;
/* TRUE if .hash section should be created. */
unsigned int emit_hash: 1;
/* TRUE if .gnu.hash section should be created. */
unsigned int emit_gnu_hash: 1;
/* If TRUE reduce memory overheads, at the expense of speed. This will
cause map file generation to use an O(N^2) algorithm and disable
caching ELF symbol buffer. */
unsigned int reduce_memory_overheads: 1;
/* TRUE if the output file should be in a traditional format. This
is equivalent to the setting of the BFD_TRADITIONAL_FORMAT flag
on the output file, but may be checked when reading the input
files. */
unsigned int traditional_format: 1;
/* TRUE if non-PLT relocs should be merged into one reloc section
and sorted so that relocs against the same symbol come together. */
unsigned int combreloc: 1;
/* TRUE if a default symbol version should be created and used for
imported symbols. */
unsigned int default_imported_symver: 1;
/* TRUE if the new ELF dynamic tags are enabled. */
unsigned int new_dtags: 1;
/* FALSE if .eh_frame unwind info should be generated for PLT and other
linker created sections, TRUE if it should be omitted. */
unsigned int no_ld_generated_unwind_info: 1;
/* TRUE if BFD should generate a "task linked" object file,
similar to relocatable but also with globals converted to
statics. */
unsigned int task_link: 1;
/* TRUE if ok to have multiple definition. */
unsigned int allow_multiple_definition: 1;
/* TRUE if ok to have version with no definition. */
unsigned int allow_undefined_version: 1;
/* TRUE if some symbols have to be dynamic, controlled by
--dynamic-list command line options. */
unsigned int dynamic: 1;
/* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W|PF_X
flags. */
unsigned int execstack: 1;
/* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W
flags. */
unsigned int noexecstack: 1;
/* TRUE if we want to produced optimized output files. This might
need much more time and therefore must be explicitly selected. */
unsigned int optimize: 1;
/* TRUE if user should be informed of removed unreferenced sections. */
unsigned int print_gc_sections: 1;
/* TRUE if we should warn alternate ELF machine code. */
unsigned int warn_alternate_em: 1;
/* TRUE if the linker script contained an explicit PHDRS command. */
unsigned int user_phdrs: 1;
/* Char that may appear as the first char of a symbol, but should be
skipped (like symbol_leading_char) when looking up symbols in
wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
char wrap_char;
/* Separator between archive and filename in linker script filespecs. */
char path_separator;
/* Default stack size. Zero means default (often zero itself), -1
means explicitly zero-sized. */
bfd_signed_vma stacksize;
/* Enable or disable target specific optimizations.
Not all targets have optimizations to enable.
Normally these optimizations are disabled by default but some targets
prefer to enable them by default. So this field is a tri-state variable.
The values are:
zero: Enable the optimizations (either from --relax being specified on
the command line or the backend's before_allocation emulation function.
positive: The user has requested that these optimizations be disabled.
(Via the --no-relax command line option).
negative: The optimizations are disabled. (Set when initializing the
args_type structure in ldmain.c:main. */
signed int disable_target_specific_optimizations;
/* Function callbacks. */
const struct bfd_link_callbacks *callbacks;
/* Hash table handled by BFD. */
struct bfd_link_hash_table *hash;
/* Hash table of symbols to keep. This is NULL unless strip is
strip_some. */
struct bfd_hash_table *keep_hash;
/* Hash table of symbols to report back via the notice callback. If
this is NULL, and notice_all is FALSE, then no symbols are
reported back. */
struct bfd_hash_table *notice_hash;
/* Hash table of symbols which are being wrapped (the --wrap linker
option). If this is NULL, no symbols are being wrapped. */
struct bfd_hash_table *wrap_hash;
/* Hash table of symbols which may be left unresolved during
a link. If this is NULL, no symbols can be left unresolved. */
struct bfd_hash_table *ignore_hash;
/* The output BFD. */
bfd *output_bfd;
/* The list of input BFD's involved in the link. These are chained
together via the link_next field. */
bfd *input_bfds;
bfd **input_bfds_tail;
/* If a symbol should be created for each input BFD, this is section
where those symbols should be placed. It must be a section in
the output BFD. It may be NULL, in which case no such symbols
will be created. This is to support CREATE_OBJECT_SYMBOLS in the
linker command language. */
asection *create_object_symbols_section;
/* List of global symbol names that are starting points for marking
sections against garbage collection. */
struct bfd_sym_chain *gc_sym_list;
/* If a base output file is wanted, then this points to it */
void *base_file;
/* The function to call when the executable or shared object is
loaded. */
const char *init_function;
/* The function to call when the executable or shared object is
unloaded. */
const char *fini_function;
/* Number of relaxation passes. Usually only one relaxation pass
is needed. But a backend can have as many relaxation passes as
necessary. During bfd_relax_section call, it is set to the
current pass, starting from 0. */
int relax_pass;
/* Number of relaxation trips. This number is incremented every
time the relaxation pass is restarted due to a previous
relaxation returning true in *AGAIN. */
int relax_trip;
/* Non-zero if auto-import thunks for DATA items in pei386 DLLs
should be generated/linked against. Set to 1 if this feature
is explicitly requested by the user, -1 if enabled by default. */
int pei386_auto_import;
/* Non-zero if runtime relocs for DATA items with non-zero addends
in pei386 DLLs should be generated. Set to 1 if this feature
is explicitly requested by the user, -1 if enabled by default. */
int pei386_runtime_pseudo_reloc;
/* How many spare .dynamic DT_NULL entries should be added? */
unsigned int spare_dynamic_tags;
/* May be used to set DT_FLAGS for ELF. */
bfd_vma flags;
/* May be used to set DT_FLAGS_1 for ELF. */
bfd_vma flags_1;
/* Start and end of RELRO region. */
bfd_vma relro_start, relro_end;
/* List of symbols should be dynamic. */
struct bfd_elf_dynamic_list *dynamic_list;
/* The version information. */
struct bfd_elf_version_tree *version_info;
};
/* This structures holds a set of callback functions. These are called
by the BFD linker routines. Except for the info functions, the first
argument to each callback function is the bfd_link_info structure
being used and each function returns a boolean value. If the
function returns FALSE, then the BFD function which called it should
return with a failure indication. */
struct bfd_link_callbacks
{
/* A function which is called when an object is added from an
archive. ABFD is the archive element being added. NAME is the
name of the symbol which caused the archive element to be pulled
in. This function may set *SUBSBFD to point to an alternative
BFD from which symbols should in fact be added in place of the
original BFD's symbols. */
bfd_boolean (*add_archive_element)
(struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
/* A function which is called when a symbol is found with multiple
definitions. H is the symbol which is defined multiple times.
NBFD is the new BFD, NSEC is the new section, and NVAL is the new
value. NSEC may be bfd_com_section or bfd_ind_section. */
bfd_boolean (*multiple_definition)
(struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *nbfd, asection *nsec, bfd_vma nval);
/* A function which is called when a common symbol is defined
multiple times. H is the symbol appearing multiple times.
NBFD is the BFD of the new symbol. NTYPE is the type of the new
symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or
bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
is the size of the new symbol. */
bfd_boolean (*multiple_common)
(struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
/* A function which is called to add a symbol to a set. ENTRY is
the link hash table entry for the set itself (e.g.,
__CTOR_LIST__). RELOC is the relocation to use for an entry in
the set when generating a relocatable file, and is also used to
get the size of the entry when generating an executable file.
ABFD, SEC and VALUE identify the value to add to the set. */
bfd_boolean (*add_to_set)
(struct bfd_link_info *, struct bfd_link_hash_entry *entry,
bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value);
/* A function which is called when the name of a g++ constructor or
destructor is found. This is only called by some object file
formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a
destructor. This will use BFD_RELOC_CTOR when generating a
relocatable file. NAME is the name of the symbol found. ABFD,
SECTION and VALUE are the value of the symbol. */
bfd_boolean (*constructor)
(struct bfd_link_info *, bfd_boolean constructor, const char *name,
bfd *abfd, asection *sec, bfd_vma value);
/* A function which is called to issue a linker warning. For
example, this is called when there is a reference to a warning
symbol. WARNING is the warning to be issued. SYMBOL is the name
of the symbol which triggered the warning; it may be NULL if
there is none. ABFD, SECTION and ADDRESS identify the location
which trigerred the warning; either ABFD or SECTION or both may
be NULL if the location is not known. */
bfd_boolean (*warning)
(struct bfd_link_info *, const char *warning, const char *symbol,
bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a relocation is attempted against
an undefined symbol. NAME is the symbol which is undefined.
ABFD, SECTION and ADDRESS identify the location from which the
reference is made. IS_FATAL indicates whether an undefined symbol is
a fatal error or not. In some cases SECTION may be NULL. */
bfd_boolean (*undefined_symbol)
(struct bfd_link_info *, const char *name, bfd *abfd,
asection *section, bfd_vma address, bfd_boolean is_fatal);
/* A function which is called when a reloc overflow occurs. ENTRY is
the link hash table entry for the symbol the reloc is against.
NAME is the name of the local symbol or section the reloc is
against, RELOC_NAME is the name of the relocation, and ADDEND is
any addend that is used. ABFD, SECTION and ADDRESS identify the
location at which the overflow occurs; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*reloc_overflow)
(struct bfd_link_info *, struct bfd_link_hash_entry *entry,
const char *name, const char *reloc_name, bfd_vma addend,
bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a dangerous reloc is performed.
MESSAGE is an appropriate message.
ABFD, SECTION and ADDRESS identify the location at which the
problem occurred; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*reloc_dangerous)
(struct bfd_link_info *, const char *message,
bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a reloc is found to be attached
to a symbol which is not being written out. NAME is the name of
the symbol. ABFD, SECTION and ADDRESS identify the location of
the reloc; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*unattached_reloc)
(struct bfd_link_info *, const char *name,
bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a symbol in notice_hash is
defined or referenced. H is the symbol. ABFD, SECTION and
ADDRESS are the (new) value of the symbol. If SECTION is
bfd_und_section, this is a reference. FLAGS are the symbol
BSF_* flags. STRING is the name of the symbol to indirect to if
the sym is indirect, or the warning string if a warning sym. */
bfd_boolean (*notice)
(struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *abfd, asection *section, bfd_vma address, flagword flags,
const char *string);
/* Error or warning link info message. */
void (*einfo)
(const char *fmt, ...);
/* General link info message. */
void (*info)
(const char *fmt, ...);
/* Message to be printed in linker map file. */
void (*minfo)
(const char *fmt, ...);
/* This callback provides a chance for users of the BFD library to
override its decision about whether to place two adjacent sections
into the same segment. */
bfd_boolean (*override_segment_assignment)
(struct bfd_link_info *, bfd * abfd,
asection * current_section, asection * previous_section,
bfd_boolean new_segment);
};
/* The linker builds link_order structures which tell the code how to
include input data in the output file. */
/* These are the types of link_order structures. */
enum bfd_link_order_type
{
bfd_undefined_link_order, /* Undefined. */
bfd_indirect_link_order, /* Built from a section. */
bfd_data_link_order, /* Set to explicit data. */
bfd_section_reloc_link_order, /* Relocate against a section. */
bfd_symbol_reloc_link_order /* Relocate against a symbol. */
};
/* This is the link_order structure itself. These form a chain
attached to the output section whose contents they are describing. */
struct bfd_link_order
{
/* Next link_order in chain. */
struct bfd_link_order *next;
/* Type of link_order. */
enum bfd_link_order_type type;
/* Offset within output section. */
bfd_vma offset;
/* Size within output section. */
bfd_size_type size;
/* Type specific information. */
union
{
struct
{
/* Section to include. If this is used, then
section->output_section must be the section the
link_order is attached to, section->output_offset must
equal the link_order offset field, and section->size
must equal the link_order size field. Maybe these
restrictions should be relaxed someday. */
asection *section;
} indirect;
struct
{
/* Size of contents, or zero when contents should be filled by
the architecture-dependent fill function.
A non-zero value allows filling of the output section
with an arbitrary repeated pattern. */
unsigned int size;
/* Data to put into file. */
bfd_byte *contents;
} data;
struct
{
/* Description of reloc to generate. Used for
bfd_section_reloc_link_order and
bfd_symbol_reloc_link_order. */
struct bfd_link_order_reloc *p;
} reloc;
} u;
};
/* A linker order of type bfd_section_reloc_link_order or
bfd_symbol_reloc_link_order means to create a reloc against a
section or symbol, respectively. This is used to implement -Ur to
generate relocs for the constructor tables. The
bfd_link_order_reloc structure describes the reloc that BFD should
create. It is similar to a arelent, but I didn't use arelent
because the linker does not know anything about most symbols, and
any asymbol structure it creates will be partially meaningless.
This information could logically be in the bfd_link_order struct,
but I didn't want to waste the space since these types of relocs
are relatively rare. */
struct bfd_link_order_reloc
{
/* Reloc type. */
bfd_reloc_code_real_type reloc;
union
{
/* For type bfd_section_reloc_link_order, this is the section
the reloc should be against. This must be a section in the
output BFD, not any of the input BFDs. */
asection *section;
/* For type bfd_symbol_reloc_link_order, this is the name of the
symbol the reloc should be against. */
const char *name;
} u;
/* Addend to use. The object file should contain zero. The BFD
backend is responsible for filling in the contents of the object
file correctly. For some object file formats (e.g., COFF) the
addend must be stored into in the object file, and for some
(e.g., SPARC a.out) it is kept in the reloc. */
bfd_vma addend;
};
/* Allocate a new link_order for a section. */
extern struct bfd_link_order *bfd_new_link_order (bfd *, asection *);
/* These structures are used to describe version information for the
ELF linker. These structures could be manipulated entirely inside
BFD, but it would be a pain. Instead, the regular linker sets up
these structures, and then passes them into BFD. */
/* Glob pattern for a version. */
struct bfd_elf_version_expr
{
/* Next glob pattern for this version. */
struct bfd_elf_version_expr *next;
/* Glob pattern. */
const char *pattern;
/* Set if pattern is not a glob. */
unsigned int literal : 1;
/* Defined by ".symver". */
unsigned int symver : 1;
/* Defined by version script. */
unsigned int script : 1;
/* Pattern type. */
#define BFD_ELF_VERSION_C_TYPE 1
#define BFD_ELF_VERSION_CXX_TYPE 2
#define BFD_ELF_VERSION_JAVA_TYPE 4
unsigned int mask : 3;
};
struct bfd_elf_version_expr_head
{
/* List of all patterns, both wildcards and non-wildcards. */
struct bfd_elf_version_expr *list;
/* Hash table for non-wildcards. */
void *htab;
/* Remaining patterns. */
struct bfd_elf_version_expr *remaining;
/* What kind of pattern types are present in list (bitmask). */
unsigned int mask;
};
/* Version dependencies. */
struct bfd_elf_version_deps
{
/* Next dependency for this version. */
struct bfd_elf_version_deps *next;
/* The version which this version depends upon. */
struct bfd_elf_version_tree *version_needed;
};
/* A node in the version tree. */
struct bfd_elf_version_tree
{
/* Next version. */
struct bfd_elf_version_tree *next;
/* Name of this version. */
const char *name;
/* Version number. */
unsigned int vernum;
/* Regular expressions for global symbols in this version. */
struct bfd_elf_version_expr_head globals;
/* Regular expressions for local symbols in this version. */
struct bfd_elf_version_expr_head locals;
/* List of versions which this version depends upon. */
struct bfd_elf_version_deps *deps;
/* Index of the version name. This is used within BFD. */
unsigned int name_indx;
/* Whether this version tree was used. This is used within BFD. */
int used;
/* Matching hook. */
struct bfd_elf_version_expr *(*match)
(struct bfd_elf_version_expr_head *head,
struct bfd_elf_version_expr *prev, const char *sym);
};
struct bfd_elf_dynamic_list
{
struct bfd_elf_version_expr_head head;
struct bfd_elf_version_expr *(*match)
(struct bfd_elf_version_expr_head *head,
struct bfd_elf_version_expr *prev, const char *sym);
};
#endif

382
local/include/dis-asm.h Normal file
View File

@ -0,0 +1,382 @@
/* Interface between the opcode library and its callers.
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010,
2011, 2012 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, 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, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor,
Boston, MA 02110-1301, USA.
Written by Cygnus Support, 1993.
The opcode library (libopcodes.a) provides instruction decoders for
a large variety of instruction sets, callable with an identical
interface, for making instruction-processing programs more independent
of the instruction set being processed. */
#ifndef DIS_ASM_H
#define DIS_ASM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "bfd.h"
typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
enum dis_insn_type
{
dis_noninsn, /* Not a valid instruction. */
dis_nonbranch, /* Not a branch instruction. */
dis_branch, /* Unconditional branch. */
dis_condbranch, /* Conditional branch. */
dis_jsr, /* Jump to subroutine. */
dis_condjsr, /* Conditional jump to subroutine. */
dis_dref, /* Data reference instruction. */
dis_dref2 /* Two data references in instruction. */
};
/* This struct is passed into the instruction decoding routine,
and is passed back out into each callback. The various fields are used
for conveying information from your main routine into your callbacks,
for passing information into the instruction decoders (such as the
addresses of the callback functions), or for passing information
back from the instruction decoders to their callers.
It must be initialized before it is first passed; this can be done
by hand, or using one of the initialization macros below. */
typedef struct disassemble_info
{
fprintf_ftype fprintf_func;
void *stream;
void *application_data;
/* Target description. We could replace this with a pointer to the bfd,
but that would require one. There currently isn't any such requirement
so to avoid introducing one we record these explicitly. */
/* The bfd_flavour. This can be bfd_target_unknown_flavour. */
enum bfd_flavour flavour;
/* The bfd_arch value. */
enum bfd_architecture arch;
/* The bfd_mach value. */
unsigned long mach;
/* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */
enum bfd_endian endian;
/* Endianness of code, for mixed-endian situations such as ARM BE8. */
enum bfd_endian endian_code;
/* An arch/mach-specific bitmask of selected instruction subsets, mainly
for processors with run-time-switchable instruction sets. The default,
zero, means that there is no constraint. CGEN-based opcodes ports
may use ISA_foo masks. */
void *insn_sets;
/* Some targets need information about the current section to accurately
display insns. If this is NULL, the target disassembler function
will have to make its best guess. */
asection *section;
/* An array of pointers to symbols either at the location being disassembled
or at the start of the function being disassembled. The array is sorted
so that the first symbol is intended to be the one used. The others are
present for any misc. purposes. This is not set reliably, but if it is
not NULL, it is correct. */
asymbol **symbols;
/* Number of symbols in array. */
int num_symbols;
/* Symbol table provided for targets that want to look at it. This is
used on Arm to find mapping symbols and determine Arm/Thumb code. */
asymbol **symtab;
int symtab_pos;
int symtab_size;
/* For use by the disassembler.
The top 16 bits are reserved for public use (and are documented here).
The bottom 16 bits are for the internal use of the disassembler. */
unsigned long flags;
/* Set if the disassembler has determined that there are one or more
relocations associated with the instruction being disassembled. */
#define INSN_HAS_RELOC (1 << 31)
/* Set if the user has requested the disassembly of data as well as code. */
#define DISASSEMBLE_DATA (1 << 30)
/* Set if the user has specifically set the machine type encoded in the
mach field of this structure. */
#define USER_SPECIFIED_MACHINE_TYPE (1 << 29)
/* Use internally by the target specific disassembly code. */
void *private_data;
/* Function used to get bytes to disassemble. MEMADDR is the
address of the stuff to be disassembled, MYADDR is the address to
put the bytes in, and LENGTH is the number of bytes to read.
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
(bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
struct disassemble_info *dinfo);
/* Function which should be called if we get an error that we can't
recover from. STATUS is the errno value from read_memory_func and
MEMADDR is the address that we were trying to read. INFO is a
pointer to this struct. */
void (*memory_error_func)
(int status, bfd_vma memaddr, struct disassemble_info *dinfo);
/* Function called to print ADDR. */
void (*print_address_func)
(bfd_vma addr, struct disassemble_info *dinfo);
/* Function called to determine if there is a symbol at the given ADDR.
If there is, the function returns 1, otherwise it returns 0.
This is used by ports which support an overlay manager where
the overlay number is held in the top part of an address. In
some circumstances we want to include the overlay number in the
address, (normally because there is a symbol associated with
that address), but sometimes we want to mask out the overlay bits. */
int (* symbol_at_address_func)
(bfd_vma addr, struct disassemble_info *dinfo);
/* Function called to check if a SYMBOL is can be displayed to the user.
This is used by some ports that want to hide special symbols when
displaying debugging outout. */
bfd_boolean (* symbol_is_valid)
(asymbol *, struct disassemble_info *dinfo);
/* These are for buffer_read_memory. */
bfd_byte *buffer;
bfd_vma buffer_vma;
unsigned int buffer_length;
/* This variable may be set by the instruction decoder. It suggests
the number of bytes objdump should display on a single line. If
the instruction decoder sets this, it should always set it to
the same value in order to get reasonable looking output. */
int bytes_per_line;
/* The next two variables control the way objdump displays the raw data. */
/* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
/* output will look like this:
00: 00000000 00000000
with the chunks displayed according to "display_endian". */
int bytes_per_chunk;
enum bfd_endian display_endian;
/* Number of octets per incremented target address
Normally one, but some DSPs have byte sizes of 16 or 32 bits. */
unsigned int octets_per_byte;
/* The number of zeroes we want to see at the end of a section before we
start skipping them. */
unsigned int skip_zeroes;
/* The number of zeroes to skip at the end of a section. If the number
of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,
they will be disassembled. If there are fewer than
SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic
attempt to avoid disassembling zeroes inserted by section
alignment. */
unsigned int skip_zeroes_at_end;
/* Whether the disassembler always needs the relocations. */
bfd_boolean disassembler_needs_relocs;
/* Results from instruction decoders. Not all decoders yet support
this information. This info is set each time an instruction is
decoded, and is only valid for the last such instruction.
To determine whether this decoder supports this information, set
insn_info_valid to 0, decode an instruction, then check it. */
char insn_info_valid; /* Branch info has been set. */
char branch_delay_insns; /* How many sequential insn's will run before
a branch takes effect. (0 = normal) */
char data_size; /* Size of data reference in insn, in bytes */
enum dis_insn_type insn_type; /* Type of instruction */
bfd_vma target; /* Target address of branch or dref, if known;
zero if unknown. */
bfd_vma target2; /* Second target address for dref2 */
/* Command line options specific to the target disassembler. */
char * disassembler_options;
} disassemble_info;
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of octets processed. */
typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
extern int print_insn_aarch64 (bfd_vma, disassemble_info *);
extern int print_insn_alpha (bfd_vma, disassemble_info *);
extern int print_insn_avr (bfd_vma, disassemble_info *);
extern int print_insn_bfin (bfd_vma, disassemble_info *);
extern int print_insn_big_arm (bfd_vma, disassemble_info *);
extern int print_insn_big_mips (bfd_vma, disassemble_info *);
extern int print_insn_big_nios2 (bfd_vma, disassemble_info *);
extern int print_insn_big_or32 (bfd_vma, disassemble_info *);
extern int print_insn_big_powerpc (bfd_vma, disassemble_info *);
extern int print_insn_big_score (bfd_vma, disassemble_info *);
extern int print_insn_cr16 (bfd_vma, disassemble_info *);
extern int print_insn_crx (bfd_vma, disassemble_info *);
extern int print_insn_d10v (bfd_vma, disassemble_info *);
extern int print_insn_d30v (bfd_vma, disassemble_info *);
extern int print_insn_dlx (bfd_vma, disassemble_info *);
extern int print_insn_epiphany (bfd_vma, disassemble_info *);
extern int print_insn_fr30 (bfd_vma, disassemble_info *);
extern int print_insn_frv (bfd_vma, disassemble_info *);
extern int print_insn_h8300 (bfd_vma, disassemble_info *);
extern int print_insn_h8300h (bfd_vma, disassemble_info *);
extern int print_insn_h8300s (bfd_vma, disassemble_info *);
extern int print_insn_h8500 (bfd_vma, disassemble_info *);
extern int print_insn_hppa (bfd_vma, disassemble_info *);
extern int print_insn_i370 (bfd_vma, disassemble_info *);
extern int print_insn_i386 (bfd_vma, disassemble_info *);
extern int print_insn_i386_att (bfd_vma, disassemble_info *);
extern int print_insn_i386_intel (bfd_vma, disassemble_info *);
extern int print_insn_i860 (bfd_vma, disassemble_info *);
extern int print_insn_i960 (bfd_vma, disassemble_info *);
extern int print_insn_ia64 (bfd_vma, disassemble_info *);
extern int print_insn_ip2k (bfd_vma, disassemble_info *);
extern int print_insn_iq2000 (bfd_vma, disassemble_info *);
extern int print_insn_little_arm (bfd_vma, disassemble_info *);
extern int print_insn_little_mips (bfd_vma, disassemble_info *);
extern int print_insn_little_nios2 (bfd_vma, disassemble_info *);
extern int print_insn_little_or32 (bfd_vma, disassemble_info *);
extern int print_insn_little_powerpc (bfd_vma, disassemble_info *);
extern int print_insn_little_score (bfd_vma, disassemble_info *);
extern int print_insn_lm32 (bfd_vma, disassemble_info *);
extern int print_insn_m32c (bfd_vma, disassemble_info *);
extern int print_insn_m32r (bfd_vma, disassemble_info *);
extern int print_insn_m68hc11 (bfd_vma, disassemble_info *);
extern int print_insn_m68hc12 (bfd_vma, disassemble_info *);
extern int print_insn_m9s12x (bfd_vma, disassemble_info *);
extern int print_insn_m9s12xg (bfd_vma, disassemble_info *);
extern int print_insn_m68k (bfd_vma, disassemble_info *);
extern int print_insn_m88k (bfd_vma, disassemble_info *);
extern int print_insn_mcore (bfd_vma, disassemble_info *);
extern int print_insn_mep (bfd_vma, disassemble_info *);
extern int print_insn_metag (bfd_vma, disassemble_info *);
extern int print_insn_microblaze (bfd_vma, disassemble_info *);
extern int print_insn_mmix (bfd_vma, disassemble_info *);
extern int print_insn_mn10200 (bfd_vma, disassemble_info *);
extern int print_insn_mn10300 (bfd_vma, disassemble_info *);
extern int print_insn_moxie (bfd_vma, disassemble_info *);
extern int print_insn_msp430 (bfd_vma, disassemble_info *);
extern int print_insn_mt (bfd_vma, disassemble_info *);
extern int print_insn_ns32k (bfd_vma, disassemble_info *);
extern int print_insn_openrisc (bfd_vma, disassemble_info *);
extern int print_insn_pdp11 (bfd_vma, disassemble_info *);
extern int print_insn_pj (bfd_vma, disassemble_info *);
extern int print_insn_rs6000 (bfd_vma, disassemble_info *);
extern int print_insn_s390 (bfd_vma, disassemble_info *);
extern int print_insn_sh (bfd_vma, disassemble_info *);
extern int print_insn_sh64 (bfd_vma, disassemble_info *);
extern int print_insn_sh64x_media (bfd_vma, disassemble_info *);
extern int print_insn_sparc (bfd_vma, disassemble_info *);
extern int print_insn_spu (bfd_vma, disassemble_info *);
extern int print_insn_tic30 (bfd_vma, disassemble_info *);
extern int print_insn_tic4x (bfd_vma, disassemble_info *);
extern int print_insn_tic54x (bfd_vma, disassemble_info *);
extern int print_insn_tic6x (bfd_vma, disassemble_info *);
extern int print_insn_tic80 (bfd_vma, disassemble_info *);
extern int print_insn_tilegx (bfd_vma, disassemble_info *);
extern int print_insn_tilepro (bfd_vma, disassemble_info *);
extern int print_insn_v850 (bfd_vma, disassemble_info *);
extern int print_insn_vax (bfd_vma, disassemble_info *);
extern int print_insn_w65 (bfd_vma, disassemble_info *);
extern int print_insn_xc16x (bfd_vma, disassemble_info *);
extern int print_insn_xgate (bfd_vma, disassemble_info *);
extern int print_insn_xstormy16 (bfd_vma, disassemble_info *);
extern int print_insn_xtensa (bfd_vma, disassemble_info *);
extern int print_insn_z80 (bfd_vma, disassemble_info *);
extern int print_insn_z8001 (bfd_vma, disassemble_info *);
extern int print_insn_z8002 (bfd_vma, disassemble_info *);
extern int print_insn_rx (bfd_vma, disassemble_info *);
extern int print_insn_rl78 (bfd_vma, disassemble_info *);
extern disassembler_ftype arc_get_disassembler (void *);
extern disassembler_ftype cris_get_disassembler (bfd *);
extern void print_aarch64_disassembler_options (FILE *);
extern void print_i386_disassembler_options (FILE *);
extern void print_mips_disassembler_options (FILE *);
extern void print_ppc_disassembler_options (FILE *);
extern void print_arm_disassembler_options (FILE *);
extern void parse_arm_disassembler_option (char *);
extern void print_s390_disassembler_options (FILE *);
extern int get_arm_regname_num_options (void);
extern int set_arm_regname_option (int);
extern int get_arm_regnames (int, const char **, const char **, const char *const **);
extern bfd_boolean aarch64_symbol_is_valid (asymbol *, struct disassemble_info *);
extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
extern void disassemble_init_powerpc (struct disassemble_info *);
/* Fetch the disassembler for a given BFD, if that support is available. */
extern disassembler_ftype disassembler (bfd *);
/* Amend the disassemble_info structure as necessary for the target architecture.
Should only be called after initialising the info->arch field. */
extern void disassemble_init_for_target (struct disassemble_info * dinfo);
/* Document any target specific options available from the disassembler. */
extern void disassembler_usage (FILE *);
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
extern int buffer_read_memory
(bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
extern void perror_memory (int, bfd_vma, struct disassemble_info *);
/* Just print the address in hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
extern void generic_print_address
(bfd_vma, struct disassemble_info *);
/* Always true. */
extern int generic_symbol_at_address
(bfd_vma, struct disassemble_info *);
/* Also always true. */
extern bfd_boolean generic_symbol_is_valid
(asymbol *, struct disassemble_info *);
/* Method to initialize a disassemble_info struct. This should be
called by all applications creating such a struct. */
extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
fprintf_ftype fprintf_func);
/* For compatibility with existing code. */
#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
#ifdef __cplusplus
}
#endif
#endif /* ! defined (DIS_ASM_H) */

View File

@ -0,0 +1,346 @@
/* JIT declarations for GDB, the GNU Debugger.
Copyright (C) 2011-2013 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 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

55
local/include/symcat.h Normal file
View File

@ -0,0 +1,55 @@
/* Symbol concatenation utilities.
Copyright (C) 1998, 2000, 2010 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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef SYM_CAT_H
#define SYM_CAT_H
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define CONCAT2(a,b) a##b
#define CONCAT3(a,b,c) a##b##c
#define CONCAT4(a,b,c,d) a##b##c##d
#define CONCAT5(a,b,c,d,e) a##b##c##d##e
#define CONCAT6(a,b,c,d,e,f) a##b##c##d##e##f
#define STRINGX(s) #s
#else
/* Note one should never pass extra whitespace to the CONCATn macros,
e.g. CONCAT2(foo, bar) because traditonal C will keep the space between
the two labels instead of concatenating them. Instead, make sure to
write CONCAT2(foo,bar). */
#define CONCAT2(a,b) a/**/b
#define CONCAT3(a,b,c) a/**/b/**/c
#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
#define CONCAT5(a,b,c,d,e) a/**/b/**/c/**/d/**/e
#define CONCAT6(a,b,c,d,e,f) a/**/b/**/c/**/d/**/e/**/f
#define STRINGX(s) "s"
#endif
#define XCONCAT2(a,b) CONCAT2(a,b)
#define XCONCAT3(a,b,c) CONCAT3(a,b,c)
#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)
#define XCONCAT5(a,b,c,d,e) CONCAT5(a,b,c,d,e)
#define XCONCAT6(a,b,c,d,e,f) CONCAT6(a,b,c,d,e,f)
/* Note the layer of indirection here is typically used to allow
stringification of the expansion of macros. I.e. "#define foo
bar", "XSTRING(foo)", to yield "bar". Be aware that this only
works for __STDC__, not for traditional C which will still resolve
to "foo". */
#define XSTRING(s) STRINGX(s)
#endif /* SYM_CAT_H */

BIN
local/lib/libbfd.a Normal file

Binary file not shown.

41
local/lib/libbfd.la Normal file
View File

@ -0,0 +1,41 @@
# libbfd.la - a libtool library file
# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libbfd.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''
# Libraries that this one depends upon.
dependency_libs=''
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libbfd.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

BIN
local/lib/libopcodes.a Normal file

Binary file not shown.

41
local/lib/libopcodes.la Normal file
View File

@ -0,0 +1,41 @@
# libopcodes.la - a libtool library file
# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname=''
# Names of this library.
library_names=''
# The name of the static archive.
old_library='libopcodes.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''
# Libraries that this one depends upon.
dependency_libs=''
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libopcodes.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

View File

@ -0,0 +1,285 @@
# Copyright (C) 2013 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
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 = []
block = self.frame.block()
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 = []
block = self.frame.block()
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

View File

@ -0,0 +1,45 @@
# Copyright (C) 2013 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

View File

@ -0,0 +1,126 @@
# Copyright (C) 2010-2013 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 traceback
import os
import sys
import _gdb
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()

View File

@ -0,0 +1,16 @@
# Copyright (C) 2010-2013 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/>.

View File

@ -0,0 +1,760 @@
# GDB 'explore' command.
# Copyright (C) 2012-2013 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()

View File

@ -0,0 +1,461 @@
# Frame-filter commands.
# Copyright (C) 2013 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 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 as e:
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]
priority = 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 as e:
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()

View File

@ -0,0 +1,368 @@
# Pretty-printer commands.
# Copyright (C) 2010-2013 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 pretty-printers."""
import copy
import gdb
import re
def parse_printer_regexps(arg):
"""Internal utility to parse a pretty-printer command argv.
Arguments:
arg: The arguments to the command. The format is:
[object-regexp [name-regexp]].
Individual printers in a collection are named as
printer-name;subprinter-name.
Returns:
The result is a 3-tuple of compiled regular expressions, except that
the resulting compiled subprinter regexp is None if not provided.
Raises:
SyntaxError: an error processing ARG
"""
argv = gdb.string_to_argv(arg);
argc = len(argv)
object_regexp = "" # match everything
name_regexp = "" # match everything
subname_regexp = None
if argc > 3:
raise SyntaxError("too many arguments")
if argc >= 1:
object_regexp = argv[0]
if argc >= 2:
name_subname = argv[1].split(";", 1)
name_regexp = name_subname[0]
if len(name_subname) == 2:
subname_regexp = name_subname[1]
# That re.compile raises SyntaxError was determined empirically.
# We catch it and reraise it to provide a slightly more useful
# error message for the user.
try:
object_re = re.compile(object_regexp)
except SyntaxError:
raise SyntaxError("invalid object regexp: %s" % object_regexp)
try:
name_re = re.compile (name_regexp)
except SyntaxError:
raise SyntaxError("invalid name regexp: %s" % name_regexp)
if subname_regexp is not None:
try:
subname_re = re.compile(subname_regexp)
except SyntaxError:
raise SyntaxError("invalid subname regexp: %s" % subname_regexp)
else:
subname_re = None
return(object_re, name_re, subname_re)
def printer_enabled_p(printer):
"""Internal utility to see if printer (or subprinter) is enabled."""
if hasattr(printer, "enabled"):
return printer.enabled
else:
return True
class InfoPrettyPrinter(gdb.Command):
"""GDB command to list all registered pretty-printers.
Usage: info pretty-printer [object-regexp [name-regexp]]
OBJECT-REGEXP is a regular expression matching the objects to list.
Objects are "global", the program space's file, and the objfiles within
that program space.
NAME-REGEXP matches the name of the pretty-printer.
Individual printers in a collection are named as
printer-name;subprinter-name.
"""
def __init__ (self):
super(InfoPrettyPrinter, self).__init__("info pretty-printer",
gdb.COMMAND_DATA)
@staticmethod
def enabled_string(printer):
"""Return "" if PRINTER is enabled, otherwise " [disabled]"."""
if printer_enabled_p(printer):
return ""
else:
return " [disabled]"
@staticmethod
def printer_name(printer):
"""Return the printer's name."""
if hasattr(printer, "name"):
return printer.name
if hasattr(printer, "__name__"):
return printer.__name__
# This "shouldn't happen", but the public API allows for
# direct additions to the pretty-printer list, and we shouldn't
# crash because someone added a bogus printer.
# Plus we want to give the user a way to list unknown printers.
return "unknown"
def list_pretty_printers(self, pretty_printers, name_re, subname_re):
"""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 = 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))
if (hasattr(printer, "subprinters") and
printer.subprinters is not None):
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)):
print (" %s%s" %
(subprinter.name,
self.enabled_string(subprinter)))
def invoke1(self, title, printer_list,
obj_name_to_match, object_re, name_re, subname_re):
"""Subroutine of invoke to simplify it."""
if printer_list and object_re.match(obj_name_to_match):
print (title)
self.list_pretty_printers(printer_list, name_re, subname_re)
def invoke(self, arg, from_tty):
"""GDB calls this to perform the command."""
(object_re, name_re, subname_re) = parse_printer_regexps(arg)
self.invoke1("global pretty-printers:", gdb.pretty_printers,
"global", object_re, name_re, subname_re)
cp = gdb.current_progspace()
self.invoke1("progspace %s pretty-printers:" % cp.filename,
cp.pretty_printers, "progspace",
object_re, name_re, subname_re)
for objfile in gdb.objfiles():
self.invoke1(" objfile %s pretty-printers:" % objfile.filename,
objfile.pretty_printers, objfile.filename,
object_re, name_re, subname_re)
def count_enabled_printers(pretty_printers):
"""Return a 2-tuple of number of enabled and total printers."""
enabled = 0
total = 0
for printer in pretty_printers:
if (hasattr(printer, "subprinters")
and printer.subprinters is not None):
if printer_enabled_p(printer):
for subprinter in printer.subprinters:
if printer_enabled_p(subprinter):
enabled += 1
total += len(printer.subprinters)
else:
if printer_enabled_p(printer):
enabled += 1
total += 1
return (enabled, total)
def count_all_enabled_printers():
"""Return a 2-tuble of the enabled state and total number of all printers.
This includes subprinters.
"""
enabled_count = 0
total_count = 0
(t_enabled, t_total) = count_enabled_printers(gdb.pretty_printers)
enabled_count += t_enabled
total_count += t_total
(t_enabled, t_total) = count_enabled_printers(gdb.current_progspace().pretty_printers)
enabled_count += t_enabled
total_count += t_total
for objfile in gdb.objfiles():
(t_enabled, t_total) = count_enabled_printers(objfile.pretty_printers)
enabled_count += t_enabled
total_count += t_total
return (enabled_count, total_count)
def pluralize(text, n, suffix="s"):
"""Return TEXT pluralized if N != 1."""
if n != 1:
return "%s%s" % (text, suffix)
else:
return text
def show_pretty_printer_enabled_summary():
"""Print the number of printers enabled/disabled.
We count subprinters individually.
"""
(enabled_count, total_count) = count_all_enabled_printers()
print ("%d of %d printers enabled" % (enabled_count, total_count))
def do_enable_pretty_printer_1 (pretty_printers, name_re, subname_re, flag):
"""Worker for enabling/disabling pretty-printers.
Arguments:
pretty_printers: list of pretty-printers
name_re: regular-expression object to select printers
subname_re: regular expression object to select subprinters or None
if all are affected
flag: True for Enable, False for Disable
Returns:
The number of printers affected.
This is just for informational purposes for the user.
"""
total = 0
for printer in pretty_printers:
if (hasattr(printer, "name") and name_re.match(printer.name) or
hasattr(printer, "__name__") and name_re.match(printer.__name__)):
if (hasattr(printer, "subprinters") and
printer.subprinters is not None):
if not subname_re:
# Only record printers that change state.
if printer_enabled_p(printer) != flag:
for subprinter in printer.subprinters:
if printer_enabled_p(subprinter):
total += 1
# NOTE: We preserve individual subprinter settings.
printer.enabled = flag
else:
# NOTE: Whether this actually disables the subprinter
# depends on whether the printer's lookup function supports
# the "enable" API. We can only assume it does.
for subprinter in printer.subprinters:
if subname_re.match(subprinter.name):
# Only record printers that change state.
if (printer_enabled_p(printer) and
printer_enabled_p(subprinter) != flag):
total += 1
subprinter.enabled = flag
else:
# This printer has no subprinters.
# If the user does "disable pretty-printer .* .* foo"
# should we disable printers that don't have subprinters?
# How do we apply "foo" in this context? Since there is no
# "foo" subprinter it feels like we should skip this printer.
# There's still the issue of how to handle
# "disable pretty-printer .* .* .*", and every other variation
# that can match everything. For now punt and only support
# "disable pretty-printer .* .*" (i.e. subname is elided)
# to disable everything.
if not subname_re:
# Only record printers that change state.
if printer_enabled_p(printer) != flag:
total += 1
printer.enabled = flag
return total
def do_enable_pretty_printer (arg, flag):
"""Internal worker for enabling/disabling pretty-printers."""
(object_re, name_re, subname_re) = parse_printer_regexps(arg)
total = 0
if object_re.match("global"):
total += do_enable_pretty_printer_1(gdb.pretty_printers,
name_re, subname_re, flag)
cp = gdb.current_progspace()
if object_re.match("progspace"):
total += do_enable_pretty_printer_1(cp.pretty_printers,
name_re, subname_re, flag)
for objfile in gdb.objfiles():
if object_re.match(objfile.filename):
total += do_enable_pretty_printer_1(objfile.pretty_printers,
name_re, subname_re, flag)
if flag:
state = "enabled"
else:
state = "disabled"
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
# is expected. Since we use regexps to select it's useful.
show_pretty_printer_enabled_summary()
# Enable/Disable one or more pretty-printers.
#
# This is intended for use when a broken pretty-printer is shipped/installed
# and the user wants to disable that printer without disabling all the other
# printers.
#
# A useful addition would be -v (verbose) to show each printer affected.
class EnablePrettyPrinter (gdb.Command):
"""GDB command to enable the specified pretty-printer.
Usage: enable pretty-printer [object-regexp [name-regexp]]
OBJECT-REGEXP is a regular expression matching the objects to examine.
Objects are "global", the program space's file, and the objfiles within
that program space.
NAME-REGEXP matches the name of the pretty-printer.
Individual printers in a collection are named as
printer-name;subprinter-name.
"""
def __init__(self):
super(EnablePrettyPrinter, self).__init__("enable pretty-printer",
gdb.COMMAND_DATA)
def invoke(self, arg, from_tty):
"""GDB calls this to perform the command."""
do_enable_pretty_printer(arg, True)
class DisablePrettyPrinter (gdb.Command):
"""GDB command to disable the specified pretty-printer.
Usage: disable pretty-printer [object-regexp [name-regexp]]
OBJECT-REGEXP is a regular expression matching the objects to examine.
Objects are "global", the program space's file, and the objfiles within
that program space.
NAME-REGEXP matches the name of the pretty-printer.
Individual printers in a collection are named as
printer-name;subprinter-name.
"""
def __init__(self):
super(DisablePrettyPrinter, self).__init__("disable pretty-printer",
gdb.COMMAND_DATA)
def invoke(self, arg, from_tty):
"""GDB calls this to perform the command."""
do_enable_pretty_printer(arg, False)
def register_pretty_printer_commands():
"""Call from a top level script to install the pretty-printer commands."""
InfoPrettyPrinter()
EnablePrettyPrinter()
DisablePrettyPrinter()
register_pretty_printer_commands()

View File

@ -0,0 +1,66 @@
# Extended prompt.
# Copyright (C) 2011-2013 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()

View File

@ -0,0 +1,125 @@
# Type printer commands.
# Copyright (C) 2010-2013 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()

View File

@ -0,0 +1,229 @@
# Frame-filter commands.
# Copyright (C) 2013 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 list.
if name == "all":
all_dicts = gdb.frame_filters.values()
all_dicts = all_dicts + gdb.current_progspace().frame_filters.values()
for objfile in gdb.objfiles():
all_dicts = all_dicts + objfile.frame_filters.values()
return all_dicts
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 = []
for objfile in gdb.objfiles():
all_filters = all_filters + objfile.frame_filters.values()
cp = gdb.current_progspace()
all_filters = all_filters + cp.frame_filters.values()
all_filters = all_filters + gdb.frame_filters.values()
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 = _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.
frame_iterator = itertools.imap(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

View File

@ -0,0 +1,14 @@
# Copyright (C) 2012-2013 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/>.

View File

@ -0,0 +1,108 @@
# Useful gdb string convenience functions.
# Copyright (C) 2012-2013 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()

View File

@ -0,0 +1,263 @@
# Pretty-printer utilities.
# Copyright (C) 2010-2013 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/>.
"""Utilities for working with pretty-printers."""
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.
Attributes:
name: A unique string among all printers for the context in which
it is defined (objfile, progspace, or global(gdb)), and should
meaningfully describe what can be pretty-printed.
E.g., "StringPiece" or "protobufs".
subprinters: An iterable object with each element having a `name'
attribute, and, potentially, "enabled" attribute.
Or this is None if there are no subprinters.
enabled: A boolean indicating if the printer is enabled.
Subprinters are for situations where "one" pretty-printer is actually a
collection of several printers. E.g., The libstdc++ pretty-printer has
a pretty-printer for each of several different types, based on regexps.
"""
# While one might want to push subprinters into the subclass, it's
# present here to formalize such support to simplify
# commands/pretty_printers.py.
def __init__(self, name, subprinters=None):
self.name = name
self.subprinters = subprinters
self.enabled = True
def __call__(self, val):
# The subclass must define this.
raise NotImplementedError("PrettyPrinter __call__")
class SubPrettyPrinter(object):
"""Baseclass for sub-pretty-printers.
Sub-pretty-printers needn't use this, but it formalizes what's needed.
Attributes:
name: The name of the subprinter.
enabled: A boolean indicating if the subprinter is enabled.
"""
def __init__(self, name):
self.name = name
self.enabled = True
def register_pretty_printer(obj, printer, replace=False):
"""Register pretty-printer PRINTER with OBJ.
The printer is added to the front of the search list, thus one can override
an existing printer if one needs to. Use a different name when overriding
an existing printer, otherwise an exception will be raised; multiple
printers with the same name are disallowed.
Arguments:
obj: Either an objfile, progspace, or None (in which case the printer
is registered globally).
printer: Either a function of one argument (old way) or any object
which has attributes: name, enabled, __call__.
replace: If True replace any existing copy of the printer.
Otherwise if the printer already exists raise an exception.
Returns:
Nothing.
Raises:
TypeError: A problem with the type of the printer.
ValueError: The printer's name contains a semicolon ";".
RuntimeError: A printer with the same name is already registered.
If the caller wants the printer to be listable and disableable, it must
follow the PrettyPrinter API. This applies to the old way (functions) too.
If printer is an object, __call__ is a method of two arguments:
self, and the value to be pretty-printed. See PrettyPrinter.
"""
# Watch for both __name__ and name.
# Functions get the former for free, but we don't want to use an
# attribute named __foo__ for pretty-printers-as-objects.
# If printer has both, we use `name'.
if not hasattr(printer, "__name__") and not hasattr(printer, "name"):
raise TypeError("printer missing attribute: name")
if hasattr(printer, "name") and not hasattr(printer, "enabled"):
raise TypeError("printer missing attribute: enabled")
if not hasattr(printer, "__call__"):
raise TypeError("printer missing attribute: __call__")
if obj is None:
if gdb.parameter("verbose"):
gdb.write("Registering global %s pretty-printer ...\n" % name)
obj = gdb
else:
if gdb.parameter("verbose"):
gdb.write("Registering %s pretty-printer for %s ...\n" %
(printer.name, obj.filename))
if hasattr(printer, "name"):
if not isinstance(printer.name, basestring):
raise TypeError("printer name is not a string")
# If printer provides a name, make sure it doesn't contain ";".
# Semicolon is used by the info/enable/disable pretty-printer commands
# to delimit subprinters.
if printer.name.find(";") >= 0:
raise ValueError("semicolon ';' in printer name")
# Also make sure the name is unique.
# Alas, we can't do the same for functions and __name__, they could
# all have a canonical name like "lookup_function".
# PERF: gdb records printers in a list, making this inefficient.
i = 0
for p in obj.pretty_printers:
if hasattr(p, "name") and p.name == printer.name:
if replace:
del obj.pretty_printers[i]
break
else:
raise RuntimeError("pretty-printer already registered: %s" %
printer.name)
i = i + 1
obj.pretty_printers.insert(0, printer)
class RegexpCollectionPrettyPrinter(PrettyPrinter):
"""Class for implementing a collection of regular-expression based pretty-printers.
Intended usage:
pretty_printer = RegexpCollectionPrettyPrinter("my_library")
pretty_printer.add_printer("myclass1", "^myclass1$", MyClass1Printer)
...
pretty_printer.add_printer("myclassN", "^myclassN$", MyClassNPrinter)
register_pretty_printer(obj, pretty_printer)
"""
class RegexpSubprinter(SubPrettyPrinter):
def __init__(self, name, regexp, gen_printer):
super(RegexpCollectionPrettyPrinter.RegexpSubprinter, self).__init__(name)
self.regexp = regexp
self.gen_printer = gen_printer
self.compiled_re = re.compile(regexp)
def __init__(self, name):
super(RegexpCollectionPrettyPrinter, self).__init__(name, [])
def add_printer(self, name, regexp, gen_printer):
"""Add a printer to the list.
The printer is added to the end of the list.
Arguments:
name: The name of the subprinter.
regexp: The regular expression, as a string.
gen_printer: A function/method that given a value returns an
object to pretty-print it.
Returns:
Nothing.
"""
# NOTE: A previous version made the name of each printer the regexp.
# That makes it awkward to pass to the enable/disable commands (it's
# cumbersome to make a regexp of a regexp). So now the name is a
# separate parameter.
self.subprinters.append(self.RegexpSubprinter(name, regexp,
gen_printer))
def __call__(self, val):
"""Lookup the pretty-printer for the provided value."""
# Get the type name.
typename = gdb.types.get_basic_type(val.type).tag
if not typename:
return None
# Iterate over table of type regexps to determine
# if a printer is registered for that type.
# Return an instantiation of the printer if found.
for printer in self.subprinters:
if printer.enabled and printer.compiled_re.search(typename):
return printer.gen_printer(val)
# 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

View File

@ -0,0 +1,148 @@
# Extended prompt utilities.
# Copyright (C) 2011-2013 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

View File

@ -0,0 +1,176 @@
# Type utilities.
# Copyright (C) 2010-2013 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/>.
"""Utilities for working with gdb.Types."""
import gdb
def get_basic_type(type_):
"""Return the "basic" type of a type.
Arguments:
type_: The type to reduce to its basic type.
Returns:
type_ with const/volatile is stripped away,
and typedefs/references converted to the underlying type.
"""
while (type_.code == gdb.TYPE_CODE_REF or
type_.code == gdb.TYPE_CODE_TYPEDEF):
if type_.code == gdb.TYPE_CODE_REF:
type_ = type_.target()
else:
type_ = type_.strip_typedefs()
return type_.unqualified()
def has_field(type_, field):
"""Return True if a type has the specified field.
Arguments:
type_: The type to examine.
It must be one of gdb.TYPE_CODE_STRUCT, gdb.TYPE_CODE_UNION.
field: The name of the field to look up.
Returns:
True if the field is present either in type_ or any baseclass.
Raises:
TypeError: The type is not a struct or union.
"""
type_ = get_basic_type(type_)
if (type_.code != gdb.TYPE_CODE_STRUCT and
type_.code != gdb.TYPE_CODE_UNION):
raise TypeError("not a struct or union")
for f in type_.fields():
if f.is_base_class:
if has_field(f.type, field):
return True
else:
# NOTE: f.name could be None
if f.name == field:
return True
return False
def make_enum_dict(enum_type):
"""Return a dictionary from a program's enum type.
Arguments:
enum_type: The enum to compute the dictionary for.
Returns:
The dictionary of the enum.
Raises:
TypeError: The type is not an enum.
"""
if enum_type.code != gdb.TYPE_CODE_ENUM:
raise TypeError("not an enum type")
enum_dict = {}
for field in enum_type.fields():
# 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)

View File

@ -0,0 +1,314 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2009-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/x86/include/asm/unistd_64.h
The file mentioned above belongs to the Linux Kernel. -->
<syscalls_info>
<syscall name="read" number="0"/>
<syscall name="write" number="1"/>
<syscall name="open" number="2"/>
<syscall name="close" number="3"/>
<syscall name="stat" number="4"/>
<syscall name="fstat" number="5"/>
<syscall name="lstat" number="6"/>
<syscall name="poll" number="7"/>
<syscall name="lseek" number="8"/>
<syscall name="mmap" number="9"/>
<syscall name="mprotect" number="10"/>
<syscall name="munmap" number="11"/>
<syscall name="brk" number="12"/>
<syscall name="rt_sigaction" number="13"/>
<syscall name="rt_sigprocmask" number="14"/>
<syscall name="rt_sigreturn" number="15"/>
<syscall name="ioctl" number="16"/>
<syscall name="pread64" number="17"/>
<syscall name="pwrite64" number="18"/>
<syscall name="readv" number="19"/>
<syscall name="writev" number="20"/>
<syscall name="access" number="21"/>
<syscall name="pipe" number="22"/>
<syscall name="select" number="23"/>
<syscall name="sched_yield" number="24"/>
<syscall name="mremap" number="25"/>
<syscall name="msync" number="26"/>
<syscall name="mincore" number="27"/>
<syscall name="madvise" number="28"/>
<syscall name="shmget" number="29"/>
<syscall name="shmat" number="30"/>
<syscall name="shmctl" number="31"/>
<syscall name="dup" number="32"/>
<syscall name="dup2" number="33"/>
<syscall name="pause" number="34"/>
<syscall name="nanosleep" number="35"/>
<syscall name="getitimer" number="36"/>
<syscall name="alarm" number="37"/>
<syscall name="setitimer" number="38"/>
<syscall name="getpid" number="39"/>
<syscall name="sendfile" number="40"/>
<syscall name="socket" number="41"/>
<syscall name="connect" number="42"/>
<syscall name="accept" number="43"/>
<syscall name="sendto" number="44"/>
<syscall name="recvfrom" number="45"/>
<syscall name="sendmsg" number="46"/>
<syscall name="recvmsg" number="47"/>
<syscall name="shutdown" number="48"/>
<syscall name="bind" number="49"/>
<syscall name="listen" number="50"/>
<syscall name="getsockname" number="51"/>
<syscall name="getpeername" number="52"/>
<syscall name="socketpair" number="53"/>
<syscall name="setsockopt" number="54"/>
<syscall name="getsockopt" number="55"/>
<syscall name="clone" number="56"/>
<syscall name="fork" number="57"/>
<syscall name="vfork" number="58"/>
<syscall name="execve" number="59"/>
<syscall name="exit" number="60"/>
<syscall name="wait4" number="61"/>
<syscall name="kill" number="62"/>
<syscall name="uname" number="63"/>
<syscall name="semget" number="64"/>
<syscall name="semop" number="65"/>
<syscall name="semctl" number="66"/>
<syscall name="shmdt" number="67"/>
<syscall name="msgget" number="68"/>
<syscall name="msgsnd" number="69"/>
<syscall name="msgrcv" number="70"/>
<syscall name="msgctl" number="71"/>
<syscall name="fcntl" number="72"/>
<syscall name="flock" number="73"/>
<syscall name="fsync" number="74"/>
<syscall name="fdatasync" number="75"/>
<syscall name="truncate" number="76"/>
<syscall name="ftruncate" number="77"/>
<syscall name="getdents" number="78"/>
<syscall name="getcwd" number="79"/>
<syscall name="chdir" number="80"/>
<syscall name="fchdir" number="81"/>
<syscall name="rename" number="82"/>
<syscall name="mkdir" number="83"/>
<syscall name="rmdir" number="84"/>
<syscall name="creat" number="85"/>
<syscall name="link" number="86"/>
<syscall name="unlink" number="87"/>
<syscall name="symlink" number="88"/>
<syscall name="readlink" number="89"/>
<syscall name="chmod" number="90"/>
<syscall name="fchmod" number="91"/>
<syscall name="chown" number="92"/>
<syscall name="fchown" number="93"/>
<syscall name="lchown" number="94"/>
<syscall name="umask" number="95"/>
<syscall name="gettimeofday" number="96"/>
<syscall name="getrlimit" number="97"/>
<syscall name="getrusage" number="98"/>
<syscall name="sysinfo" number="99"/>
<syscall name="times" number="100"/>
<syscall name="ptrace" number="101"/>
<syscall name="getuid" number="102"/>
<syscall name="syslog" number="103"/>
<syscall name="getgid" number="104"/>
<syscall name="setuid" number="105"/>
<syscall name="setgid" number="106"/>
<syscall name="geteuid" number="107"/>
<syscall name="getegid" number="108"/>
<syscall name="setpgid" number="109"/>
<syscall name="getppid" number="110"/>
<syscall name="getpgrp" number="111"/>
<syscall name="setsid" number="112"/>
<syscall name="setreuid" number="113"/>
<syscall name="setregid" number="114"/>
<syscall name="getgroups" number="115"/>
<syscall name="setgroups" number="116"/>
<syscall name="setresuid" number="117"/>
<syscall name="getresuid" number="118"/>
<syscall name="setresgid" number="119"/>
<syscall name="getresgid" number="120"/>
<syscall name="getpgid" number="121"/>
<syscall name="setfsuid" number="122"/>
<syscall name="setfsgid" number="123"/>
<syscall name="getsid" number="124"/>
<syscall name="capget" number="125"/>
<syscall name="capset" number="126"/>
<syscall name="rt_sigpending" number="127"/>
<syscall name="rt_sigtimedwait" number="128"/>
<syscall name="rt_sigqueueinfo" number="129"/>
<syscall name="rt_sigsuspend" number="130"/>
<syscall name="sigaltstack" number="131"/>
<syscall name="utime" number="132"/>
<syscall name="mknod" number="133"/>
<syscall name="uselib" number="134"/>
<syscall name="personality" number="135"/>
<syscall name="ustat" number="136"/>
<syscall name="statfs" number="137"/>
<syscall name="fstatfs" number="138"/>
<syscall name="sysfs" number="139"/>
<syscall name="getpriority" number="140"/>
<syscall name="setpriority" number="141"/>
<syscall name="sched_setparam" number="142"/>
<syscall name="sched_getparam" number="143"/>
<syscall name="sched_setscheduler" number="144"/>
<syscall name="sched_getscheduler" number="145"/>
<syscall name="sched_get_priority_max" number="146"/>
<syscall name="sched_get_priority_min" number="147"/>
<syscall name="sched_rr_get_interval" number="148"/>
<syscall name="mlock" number="149"/>
<syscall name="munlock" number="150"/>
<syscall name="mlockall" number="151"/>
<syscall name="munlockall" number="152"/>
<syscall name="vhangup" number="153"/>
<syscall name="modify_ldt" number="154"/>
<syscall name="pivot_root" number="155"/>
<syscall name="_sysctl" number="156"/>
<syscall name="prctl" number="157"/>
<syscall name="arch_prctl" number="158"/>
<syscall name="adjtimex" number="159"/>
<syscall name="setrlimit" number="160"/>
<syscall name="chroot" number="161"/>
<syscall name="sync" number="162"/>
<syscall name="acct" number="163"/>
<syscall name="settimeofday" number="164"/>
<syscall name="mount" number="165"/>
<syscall name="umount2" number="166"/>
<syscall name="swapon" number="167"/>
<syscall name="swapoff" number="168"/>
<syscall name="reboot" number="169"/>
<syscall name="sethostname" number="170"/>
<syscall name="setdomainname" number="171"/>
<syscall name="iopl" number="172"/>
<syscall name="ioperm" number="173"/>
<syscall name="create_module" number="174"/>
<syscall name="init_module" number="175"/>
<syscall name="delete_module" number="176"/>
<syscall name="get_kernel_syms" number="177"/>
<syscall name="query_module" number="178"/>
<syscall name="quotactl" number="179"/>
<syscall name="nfsservctl" number="180"/>
<syscall name="getpmsg" number="181"/>
<syscall name="putpmsg" number="182"/>
<syscall name="afs_syscall" number="183"/>
<syscall name="tuxcall" number="184"/>
<syscall name="security" number="185"/>
<syscall name="gettid" number="186"/>
<syscall name="readahead" number="187"/>
<syscall name="setxattr" number="188"/>
<syscall name="lsetxattr" number="189"/>
<syscall name="fsetxattr" number="190"/>
<syscall name="getxattr" number="191"/>
<syscall name="lgetxattr" number="192"/>
<syscall name="fgetxattr" number="193"/>
<syscall name="listxattr" number="194"/>
<syscall name="llistxattr" number="195"/>
<syscall name="flistxattr" number="196"/>
<syscall name="removexattr" number="197"/>
<syscall name="lremovexattr" number="198"/>
<syscall name="fremovexattr" number="199"/>
<syscall name="tkill" number="200"/>
<syscall name="time" number="201"/>
<syscall name="futex" number="202"/>
<syscall name="sched_setaffinity" number="203"/>
<syscall name="sched_getaffinity" number="204"/>
<syscall name="set_thread_area" number="205"/>
<syscall name="io_setup" number="206"/>
<syscall name="io_destroy" number="207"/>
<syscall name="io_getevents" number="208"/>
<syscall name="io_submit" number="209"/>
<syscall name="io_cancel" number="210"/>
<syscall name="get_thread_area" number="211"/>
<syscall name="lookup_dcookie" number="212"/>
<syscall name="epoll_create" number="213"/>
<syscall name="epoll_ctl_old" number="214"/>
<syscall name="epoll_wait_old" number="215"/>
<syscall name="remap_file_pages" number="216"/>
<syscall name="getdents64" number="217"/>
<syscall name="set_tid_address" number="218"/>
<syscall name="restart_syscall" number="219"/>
<syscall name="semtimedop" number="220"/>
<syscall name="fadvise64" number="221"/>
<syscall name="timer_create" number="222"/>
<syscall name="timer_settime" number="223"/>
<syscall name="timer_gettime" number="224"/>
<syscall name="timer_getoverrun" number="225"/>
<syscall name="timer_delete" number="226"/>
<syscall name="clock_settime" number="227"/>
<syscall name="clock_gettime" number="228"/>
<syscall name="clock_getres" number="229"/>
<syscall name="clock_nanosleep" number="230"/>
<syscall name="exit_group" number="231"/>
<syscall name="epoll_wait" number="232"/>
<syscall name="epoll_ctl" number="233"/>
<syscall name="tgkill" number="234"/>
<syscall name="utimes" number="235"/>
<syscall name="vserver" number="236"/>
<syscall name="mbind" number="237"/>
<syscall name="set_mempolicy" number="238"/>
<syscall name="get_mempolicy" number="239"/>
<syscall name="mq_open" number="240"/>
<syscall name="mq_unlink" number="241"/>
<syscall name="mq_timedsend" number="242"/>
<syscall name="mq_timedreceive" number="243"/>
<syscall name="mq_notify" number="244"/>
<syscall name="mq_getsetattr" number="245"/>
<syscall name="kexec_load" number="246"/>
<syscall name="waitid" number="247"/>
<syscall name="add_key" number="248"/>
<syscall name="request_key" number="249"/>
<syscall name="keyctl" number="250"/>
<syscall name="ioprio_set" number="251"/>
<syscall name="ioprio_get" number="252"/>
<syscall name="inotify_init" number="253"/>
<syscall name="inotify_add_watch" number="254"/>
<syscall name="inotify_rm_watch" number="255"/>
<syscall name="migrate_pages" number="256"/>
<syscall name="openat" number="257"/>
<syscall name="mkdirat" number="258"/>
<syscall name="mknodat" number="259"/>
<syscall name="fchownat" number="260"/>
<syscall name="futimesat" number="261"/>
<syscall name="newfstatat" number="262"/>
<syscall name="unlinkat" number="263"/>
<syscall name="renameat" number="264"/>
<syscall name="linkat" number="265"/>
<syscall name="symlinkat" number="266"/>
<syscall name="readlinkat" number="267"/>
<syscall name="fchmodat" number="268"/>
<syscall name="faccessat" number="269"/>
<syscall name="pselect6" number="270"/>
<syscall name="ppoll" number="271"/>
<syscall name="unshare" number="272"/>
<syscall name="set_robust_list" number="273"/>
<syscall name="get_robust_list" number="274"/>
<syscall name="splice" number="275"/>
<syscall name="tee" number="276"/>
<syscall name="sync_file_range" number="277"/>
<syscall name="vmsplice" number="278"/>
<syscall name="move_pages" number="279"/>
<syscall name="utimensat" number="280"/>
<syscall name="epoll_pwait" number="281"/>
<syscall name="signalfd" number="282"/>
<syscall name="timerfd_create" number="283"/>
<syscall name="eventfd" number="284"/>
<syscall name="fallocate" number="285"/>
<syscall name="timerfd_settime" number="286"/>
<syscall name="timerfd_gettime" number="287"/>
<syscall name="accept4" number="288"/>
<syscall name="signalfd4" number="289"/>
<syscall name="eventfd2" number="290"/>
<syscall name="epoll_create1" number="291"/>
<syscall name="dup3" number="292"/>
<syscall name="pipe2" number="293"/>
<syscall name="inotify_init1" number="294"/>
<syscall name="preadv" number="295"/>
<syscall name="pwritev" number="296"/>
</syscalls_info>

View File

@ -0,0 +1,14 @@
<!-- Copyright (C) 2009-2013 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. -->
<!-- The root element of a syscall info is <syscalls-info>. -->
<!ELEMENT syscalls-info (syscall*)>
<!ELEMENT syscall EMPTY>
<!ATTLIST syscall
name CDATA #REQUIRED
number CDATA #REQUIRED>

View File

@ -0,0 +1,340 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2009-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/x86/include/asm/unistd_32.h
The file mentioned above belongs to the Linux Kernel. -->
<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"/>
<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"/>
<syscall name="oldstat" number="18"/>
<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"/>
<syscall name="pause" number="29"/>
<syscall name="utime" number="30"/>
<syscall name="stty" number="31"/>
<syscall name="gtty" number="32"/>
<syscall name="access" number="33"/>
<syscall name="nice" number="34"/>
<syscall name="ftime" number="35"/>
<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"/>
<syscall name="brk" number="45"/>
<syscall name="setgid" number="46"/>
<syscall name="getgid" number="47"/>
<syscall name="signal" number="48"/>
<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"/>
<syscall name="ioctl" number="54"/>
<syscall name="fcntl" number="55"/>
<syscall name="mpx" number="56"/>
<syscall name="setpgid" number="57"/>
<syscall name="ulimit" number="58"/>
<syscall name="oldolduname" number="59"/>
<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"/>
<syscall name="ssetmask" number="69"/>
<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"/>
<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"/>
<syscall name="statfs" number="99"/>
<syscall name="fstatfs" number="100"/>
<syscall name="ioperm" number="101"/>
<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"/>
<syscall name="iopl" number="110"/>
<syscall name="vhangup" number="111"/>
<syscall name="idle" number="112"/>
<syscall name="vm86old" 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"/>
<syscall name="adjtimex" number="124"/>
<syscall name="mprotect" number="125"/>
<syscall name="sigprocmask" number="126"/>
<syscall name="create_module" number="127"/>
<syscall name="init_module" number="128"/>
<syscall name="delete_module" number="129"/>
<syscall name="get_kernel_syms" number="130"/>
<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"/>
<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"/>
<syscall name="query_module" number="167"/>
<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="getpmsg" number="188"/>
<syscall name="putpmsg" number="189"/>
<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="pivot_root" number="217"/>
<syscall name="mincore" number="218"/>
<syscall name="madvise" number="219"/>
<syscall name="madvise1" number="220"/>
<syscall name="getdents64" number="221"/>
<syscall name="fcntl64" number="222"/>
<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="set_thread_area" number="243"/>
<syscall name="get_thread_area" number="244"/>
<syscall name="io_setup" number="245"/>
<syscall name="io_destroy" number="246"/>
<syscall name="io_getevents" number="247"/>
<syscall name="io_submit" number="248"/>
<syscall name="io_cancel" number="249"/>
<syscall name="fadvise64" number="250"/>
<syscall name="exit_group" number="252"/>
<syscall name="lookup_dcookie" number="253"/>
<syscall name="epoll_create" number="254"/>
<syscall name="epoll_ctl" number="255"/>
<syscall name="epoll_wait" number="256"/>
<syscall name="remap_file_pages" number="257"/>
<syscall name="set_tid_address" number="258"/>
<syscall name="timer_create" number="259"/>
<syscall name="timer_settime" number="260"/>
<syscall name="timer_gettime" number="261"/>
<syscall name="timer_getoverrun" number="262"/>
<syscall name="timer_delete" number="263"/>
<syscall name="clock_settime" number="264"/>
<syscall name="clock_gettime" number="265"/>
<syscall name="clock_getres" number="266"/>
<syscall name="clock_nanosleep" number="267"/>
<syscall name="statfs64" number="268"/>
<syscall name="fstatfs64" number="269"/>
<syscall name="tgkill" number="270"/>
<syscall name="utimes" number="271"/>
<syscall name="fadvise64_64" number="272"/>
<syscall name="vserver" number="273"/>
<syscall name="mbind" number="274"/>
<syscall name="get_mempolicy" number="275"/>
<syscall name="set_mempolicy" number="276"/>
<syscall name="mq_open" number="277"/>
<syscall name="mq_unlink" number="278"/>
<syscall name="mq_timedsend" number="279"/>
<syscall name="mq_timedreceive" number="280"/>
<syscall name="mq_notify" number="281"/>
<syscall name="mq_getsetattr" number="282"/>
<syscall name="kexec_load" number="283"/>
<syscall name="waitid" number="284"/>
<syscall name="add_key" number="286"/>
<syscall name="request_key" number="287"/>
<syscall name="keyctl" number="288"/>
<syscall name="ioprio_set" number="289"/>
<syscall name="ioprio_get" number="290"/>
<syscall name="inotify_init" number="291"/>
<syscall name="inotify_add_watch" number="292"/>
<syscall name="inotify_rm_watch" number="293"/>
<syscall name="migrate_pages" number="294"/>
<syscall name="openat" number="295"/>
<syscall name="mkdirat" number="296"/>
<syscall name="mknodat" number="297"/>
<syscall name="fchownat" number="298"/>
<syscall name="futimesat" number="299"/>
<syscall name="fstatat64" number="300"/>
<syscall name="unlinkat" number="301"/>
<syscall name="renameat" number="302"/>
<syscall name="linkat" number="303"/>
<syscall name="symlinkat" number="304"/>
<syscall name="readlinkat" number="305"/>
<syscall name="fchmodat" number="306"/>
<syscall name="faccessat" number="307"/>
<syscall name="pselect6" number="308"/>
<syscall name="ppoll" number="309"/>
<syscall name="unshare" number="310"/>
<syscall name="set_robust_list" number="311"/>
<syscall name="get_robust_list" number="312"/>
<syscall name="splice" number="313"/>
<syscall name="sync_file_range" number="314"/>
<syscall name="tee" number="315"/>
<syscall name="vmsplice" number="316"/>
<syscall name="move_pages" number="317"/>
<syscall name="getcpu" number="318"/>
<syscall name="epoll_pwait" number="319"/>
<syscall name="utimensat" number="320"/>
<syscall name="signalfd" number="321"/>
<syscall name="timerfd_create" number="322"/>
<syscall name="eventfd" number="323"/>
<syscall name="fallocate" number="324"/>
<syscall name="timerfd_settime" number="325"/>
</syscalls_info>

View File

@ -0,0 +1,319 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2011-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/mips/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<syscalls_info>
<syscall name="read" number="6000"/>
<syscall name="write" number="6001"/>
<syscall name="open" number="6002"/>
<syscall name="close" number="6003"/>
<syscall name="stat" number="6004"/>
<syscall name="fstat" number="6005"/>
<syscall name="lstat" number="6006"/>
<syscall name="poll" number="6007"/>
<syscall name="lseek" number="6008"/>
<syscall name="mmap" number="6009"/>
<syscall name="mprotect" number="6010"/>
<syscall name="munmap" number="6011"/>
<syscall name="brk" number="6012"/>
<syscall name="rt_sigaction" number="6013"/>
<syscall name="rt_sigprocmask" number="6014"/>
<syscall name="ioctl" number="6015"/>
<syscall name="pread64" number="6016"/>
<syscall name="pwrite64" number="6017"/>
<syscall name="readv" number="6018"/>
<syscall name="writev" number="6019"/>
<syscall name="access" number="6020"/>
<syscall name="pipe" number="6021"/>
<syscall name="_newselect" number="6022"/>
<syscall name="sched_yield" number="6023"/>
<syscall name="mremap" number="6024"/>
<syscall name="msync" number="6025"/>
<syscall name="mincore" number="6026"/>
<syscall name="madvise" number="6027"/>
<syscall name="shmget" number="6028"/>
<syscall name="shmat" number="6029"/>
<syscall name="shmctl" number="6030"/>
<syscall name="dup" number="6031"/>
<syscall name="dup2" number="6032"/>
<syscall name="pause" number="6033"/>
<syscall name="nanosleep" number="6034"/>
<syscall name="getitimer" number="6035"/>
<syscall name="setitimer" number="6036"/>
<syscall name="alarm" number="6037"/>
<syscall name="getpid" number="6038"/>
<syscall name="sendfile" number="6039"/>
<syscall name="socket" number="6040"/>
<syscall name="connect" number="6041"/>
<syscall name="accept" number="6042"/>
<syscall name="sendto" number="6043"/>
<syscall name="recvfrom" number="6044"/>
<syscall name="sendmsg" number="6045"/>
<syscall name="recvmsg" number="6046"/>
<syscall name="shutdown" number="6047"/>
<syscall name="bind" number="6048"/>
<syscall name="listen" number="6049"/>
<syscall name="getsockname" number="6050"/>
<syscall name="getpeername" number="6051"/>
<syscall name="socketpair" number="6052"/>
<syscall name="setsockopt" number="6053"/>
<syscall name="getsockopt" number="6054"/>
<syscall name="clone" number="6055"/>
<syscall name="fork" number="6056"/>
<syscall name="execve" number="6057"/>
<syscall name="exit" number="6058"/>
<syscall name="wait4" number="6059"/>
<syscall name="kill" number="6060"/>
<syscall name="uname" number="6061"/>
<syscall name="semget" number="6062"/>
<syscall name="semop" number="6063"/>
<syscall name="semctl" number="6064"/>
<syscall name="shmdt" number="6065"/>
<syscall name="msgget" number="6066"/>
<syscall name="msgsnd" number="6067"/>
<syscall name="msgrcv" number="6068"/>
<syscall name="msgctl" number="6069"/>
<syscall name="fcntl" number="6070"/>
<syscall name="flock" number="6071"/>
<syscall name="fsync" number="6072"/>
<syscall name="fdatasync" number="6073"/>
<syscall name="truncate" number="6074"/>
<syscall name="ftruncate" number="6075"/>
<syscall name="getdents" number="6076"/>
<syscall name="getcwd" number="6077"/>
<syscall name="chdir" number="6078"/>
<syscall name="fchdir" number="6079"/>
<syscall name="rename" number="6080"/>
<syscall name="mkdir" number="6081"/>
<syscall name="rmdir" number="6082"/>
<syscall name="creat" number="6083"/>
<syscall name="link" number="6084"/>
<syscall name="unlink" number="6085"/>
<syscall name="symlink" number="6086"/>
<syscall name="readlink" number="6087"/>
<syscall name="chmod" number="6088"/>
<syscall name="fchmod" number="6089"/>
<syscall name="chown" number="6090"/>
<syscall name="fchown" number="6091"/>
<syscall name="lchown" number="6092"/>
<syscall name="umask" number="6093"/>
<syscall name="gettimeofday" number="6094"/>
<syscall name="getrlimit" number="6095"/>
<syscall name="getrusage" number="6096"/>
<syscall name="sysinfo" number="6097"/>
<syscall name="times" number="6098"/>
<syscall name="ptrace" number="6099"/>
<syscall name="getuid" number="6100"/>
<syscall name="syslog" number="6101"/>
<syscall name="getgid" number="6102"/>
<syscall name="setuid" number="6103"/>
<syscall name="setgid" number="6104"/>
<syscall name="geteuid" number="6105"/>
<syscall name="getegid" number="6106"/>
<syscall name="setpgid" number="6107"/>
<syscall name="getppid" number="6108"/>
<syscall name="getpgrp" number="6109"/>
<syscall name="setsid" number="6110"/>
<syscall name="setreuid" number="6111"/>
<syscall name="setregid" number="6112"/>
<syscall name="getgroups" number="6113"/>
<syscall name="setgroups" number="6114"/>
<syscall name="setresuid" number="6115"/>
<syscall name="getresuid" number="6116"/>
<syscall name="setresgid" number="6117"/>
<syscall name="getresgid" number="6118"/>
<syscall name="getpgid" number="6119"/>
<syscall name="setfsuid" number="6120"/>
<syscall name="setfsgid" number="6121"/>
<syscall name="getsid" number="6122"/>
<syscall name="capget" number="6123"/>
<syscall name="capset" number="6124"/>
<syscall name="rt_sigpending" number="6125"/>
<syscall name="rt_sigtimedwait" number="6126"/>
<syscall name="rt_sigqueueinfo" number="6127"/>
<syscall name="rt_sigsuspend" number="6128"/>
<syscall name="sigaltstack" number="6129"/>
<syscall name="utime" number="6130"/>
<syscall name="mknod" number="6131"/>
<syscall name="personality" number="6132"/>
<syscall name="ustat" number="6133"/>
<syscall name="statfs" number="6134"/>
<syscall name="fstatfs" number="6135"/>
<syscall name="sysfs" number="6136"/>
<syscall name="getpriority" number="6137"/>
<syscall name="setpriority" number="6138"/>
<syscall name="sched_setparam" number="6139"/>
<syscall name="sched_getparam" number="6140"/>
<syscall name="sched_setscheduler" number="6141"/>
<syscall name="sched_getscheduler" number="6142"/>
<syscall name="sched_get_priority_max" number="6143"/>
<syscall name="sched_get_priority_min" number="6144"/>
<syscall name="sched_rr_get_interval" number="6145"/>
<syscall name="mlock" number="6146"/>
<syscall name="munlock" number="6147"/>
<syscall name="mlockall" number="6148"/>
<syscall name="munlockall" number="6149"/>
<syscall name="vhangup" number="6150"/>
<syscall name="pivot_root" number="6151"/>
<syscall name="_sysctl" number="6152"/>
<syscall name="prctl" number="6153"/>
<syscall name="adjtimex" number="6154"/>
<syscall name="setrlimit" number="6155"/>
<syscall name="chroot" number="6156"/>
<syscall name="sync" number="6157"/>
<syscall name="acct" number="6158"/>
<syscall name="settimeofday" number="6159"/>
<syscall name="mount" number="6160"/>
<syscall name="umount2" number="6161"/>
<syscall name="swapon" number="6162"/>
<syscall name="swapoff" number="6163"/>
<syscall name="reboot" number="6164"/>
<syscall name="sethostname" number="6165"/>
<syscall name="setdomainname" number="6166"/>
<syscall name="create_module" number="6167"/>
<syscall name="init_module" number="6168"/>
<syscall name="delete_module" number="6169"/>
<syscall name="get_kernel_syms" number="6170"/>
<syscall name="query_module" number="6171"/>
<syscall name="quotactl" number="6172"/>
<syscall name="nfsservctl" number="6173"/>
<syscall name="getpmsg" number="6174"/>
<syscall name="putpmsg" number="6175"/>
<syscall name="afs_syscall" number="6176"/>
<syscall name="reserved177" number="6177"/>
<syscall name="gettid" number="6178"/>
<syscall name="readahead" number="6179"/>
<syscall name="setxattr" number="6180"/>
<syscall name="lsetxattr" number="6181"/>
<syscall name="fsetxattr" number="6182"/>
<syscall name="getxattr" number="6183"/>
<syscall name="lgetxattr" number="6184"/>
<syscall name="fgetxattr" number="6185"/>
<syscall name="listxattr" number="6186"/>
<syscall name="llistxattr" number="6187"/>
<syscall name="flistxattr" number="6188"/>
<syscall name="removexattr" number="6189"/>
<syscall name="lremovexattr" number="6190"/>
<syscall name="fremovexattr" number="6191"/>
<syscall name="tkill" number="6192"/>
<syscall name="reserved193" number="6193"/>
<syscall name="futex" number="6194"/>
<syscall name="sched_setaffinity" number="6195"/>
<syscall name="sched_getaffinity" number="6196"/>
<syscall name="cacheflush" number="6197"/>
<syscall name="cachectl" number="6198"/>
<syscall name="sysmips" number="6199"/>
<syscall name="io_setup" number="6200"/>
<syscall name="io_destroy" number="6201"/>
<syscall name="io_getevents" number="6202"/>
<syscall name="io_submit" number="6203"/>
<syscall name="io_cancel" number="6204"/>
<syscall name="exit_group" number="6205"/>
<syscall name="lookup_dcookie" number="6206"/>
<syscall name="epoll_create" number="6207"/>
<syscall name="epoll_ctl" number="6208"/>
<syscall name="epoll_wait" number="6209"/>
<syscall name="remap_file_pages" number="6210"/>
<syscall name="rt_sigreturn" number="6211"/>
<syscall name="fcntl64" number="6212"/>
<syscall name="set_tid_address" number="6213"/>
<syscall name="restart_syscall" number="6214"/>
<syscall name="semtimedop" number="6215"/>
<syscall name="fadvise64" number="6216"/>
<syscall name="statfs64" number="6217"/>
<syscall name="fstatfs64" number="6218"/>
<syscall name="sendfile64" number="6219"/>
<syscall name="timer_create" number="6220"/>
<syscall name="timer_settime" number="6221"/>
<syscall name="timer_gettime" number="6222"/>
<syscall name="timer_getoverrun" number="6223"/>
<syscall name="timer_delete" number="6224"/>
<syscall name="clock_settime" number="6225"/>
<syscall name="clock_gettime" number="6226"/>
<syscall name="clock_getres" number="6227"/>
<syscall name="clock_nanosleep" number="6228"/>
<syscall name="tgkill" number="6229"/>
<syscall name="utimes" number="6230"/>
<syscall name="mbind" number="6231"/>
<syscall name="get_mempolicy" number="6232"/>
<syscall name="set_mempolicy" number="6233"/>
<syscall name="mq_open" number="6234"/>
<syscall name="mq_unlink" number="6235"/>
<syscall name="mq_timedsend" number="6236"/>
<syscall name="mq_timedreceive" number="6237"/>
<syscall name="mq_notify" number="6238"/>
<syscall name="mq_getsetattr" number="6239"/>
<syscall name="vserver" number="6240"/>
<syscall name="waitid" number="6241"/>
<syscall name="add_key" number="6243"/>
<syscall name="request_key" number="6244"/>
<syscall name="keyctl" number="6245"/>
<syscall name="set_thread_area" number="6246"/>
<syscall name="inotify_init" number="6247"/>
<syscall name="inotify_add_watch" number="6248"/>
<syscall name="inotify_rm_watch" number="6249"/>
<syscall name="migrate_pages" number="6250"/>
<syscall name="openat" number="6251"/>
<syscall name="mkdirat" number="6252"/>
<syscall name="mknodat" number="6253"/>
<syscall name="fchownat" number="6254"/>
<syscall name="futimesat" number="6255"/>
<syscall name="newfstatat" number="6256"/>
<syscall name="unlinkat" number="6257"/>
<syscall name="renameat" number="6258"/>
<syscall name="linkat" number="6259"/>
<syscall name="symlinkat" number="6260"/>
<syscall name="readlinkat" number="6261"/>
<syscall name="fchmodat" number="6262"/>
<syscall name="faccessat" number="6263"/>
<syscall name="pselect6" number="6264"/>
<syscall name="ppoll" number="6265"/>
<syscall name="unshare" number="6266"/>
<syscall name="splice" number="6267"/>
<syscall name="sync_file_range" number="6268"/>
<syscall name="tee" number="6269"/>
<syscall name="vmsplice" number="6270"/>
<syscall name="move_pages" number="6271"/>
<syscall name="set_robust_list" number="6272"/>
<syscall name="get_robust_list" number="6273"/>
<syscall name="kexec_load" number="6274"/>
<syscall name="getcpu" number="6275"/>
<syscall name="epoll_pwait" number="6276"/>
<syscall name="ioprio_set" number="6277"/>
<syscall name="ioprio_get" number="6278"/>
<syscall name="utimensat" number="6279"/>
<syscall name="signalfd" number="6280"/>
<syscall name="timerfd" number="6281"/>
<syscall name="eventfd" number="6282"/>
<syscall name="fallocate" number="6283"/>
<syscall name="timerfd_create" number="6284"/>
<syscall name="timerfd_gettime" number="6285"/>
<syscall name="timerfd_settime" number="6286"/>
<syscall name="signalfd4" number="6287"/>
<syscall name="eventfd2" number="6288"/>
<syscall name="epoll_create1" number="6289"/>
<syscall name="dup3" number="6290"/>
<syscall name="pipe2" number="6291"/>
<syscall name="inotify_init1" number="6292"/>
<syscall name="preadv" number="6293"/>
<syscall name="pwritev" number="6294"/>
<syscall name="rt_tgsigqueueinfo" number="6295"/>
<syscall name="perf_event_open" number="6296"/>
<syscall name="accept4" number="6297"/>
<syscall name="recvmmsg" number="6298"/>
<syscall name="getdents64" number="6299"/>
<syscall name="fanotify_init" number="6300"/>
<syscall name="fanotify_mark" number="6301"/>
<syscall name="prlimit64" number="6302"/>
</syscalls_info>

View File

@ -0,0 +1,312 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2011-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/mips/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<syscalls_info>
<syscall name="read" number="5000"/>
<syscall name="write" number="5001"/>
<syscall name="open" number="5002"/>
<syscall name="close" number="5003"/>
<syscall name="stat" number="5004"/>
<syscall name="fstat" number="5005"/>
<syscall name="lstat" number="5006"/>
<syscall name="poll" number="5007"/>
<syscall name="lseek" number="5008"/>
<syscall name="mmap" number="5009"/>
<syscall name="mprotect" number="5010"/>
<syscall name="munmap" number="5011"/>
<syscall name="brk" number="5012"/>
<syscall name="rt_sigaction" number="5013"/>
<syscall name="rt_sigprocmask" number="5014"/>
<syscall name="ioctl" number="5015"/>
<syscall name="pread64" number="5016"/>
<syscall name="pwrite64" number="5017"/>
<syscall name="readv" number="5018"/>
<syscall name="writev" number="5019"/>
<syscall name="access" number="5020"/>
<syscall name="pipe" number="5021"/>
<syscall name="_newselect" number="5022"/>
<syscall name="sched_yield" number="5023"/>
<syscall name="mremap" number="5024"/>
<syscall name="msync" number="5025"/>
<syscall name="mincore" number="5026"/>
<syscall name="madvise" number="5027"/>
<syscall name="shmget" number="5028"/>
<syscall name="shmat" number="5029"/>
<syscall name="shmctl" number="5030"/>
<syscall name="dup" number="5031"/>
<syscall name="dup2" number="5032"/>
<syscall name="pause" number="5033"/>
<syscall name="nanosleep" number="5034"/>
<syscall name="getitimer" number="5035"/>
<syscall name="setitimer" number="5036"/>
<syscall name="alarm" number="5037"/>
<syscall name="getpid" number="5038"/>
<syscall name="sendfile" number="5039"/>
<syscall name="socket" number="5040"/>
<syscall name="connect" number="5041"/>
<syscall name="accept" number="5042"/>
<syscall name="sendto" number="5043"/>
<syscall name="recvfrom" number="5044"/>
<syscall name="sendmsg" number="5045"/>
<syscall name="recvmsg" number="5046"/>
<syscall name="shutdown" number="5047"/>
<syscall name="bind" number="5048"/>
<syscall name="listen" number="5049"/>
<syscall name="getsockname" number="5050"/>
<syscall name="getpeername" number="5051"/>
<syscall name="socketpair" number="5052"/>
<syscall name="setsockopt" number="5053"/>
<syscall name="getsockopt" number="5054"/>
<syscall name="clone" number="5055"/>
<syscall name="fork" number="5056"/>
<syscall name="execve" number="5057"/>
<syscall name="exit" number="5058"/>
<syscall name="wait4" number="5059"/>
<syscall name="kill" number="5060"/>
<syscall name="uname" number="5061"/>
<syscall name="semget" number="5062"/>
<syscall name="semop" number="5063"/>
<syscall name="semctl" number="5064"/>
<syscall name="shmdt" number="5065"/>
<syscall name="msgget" number="5066"/>
<syscall name="msgsnd" number="5067"/>
<syscall name="msgrcv" number="5068"/>
<syscall name="msgctl" number="5069"/>
<syscall name="fcntl" number="5070"/>
<syscall name="flock" number="5071"/>
<syscall name="fsync" number="5072"/>
<syscall name="fdatasync" number="5073"/>
<syscall name="truncate" number="5074"/>
<syscall name="ftruncate" number="5075"/>
<syscall name="getdents" number="5076"/>
<syscall name="getcwd" number="5077"/>
<syscall name="chdir" number="5078"/>
<syscall name="fchdir" number="5079"/>
<syscall name="rename" number="5080"/>
<syscall name="mkdir" number="5081"/>
<syscall name="rmdir" number="5082"/>
<syscall name="creat" number="5083"/>
<syscall name="link" number="5084"/>
<syscall name="unlink" number="5085"/>
<syscall name="symlink" number="5086"/>
<syscall name="readlink" number="5087"/>
<syscall name="chmod" number="5088"/>
<syscall name="fchmod" number="5089"/>
<syscall name="chown" number="5090"/>
<syscall name="fchown" number="5091"/>
<syscall name="lchown" number="5092"/>
<syscall name="umask" number="5093"/>
<syscall name="gettimeofday" number="5094"/>
<syscall name="getrlimit" number="5095"/>
<syscall name="getrusage" number="5096"/>
<syscall name="sysinfo" number="5097"/>
<syscall name="times" number="5098"/>
<syscall name="ptrace" number="5099"/>
<syscall name="getuid" number="5100"/>
<syscall name="syslog" number="5101"/>
<syscall name="getgid" number="5102"/>
<syscall name="setuid" number="5103"/>
<syscall name="setgid" number="5104"/>
<syscall name="geteuid" number="5105"/>
<syscall name="getegid" number="5106"/>
<syscall name="setpgid" number="5107"/>
<syscall name="getppid" number="5108"/>
<syscall name="getpgrp" number="5109"/>
<syscall name="setsid" number="5110"/>
<syscall name="setreuid" number="5111"/>
<syscall name="setregid" number="5112"/>
<syscall name="getgroups" number="5113"/>
<syscall name="setgroups" number="5114"/>
<syscall name="setresuid" number="5115"/>
<syscall name="getresuid" number="5116"/>
<syscall name="setresgid" number="5117"/>
<syscall name="getresgid" number="5118"/>
<syscall name="getpgid" number="5119"/>
<syscall name="setfsuid" number="5120"/>
<syscall name="setfsgid" number="5121"/>
<syscall name="getsid" number="5122"/>
<syscall name="capget" number="5123"/>
<syscall name="capset" number="5124"/>
<syscall name="rt_sigpending" number="5125"/>
<syscall name="rt_sigtimedwait" number="5126"/>
<syscall name="rt_sigqueueinfo" number="5127"/>
<syscall name="rt_sigsuspend" number="5128"/>
<syscall name="sigaltstack" number="5129"/>
<syscall name="utime" number="5130"/>
<syscall name="mknod" number="5131"/>
<syscall name="personality" number="5132"/>
<syscall name="ustat" number="5133"/>
<syscall name="statfs" number="5134"/>
<syscall name="fstatfs" number="5135"/>
<syscall name="sysfs" number="5136"/>
<syscall name="getpriority" number="5137"/>
<syscall name="setpriority" number="5138"/>
<syscall name="sched_setparam" number="5139"/>
<syscall name="sched_getparam" number="5140"/>
<syscall name="sched_setscheduler" number="5141"/>
<syscall name="sched_getscheduler" number="5142"/>
<syscall name="sched_get_priority_max" number="5143"/>
<syscall name="sched_get_priority_min" number="5144"/>
<syscall name="sched_rr_get_interval" number="5145"/>
<syscall name="mlock" number="5146"/>
<syscall name="munlock" number="5147"/>
<syscall name="mlockall" number="5148"/>
<syscall name="munlockall" number="5149"/>
<syscall name="vhangup" number="5150"/>
<syscall name="pivot_root" number="5151"/>
<syscall name="_sysctl" number="5152"/>
<syscall name="prctl" number="5153"/>
<syscall name="adjtimex" number="5154"/>
<syscall name="setrlimit" number="5155"/>
<syscall name="chroot" number="5156"/>
<syscall name="sync" number="5157"/>
<syscall name="acct" number="5158"/>
<syscall name="settimeofday" number="5159"/>
<syscall name="mount" number="5160"/>
<syscall name="umount2" number="5161"/>
<syscall name="swapon" number="5162"/>
<syscall name="swapoff" number="5163"/>
<syscall name="reboot" number="5164"/>
<syscall name="sethostname" number="5165"/>
<syscall name="setdomainname" number="5166"/>
<syscall name="create_module" number="5167"/>
<syscall name="init_module" number="5168"/>
<syscall name="delete_module" number="5169"/>
<syscall name="get_kernel_syms" number="5170"/>
<syscall name="query_module" number="5171"/>
<syscall name="quotactl" number="5172"/>
<syscall name="nfsservctl" number="5173"/>
<syscall name="getpmsg" number="5174"/>
<syscall name="putpmsg" number="5175"/>
<syscall name="afs_syscall" number="5176"/>
<syscall name="gettid" number="5178"/>
<syscall name="readahead" number="5179"/>
<syscall name="setxattr" number="5180"/>
<syscall name="lsetxattr" number="5181"/>
<syscall name="fsetxattr" number="5182"/>
<syscall name="getxattr" number="5183"/>
<syscall name="lgetxattr" number="5184"/>
<syscall name="fgetxattr" number="5185"/>
<syscall name="listxattr" number="5186"/>
<syscall name="llistxattr" number="5187"/>
<syscall name="flistxattr" number="5188"/>
<syscall name="removexattr" number="5189"/>
<syscall name="lremovexattr" number="5190"/>
<syscall name="fremovexattr" number="5191"/>
<syscall name="tkill" number="5192"/>
<syscall name="futex" number="5194"/>
<syscall name="sched_setaffinity" number="5195"/>
<syscall name="sched_getaffinity" number="5196"/>
<syscall name="cacheflush" number="5197"/>
<syscall name="cachectl" number="5198"/>
<syscall name="sysmips" number="5199"/>
<syscall name="io_setup" number="5200"/>
<syscall name="io_destroy" number="5201"/>
<syscall name="io_getevents" number="5202"/>
<syscall name="io_submit" number="5203"/>
<syscall name="io_cancel" number="5204"/>
<syscall name="exit_group" number="5205"/>
<syscall name="lookup_dcookie" number="5206"/>
<syscall name="epoll_create" number="5207"/>
<syscall name="epoll_ctl" number="5208"/>
<syscall name="epoll_wait" number="5209"/>
<syscall name="remap_file_pages" number="5210"/>
<syscall name="rt_sigreturn" number="5211"/>
<syscall name="set_tid_address" number="5212"/>
<syscall name="restart_syscall" number="5213"/>
<syscall name="semtimedop" number="5214"/>
<syscall name="fadvise64" number="5215"/>
<syscall name="timer_create" number="5216"/>
<syscall name="timer_settime" number="5217"/>
<syscall name="timer_gettime" number="5218"/>
<syscall name="timer_getoverrun" number="5219"/>
<syscall name="timer_delete" number="5220"/>
<syscall name="clock_settime" number="5221"/>
<syscall name="clock_gettime" number="5222"/>
<syscall name="clock_getres" number="5223"/>
<syscall name="clock_nanosleep" number="5224"/>
<syscall name="tgkill" number="5225"/>
<syscall name="utimes" number="5226"/>
<syscall name="mbind" number="5227"/>
<syscall name="get_mempolicy" number="5228"/>
<syscall name="set_mempolicy" number="5229"/>
<syscall name="mq_open" number="5230"/>
<syscall name="mq_unlink" number="5231"/>
<syscall name="mq_timedsend" number="5232"/>
<syscall name="mq_timedreceive" number="5233"/>
<syscall name="mq_notify" number="5234"/>
<syscall name="mq_getsetattr" number="5235"/>
<syscall name="vserver" number="5236"/>
<syscall name="waitid" number="5237"/>
<syscall name="add_key" number="5239"/>
<syscall name="request_key" number="5240"/>
<syscall name="keyctl" number="5241"/>
<syscall name="set_thread_area" number="5242"/>
<syscall name="inotify_init" number="5243"/>
<syscall name="inotify_add_watch" number="5244"/>
<syscall name="inotify_rm_watch" number="5245"/>
<syscall name="migrate_pages" number="5246"/>
<syscall name="openat" number="5247"/>
<syscall name="mkdirat" number="5248"/>
<syscall name="mknodat" number="5249"/>
<syscall name="fchownat" number="5250"/>
<syscall name="futimesat" number="5251"/>
<syscall name="newfstatat" number="5252"/>
<syscall name="unlinkat" number="5253"/>
<syscall name="renameat" number="5254"/>
<syscall name="linkat" number="5255"/>
<syscall name="symlinkat" number="5256"/>
<syscall name="readlinkat" number="5257"/>
<syscall name="fchmodat" number="5258"/>
<syscall name="faccessat" number="5259"/>
<syscall name="pselect6" number="5260"/>
<syscall name="ppoll" number="5261"/>
<syscall name="unshare" number="5262"/>
<syscall name="splice" number="5263"/>
<syscall name="sync_file_range" number="5264"/>
<syscall name="tee" number="5265"/>
<syscall name="vmsplice" number="5266"/>
<syscall name="move_pages" number="5267"/>
<syscall name="set_robust_list" number="5268"/>
<syscall name="get_robust_list" number="5269"/>
<syscall name="kexec_load" number="5270"/>
<syscall name="getcpu" number="5271"/>
<syscall name="epoll_pwait" number="5272"/>
<syscall name="ioprio_set" number="5273"/>
<syscall name="ioprio_get" number="5274"/>
<syscall name="utimensat" number="5275"/>
<syscall name="signalfd" number="5276"/>
<syscall name="timerfd" number="5277"/>
<syscall name="eventfd" number="5278"/>
<syscall name="fallocate" number="5279"/>
<syscall name="timerfd_create" number="5280"/>
<syscall name="timerfd_gettime" number="5281"/>
<syscall name="timerfd_settime" number="5282"/>
<syscall name="signalfd4" number="5283"/>
<syscall name="eventfd2" number="5284"/>
<syscall name="epoll_create1" number="5285"/>
<syscall name="dup3" number="5286"/>
<syscall name="pipe2" number="5287"/>
<syscall name="inotify_init1" number="5288"/>
<syscall name="preadv" number="5289"/>
<syscall name="pwritev" number="5290"/>
<syscall name="rt_tgsigqueueinfo" number="5291"/>
<syscall name="perf_event_open" number="5292"/>
<syscall name="accept4" number="5293"/>
<syscall name="recvmmsg" number="5294"/>
<syscall name="fanotify_init" number="5295"/>
<syscall name="fanotify_mark" number="5296"/>
<syscall name="prlimit64" number="5297"/>
</syscalls_info>

View File

@ -0,0 +1,347 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2011-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/mips/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<syscalls_info>
<syscall name="syscall" number="4000"/>
<syscall name="exit" number="4001"/>
<syscall name="fork" number="4002"/>
<syscall name="read" number="4003"/>
<syscall name="write" number="4004"/>
<syscall name="open" number="4005"/>
<syscall name="close" number="4006"/>
<syscall name="waitpid" number="4007"/>
<syscall name="creat" number="4008"/>
<syscall name="link" number="4009"/>
<syscall name="unlink" number="4010"/>
<syscall name="execve" number="4011"/>
<syscall name="chdir" number="4012"/>
<syscall name="time" number="4013"/>
<syscall name="mknod" number="4014"/>
<syscall name="chmod" number="4015"/>
<syscall name="lchown" number="4016"/>
<syscall name="break" number="4017"/>
<syscall name="lseek" number="4019"/>
<syscall name="getpid" number="4020"/>
<syscall name="mount" number="4021"/>
<syscall name="umount" number="4022"/>
<syscall name="setuid" number="4023"/>
<syscall name="getuid" number="4024"/>
<syscall name="stime" number="4025"/>
<syscall name="ptrace" number="4026"/>
<syscall name="alarm" number="4027"/>
<syscall name="pause" number="4029"/>
<syscall name="utime" number="4030"/>
<syscall name="stty" number="4031"/>
<syscall name="gtty" number="4032"/>
<syscall name="access" number="4033"/>
<syscall name="nice" number="4034"/>
<syscall name="ftime" number="4035"/>
<syscall name="sync" number="4036"/>
<syscall name="kill" number="4037"/>
<syscall name="rename" number="4038"/>
<syscall name="mkdir" number="4039"/>
<syscall name="rmdir" number="4040"/>
<syscall name="dup" number="4041"/>
<syscall name="pipe" number="4042"/>
<syscall name="times" number="4043"/>
<syscall name="prof" number="4044"/>
<syscall name="brk" number="4045"/>
<syscall name="setgid" number="4046"/>
<syscall name="getgid" number="4047"/>
<syscall name="signal" number="4048"/>
<syscall name="geteuid" number="4049"/>
<syscall name="getegid" number="4050"/>
<syscall name="acct" number="4051"/>
<syscall name="umount2" number="4052"/>
<syscall name="lock" number="4053"/>
<syscall name="ioctl" number="4054"/>
<syscall name="fcntl" number="4055"/>
<syscall name="mpx" number="4056"/>
<syscall name="setpgid" number="4057"/>
<syscall name="ulimit" number="4058"/>
<syscall name="umask" number="4060"/>
<syscall name="chroot" number="4061"/>
<syscall name="ustat" number="4062"/>
<syscall name="dup2" number="4063"/>
<syscall name="getppid" number="4064"/>
<syscall name="getpgrp" number="4065"/>
<syscall name="setsid" number="4066"/>
<syscall name="sigaction" number="4067"/>
<syscall name="sgetmask" number="4068"/>
<syscall name="ssetmask" number="4069"/>
<syscall name="setreuid" number="4070"/>
<syscall name="setregid" number="4071"/>
<syscall name="sigsuspend" number="4072"/>
<syscall name="sigpending" number="4073"/>
<syscall name="sethostname" number="4074"/>
<syscall name="setrlimit" number="4075"/>
<syscall name="getrlimit" number="4076"/>
<syscall name="getrusage" number="4077"/>
<syscall name="gettimeofday" number="4078"/>
<syscall name="settimeofday" number="4079"/>
<syscall name="getgroups" number="4080"/>
<syscall name="setgroups" number="4081"/>
<syscall name="symlink" number="4083"/>
<syscall name="readlink" number="4085"/>
<syscall name="uselib" number="4086"/>
<syscall name="swapon" number="4087"/>
<syscall name="reboot" number="4088"/>
<syscall name="readdir" number="4089"/>
<syscall name="mmap" number="4090"/>
<syscall name="munmap" number="4091"/>
<syscall name="truncate" number="4092"/>
<syscall name="ftruncate" number="4093"/>
<syscall name="fchmod" number="4094"/>
<syscall name="fchown" number="4095"/>
<syscall name="getpriority" number="4096"/>
<syscall name="setpriority" number="4097"/>
<syscall name="profil" number="4098"/>
<syscall name="statfs" number="4099"/>
<syscall name="fstatfs" number="4100"/>
<syscall name="ioperm" number="4101"/>
<syscall name="socketcall" number="4102"/>
<syscall name="syslog" number="4103"/>
<syscall name="setitimer" number="4104"/>
<syscall name="getitimer" number="4105"/>
<syscall name="stat" number="4106"/>
<syscall name="lstat" number="4107"/>
<syscall name="fstat" number="4108"/>
<syscall name="iopl" number="4110"/>
<syscall name="vhangup" number="4111"/>
<syscall name="idle" number="4112"/>
<syscall name="vm86" number="4113"/>
<syscall name="wait4" number="4114"/>
<syscall name="swapoff" number="4115"/>
<syscall name="sysinfo" number="4116"/>
<syscall name="ipc" number="4117"/>
<syscall name="fsync" number="4118"/>
<syscall name="sigreturn" number="4119"/>
<syscall name="clone" number="4120"/>
<syscall name="setdomainname" number="4121"/>
<syscall name="uname" number="4122"/>
<syscall name="modify_ldt" number="4123"/>
<syscall name="adjtimex" number="4124"/>
<syscall name="mprotect" number="4125"/>
<syscall name="sigprocmask" number="4126"/>
<syscall name="create_module" number="4127"/>
<syscall name="init_module" number="4128"/>
<syscall name="delete_module" number="4129"/>
<syscall name="get_kernel_syms" number="4130"/>
<syscall name="quotactl" number="4131"/>
<syscall name="getpgid" number="4132"/>
<syscall name="fchdir" number="4133"/>
<syscall name="bdflush" number="4134"/>
<syscall name="sysfs" number="4135"/>
<syscall name="personality" number="4136"/>
<syscall name="afs_syscall" number="4137"/>
<syscall name="setfsuid" number="4138"/>
<syscall name="setfsgid" number="4139"/>
<syscall name="_llseek" number="4140"/>
<syscall name="getdents" number="4141"/>
<syscall name="_newselect" number="4142"/>
<syscall name="flock" number="4143"/>
<syscall name="msync" number="4144"/>
<syscall name="readv" number="4145"/>
<syscall name="writev" number="4146"/>
<syscall name="cacheflush" number="4147"/>
<syscall name="cachectl" number="4148"/>
<syscall name="sysmips" number="4149"/>
<syscall name="getsid" number="4151"/>
<syscall name="fdatasync" number="4152"/>
<syscall name="_sysctl" number="4153"/>
<syscall name="mlock" number="4154"/>
<syscall name="munlock" number="4155"/>
<syscall name="mlockall" number="4156"/>
<syscall name="munlockall" number="4157"/>
<syscall name="sched_setparam" number="4158"/>
<syscall name="sched_getparam" number="4159"/>
<syscall name="sched_setscheduler" number="4160"/>
<syscall name="sched_getscheduler" number="4161"/>
<syscall name="sched_yield" number="4162"/>
<syscall name="sched_get_priority_max" number="4163"/>
<syscall name="sched_get_priority_min" number="4164"/>
<syscall name="sched_rr_get_interval" number="4165"/>
<syscall name="nanosleep" number="4166"/>
<syscall name="mremap" number="4167"/>
<syscall name="accept" number="4168"/>
<syscall name="bind" number="4169"/>
<syscall name="connect" number="4170"/>
<syscall name="getpeername" number="4171"/>
<syscall name="getsockname" number="4172"/>
<syscall name="getsockopt" number="4173"/>
<syscall name="listen" number="4174"/>
<syscall name="recv" number="4175"/>
<syscall name="recvfrom" number="4176"/>
<syscall name="recvmsg" number="4177"/>
<syscall name="send" number="4178"/>
<syscall name="sendmsg" number="4179"/>
<syscall name="sendto" number="4180"/>
<syscall name="setsockopt" number="4181"/>
<syscall name="shutdown" number="4182"/>
<syscall name="socket" number="4183"/>
<syscall name="socketpair" number="4184"/>
<syscall name="setresuid" number="4185"/>
<syscall name="getresuid" number="4186"/>
<syscall name="query_module" number="4187"/>
<syscall name="poll" number="4188"/>
<syscall name="nfsservctl" number="4189"/>
<syscall name="setresgid" number="4190"/>
<syscall name="getresgid" number="4191"/>
<syscall name="prctl" number="4192"/>
<syscall name="rt_sigreturn" number="4193"/>
<syscall name="rt_sigaction" number="4194"/>
<syscall name="rt_sigprocmask" number="4195"/>
<syscall name="rt_sigpending" number="4196"/>
<syscall name="rt_sigtimedwait" number="4197"/>
<syscall name="rt_sigqueueinfo" number="4198"/>
<syscall name="rt_sigsuspend" number="4199"/>
<syscall name="pread64" number="4200"/>
<syscall name="pwrite64" number="4201"/>
<syscall name="chown" number="4202"/>
<syscall name="getcwd" number="4203"/>
<syscall name="capget" number="4204"/>
<syscall name="capset" number="4205"/>
<syscall name="sigaltstack" number="4206"/>
<syscall name="sendfile" number="4207"/>
<syscall name="getpmsg" number="4208"/>
<syscall name="putpmsg" number="4209"/>
<syscall name="mmap2" number="4210"/>
<syscall name="truncate64" number="4211"/>
<syscall name="ftruncate64" number="4212"/>
<syscall name="stat64" number="4213"/>
<syscall name="lstat64" number="4214"/>
<syscall name="fstat64" number="4215"/>
<syscall name="pivot_root" number="4216"/>
<syscall name="mincore" number="4217"/>
<syscall name="madvise" number="4218"/>
<syscall name="getdents64" number="4219"/>
<syscall name="fcntl64" number="4220"/>
<syscall name="gettid" number="4222"/>
<syscall name="readahead" number="4223"/>
<syscall name="setxattr" number="4224"/>
<syscall name="lsetxattr" number="4225"/>
<syscall name="fsetxattr" number="4226"/>
<syscall name="getxattr" number="4227"/>
<syscall name="lgetxattr" number="4228"/>
<syscall name="fgetxattr" number="4229"/>
<syscall name="listxattr" number="4230"/>
<syscall name="llistxattr" number="4231"/>
<syscall name="flistxattr" number="4232"/>
<syscall name="removexattr" number="4233"/>
<syscall name="lremovexattr" number="4234"/>
<syscall name="fremovexattr" number="4235"/>
<syscall name="tkill" number="4236"/>
<syscall name="sendfile64" number="4237"/>
<syscall name="futex" number="4238"/>
<syscall name="sched_setaffinity" number="4239"/>
<syscall name="sched_getaffinity" number="4240"/>
<syscall name="io_setup" number="4241"/>
<syscall name="io_destroy" number="4242"/>
<syscall name="io_getevents" number="4243"/>
<syscall name="io_submit" number="4244"/>
<syscall name="io_cancel" number="4245"/>
<syscall name="exit_group" number="4246"/>
<syscall name="lookup_dcookie" number="4247"/>
<syscall name="epoll_create" number="4248"/>
<syscall name="epoll_ctl" number="4249"/>
<syscall name="epoll_wait" number="4250"/>
<syscall name="remap_file_pages" number="4251"/>
<syscall name="set_tid_address" number="4252"/>
<syscall name="restart_syscall" number="4253"/>
<syscall name="fadvise64" number="4254"/>
<syscall name="statfs64" number="4255"/>
<syscall name="fstatfs64" number="4256"/>
<syscall name="timer_create" number="4257"/>
<syscall name="timer_settime" number="4258"/>
<syscall name="timer_gettime" number="4259"/>
<syscall name="timer_getoverrun" number="4260"/>
<syscall name="timer_delete" number="4261"/>
<syscall name="clock_settime" number="4262"/>
<syscall name="clock_gettime" number="4263"/>
<syscall name="clock_getres" number="4264"/>
<syscall name="clock_nanosleep" number="4265"/>
<syscall name="tgkill" number="4266"/>
<syscall name="utimes" number="4267"/>
<syscall name="mbind" number="4268"/>
<syscall name="get_mempolicy" number="4269"/>
<syscall name="set_mempolicy" number="4270"/>
<syscall name="mq_open" number="4271"/>
<syscall name="mq_unlink" number="4272"/>
<syscall name="mq_timedsend" number="4273"/>
<syscall name="mq_timedreceive" number="4274"/>
<syscall name="mq_notify" number="4275"/>
<syscall name="mq_getsetattr" number="4276"/>
<syscall name="vserver" number="4277"/>
<syscall name="waitid" number="4278"/>
<syscall name="add_key" number="4280"/>
<syscall name="request_key" number="4281"/>
<syscall name="keyctl" number="4282"/>
<syscall name="set_thread_area" number="4283"/>
<syscall name="inotify_init" number="4284"/>
<syscall name="inotify_add_watch" number="4285"/>
<syscall name="inotify_rm_watch" number="4286"/>
<syscall name="migrate_pages" number="4287"/>
<syscall name="openat" number="4288"/>
<syscall name="mkdirat" number="4289"/>
<syscall name="mknodat" number="4290"/>
<syscall name="fchownat" number="4291"/>
<syscall name="futimesat" number="4292"/>
<syscall name="fstatat64" number="4293"/>
<syscall name="unlinkat" number="4294"/>
<syscall name="renameat" number="4295"/>
<syscall name="linkat" number="4296"/>
<syscall name="symlinkat" number="4297"/>
<syscall name="readlinkat" number="4298"/>
<syscall name="fchmodat" number="4299"/>
<syscall name="faccessat" number="4300"/>
<syscall name="pselect6" number="4301"/>
<syscall name="ppoll" number="4302"/>
<syscall name="unshare" number="4303"/>
<syscall name="splice" number="4304"/>
<syscall name="sync_file_range" number="4305"/>
<syscall name="tee" number="4306"/>
<syscall name="vmsplice" number="4307"/>
<syscall name="move_pages" number="4308"/>
<syscall name="set_robust_list" number="4309"/>
<syscall name="get_robust_list" number="4310"/>
<syscall name="kexec_load" number="4311"/>
<syscall name="getcpu" number="4312"/>
<syscall name="epoll_pwait" number="4313"/>
<syscall name="ioprio_set" number="4314"/>
<syscall name="ioprio_get" number="4315"/>
<syscall name="utimensat" number="4316"/>
<syscall name="signalfd" number="4317"/>
<syscall name="timerfd" number="4318"/>
<syscall name="eventfd" number="4319"/>
<syscall name="fallocate" number="4320"/>
<syscall name="timerfd_create" number="4321"/>
<syscall name="timerfd_gettime" number="4322"/>
<syscall name="timerfd_settime" number="4323"/>
<syscall name="signalfd4" number="4324"/>
<syscall name="eventfd2" number="4325"/>
<syscall name="epoll_create1" number="4326"/>
<syscall name="dup3" number="4327"/>
<syscall name="pipe2" number="4328"/>
<syscall name="inotify_init1" number="4329"/>
<syscall name="preadv" number="4330"/>
<syscall name="pwritev" number="4331"/>
<syscall name="rt_tgsigqueueinfo" number="4332"/>
<syscall name="perf_event_open" number="4333"/>
<syscall name="accept4" number="4334"/>
<syscall name="recvmmsg" number="4335"/>
<syscall name="fanotify_init" number="4336"/>
<syscall name="fanotify_mark" number="4337"/>
<syscall name="prlimit64" number="4338"/>
</syscalls_info>

View File

@ -0,0 +1,310 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2009-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/powerpc/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<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"/>
<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"/>
<syscall name="oldstat" number="18"/>
<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"/>
<syscall name="pause" number="29"/>
<syscall name="utime" number="30"/>
<syscall name="stty" number="31"/>
<syscall name="gtty" number="32"/>
<syscall name="access" number="33"/>
<syscall name="nice" number="34"/>
<syscall name="ftime" number="35"/>
<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"/>
<syscall name="brk" number="45"/>
<syscall name="setgid" number="46"/>
<syscall name="getgid" number="47"/>
<syscall name="signal" number="48"/>
<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"/>
<syscall name="ioctl" number="54"/>
<syscall name="fcntl" number="55"/>
<syscall name="mpx" number="56"/>
<syscall name="setpgid" number="57"/>
<syscall name="ulimit" number="58"/>
<syscall name="oldolduname" number="59"/>
<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"/>
<syscall name="ssetmask" number="69"/>
<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"/>
<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"/>
<syscall name="statfs" number="99"/>
<syscall name="fstatfs" number="100"/>
<syscall name="ioperm" number="101"/>
<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"/>
<syscall name="iopl" number="110"/>
<syscall name="vhangup" number="111"/>
<syscall name="idle" number="112"/>
<syscall name="vm86" 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"/>
<syscall name="adjtimex" number="124"/>
<syscall name="mprotect" number="125"/>
<syscall name="sigprocmask" number="126"/>
<syscall name="create_module" number="127"/>
<syscall name="init_module" number="128"/>
<syscall name="delete_module" number="129"/>
<syscall name="get_kernel_syms" number="130"/>
<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"/>
<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="query_module" number="166"/>
<syscall name="poll" number="167"/>
<syscall name="nfsservctl" number="168"/>
<syscall name="setresgid" number="169"/>
<syscall name="getresgid" number="170"/>
<syscall name="prctl" number="171"/>
<syscall name="rt_sigreturn" number="172"/>
<syscall name="rt_sigaction" number="173"/>
<syscall name="rt_sigprocmask" number="174"/>
<syscall name="rt_sigpending" number="175"/>
<syscall name="rt_sigtimedwait" number="176"/>
<syscall name="rt_sigqueueinfo" number="177"/>
<syscall name="rt_sigsuspend" number="178"/>
<syscall name="pread64" number="179"/>
<syscall name="pwrite64" number="180"/>
<syscall name="chown" number="181"/>
<syscall name="getcwd" number="182"/>
<syscall name="capget" number="183"/>
<syscall name="capset" number="184"/>
<syscall name="sigaltstack" number="185"/>
<syscall name="sendfile" number="186"/>
<syscall name="getpmsg" number="187"/>
<syscall name="putpmsg" number="188"/>
<syscall name="vfork" number="189"/>
<syscall name="ugetrlimit" number="190"/>
<syscall name="readahead" 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="pciconfig_read" number="198"/>
<syscall name="pciconfig_write" number="199"/>
<syscall name="pciconfig_iobase" number="200"/>
<syscall name="multiplexer" number="201"/>
<syscall name="getdents64" number="202"/>
<syscall name="pivot_root" number="203"/>
<syscall name="fcntl64" number="204"/>
<syscall name="madvise" number="205"/>
<syscall name="mincore" number="206"/>
<syscall name="gettid" number="207"/>
<syscall name="tkill" number="208"/>
<syscall name="setxattr" number="209"/>
<syscall name="lsetxattr" number="210"/>
<syscall name="fsetxattr" number="211"/>
<syscall name="getxattr" number="212"/>
<syscall name="lgetxattr" number="213"/>
<syscall name="fgetxattr" number="214"/>
<syscall name="listxattr" number="215"/>
<syscall name="llistxattr" number="216"/>
<syscall name="flistxattr" number="217"/>
<syscall name="removexattr" number="218"/>
<syscall name="lremovexattr" number="219"/>
<syscall name="fremovexattr" number="220"/>
<syscall name="futex" number="221"/>
<syscall name="sched_setaffinity" number="222"/>
<syscall name="sched_getaffinity" number="223"/>
<syscall name="tuxcall" number="225"/>
<syscall name="sendfile64" number="226"/>
<syscall name="io_setup" number="227"/>
<syscall name="io_destroy" number="228"/>
<syscall name="io_getevents" number="229"/>
<syscall name="io_submit" number="230"/>
<syscall name="io_cancel" number="231"/>
<syscall name="set_tid_address" number="232"/>
<syscall name="fadvise64" number="233"/>
<syscall name="exit_group" number="234"/>
<syscall name="lookup_dcookie" number="235"/>
<syscall name="epoll_create" number="236"/>
<syscall name="epoll_ctl" number="237"/>
<syscall name="epoll_wait" number="238"/>
<syscall name="remap_file_pages" number="239"/>
<syscall name="timer_create" number="240"/>
<syscall name="timer_settime" number="241"/>
<syscall name="timer_gettime" number="242"/>
<syscall name="timer_getoverrun" number="243"/>
<syscall name="timer_delete" number="244"/>
<syscall name="clock_settime" number="245"/>
<syscall name="clock_gettime" number="246"/>
<syscall name="clock_getres" number="247"/>
<syscall name="clock_nanosleep" number="248"/>
<syscall name="swapcontext" number="249"/>
<syscall name="tgkill" number="250"/>
<syscall name="utimes" number="251"/>
<syscall name="statfs64" number="252"/>
<syscall name="fstatfs64" number="253"/>
<syscall name="fadvise64_64" number="254"/>
<syscall name="rtas" number="255"/>
<syscall name="sys_debug_setcontext" number="256"/>
<syscall name="mbind" number="259"/>
<syscall name="get_mempolicy" number="260"/>
<syscall name="set_mempolicy" number="261"/>
<syscall name="mq_open" number="262"/>
<syscall name="mq_unlink" number="263"/>
<syscall name="mq_timedsend" number="264"/>
<syscall name="mq_timedreceive" number="265"/>
<syscall name="mq_notify" number="266"/>
<syscall name="mq_getsetattr" number="267"/>
<syscall name="kexec_load" number="268"/>
<syscall name="add_key" number="269"/>
<syscall name="request_key" number="270"/>
<syscall name="keyctl" number="271"/>
<syscall name="waitid" number="272"/>
<syscall name="ioprio_set" number="273"/>
<syscall name="ioprio_get" number="274"/>
<syscall name="inotify_init" number="275"/>
<syscall name="inotify_add_watch" number="276"/>
<syscall name="inotify_rm_watch" number="277"/>
<syscall name="spu_run" number="278"/>
<syscall name="spu_create" number="279"/>
<syscall name="pselect6" number="280"/>
<syscall name="ppoll" number="281"/>
<syscall name="unshare" number="282"/>
<syscall name="openat" number="286"/>
<syscall name="mkdirat" number="287"/>
<syscall name="mknodat" number="288"/>
<syscall name="fchownat" number="289"/>
<syscall name="futimesat" number="290"/>
<syscall name="fstatat64" number="291"/>
<syscall name="unlinkat" number="292"/>
<syscall name="renameat" number="293"/>
<syscall name="linkat" number="294"/>
<syscall name="symlinkat" number="295"/>
<syscall name="readlinkat" number="296"/>
<syscall name="fchmodat" number="297"/>
<syscall name="faccessat" number="298"/>
</syscalls_info>

View File

@ -0,0 +1,295 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2009-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/powerpc/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<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"/>
<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"/>
<syscall name="oldstat" number="18"/>
<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"/>
<syscall name="pause" number="29"/>
<syscall name="utime" number="30"/>
<syscall name="stty" number="31"/>
<syscall name="gtty" number="32"/>
<syscall name="access" number="33"/>
<syscall name="nice" number="34"/>
<syscall name="ftime" number="35"/>
<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"/>
<syscall name="brk" number="45"/>
<syscall name="setgid" number="46"/>
<syscall name="getgid" number="47"/>
<syscall name="signal" number="48"/>
<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"/>
<syscall name="ioctl" number="54"/>
<syscall name="fcntl" number="55"/>
<syscall name="mpx" number="56"/>
<syscall name="setpgid" number="57"/>
<syscall name="ulimit" number="58"/>
<syscall name="oldolduname" number="59"/>
<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"/>
<syscall name="ssetmask" number="69"/>
<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"/>
<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"/>
<syscall name="statfs" number="99"/>
<syscall name="fstatfs" number="100"/>
<syscall name="ioperm" number="101"/>
<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"/>
<syscall name="iopl" number="110"/>
<syscall name="vhangup" number="111"/>
<syscall name="idle" number="112"/>
<syscall name="vm86" 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"/>
<syscall name="adjtimex" number="124"/>
<syscall name="mprotect" number="125"/>
<syscall name="sigprocmask" number="126"/>
<syscall name="create_module" number="127"/>
<syscall name="init_module" number="128"/>
<syscall name="delete_module" number="129"/>
<syscall name="get_kernel_syms" number="130"/>
<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"/>
<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="query_module" number="166"/>
<syscall name="poll" number="167"/>
<syscall name="nfsservctl" number="168"/>
<syscall name="setresgid" number="169"/>
<syscall name="getresgid" number="170"/>
<syscall name="prctl" number="171"/>
<syscall name="rt_sigreturn" number="172"/>
<syscall name="rt_sigaction" number="173"/>
<syscall name="rt_sigprocmask" number="174"/>
<syscall name="rt_sigpending" number="175"/>
<syscall name="rt_sigtimedwait" number="176"/>
<syscall name="rt_sigqueueinfo" number="177"/>
<syscall name="rt_sigsuspend" number="178"/>
<syscall name="pread64" number="179"/>
<syscall name="pwrite64" number="180"/>
<syscall name="chown" number="181"/>
<syscall name="getcwd" number="182"/>
<syscall name="capget" number="183"/>
<syscall name="capset" number="184"/>
<syscall name="sigaltstack" number="185"/>
<syscall name="sendfile" number="186"/>
<syscall name="getpmsg" number="187"/>
<syscall name="putpmsg" number="188"/>
<syscall name="vfork" number="189"/>
<syscall name="ugetrlimit" number="190"/>
<syscall name="readahead" number="191"/>
<syscall name="pciconfig_read" number="198"/>
<syscall name="pciconfig_write" number="199"/>
<syscall name="pciconfig_iobase" number="200"/>
<syscall name="multiplexer" number="201"/>
<syscall name="getdents64" number="202"/>
<syscall name="pivot_root" number="203"/>
<syscall name="madvise" number="205"/>
<syscall name="mincore" number="206"/>
<syscall name="gettid" number="207"/>
<syscall name="tkill" number="208"/>
<syscall name="setxattr" number="209"/>
<syscall name="lsetxattr" number="210"/>
<syscall name="fsetxattr" number="211"/>
<syscall name="getxattr" number="212"/>
<syscall name="lgetxattr" number="213"/>
<syscall name="fgetxattr" number="214"/>
<syscall name="listxattr" number="215"/>
<syscall name="llistxattr" number="216"/>
<syscall name="flistxattr" number="217"/>
<syscall name="removexattr" number="218"/>
<syscall name="lremovexattr" number="219"/>
<syscall name="fremovexattr" number="220"/>
<syscall name="futex" number="221"/>
<syscall name="sched_setaffinity" number="222"/>
<syscall name="sched_getaffinity" number="223"/>
<syscall name="tuxcall" number="225"/>
<syscall name="io_setup" number="227"/>
<syscall name="io_destroy" number="228"/>
<syscall name="io_getevents" number="229"/>
<syscall name="io_submit" number="230"/>
<syscall name="io_cancel" number="231"/>
<syscall name="set_tid_address" number="232"/>
<syscall name="fadvise64" number="233"/>
<syscall name="exit_group" number="234"/>
<syscall name="lookup_dcookie" number="235"/>
<syscall name="epoll_create" number="236"/>
<syscall name="epoll_ctl" number="237"/>
<syscall name="epoll_wait" number="238"/>
<syscall name="remap_file_pages" number="239"/>
<syscall name="timer_create" number="240"/>
<syscall name="timer_settime" number="241"/>
<syscall name="timer_gettime" number="242"/>
<syscall name="timer_getoverrun" number="243"/>
<syscall name="timer_delete" number="244"/>
<syscall name="clock_settime" number="245"/>
<syscall name="clock_gettime" number="246"/>
<syscall name="clock_getres" number="247"/>
<syscall name="clock_nanosleep" number="248"/>
<syscall name="swapcontext" number="249"/>
<syscall name="tgkill" number="250"/>
<syscall name="utimes" number="251"/>
<syscall name="statfs64" number="252"/>
<syscall name="fstatfs64" number="253"/>
<syscall name="rtas" number="255"/>
<syscall name="sys_debug_setcontext" number="256"/>
<syscall name="mbind" number="259"/>
<syscall name="get_mempolicy" number="260"/>
<syscall name="set_mempolicy" number="261"/>
<syscall name="mq_open" number="262"/>
<syscall name="mq_unlink" number="263"/>
<syscall name="mq_timedsend" number="264"/>
<syscall name="mq_timedreceive" number="265"/>
<syscall name="mq_notify" number="266"/>
<syscall name="mq_getsetattr" number="267"/>
<syscall name="kexec_load" number="268"/>
<syscall name="add_key" number="269"/>
<syscall name="request_key" number="270"/>
<syscall name="keyctl" number="271"/>
<syscall name="waitid" number="272"/>
<syscall name="ioprio_set" number="273"/>
<syscall name="ioprio_get" number="274"/>
<syscall name="inotify_init" number="275"/>
<syscall name="inotify_add_watch" number="276"/>
<syscall name="inotify_rm_watch" number="277"/>
<syscall name="spu_run" number="278"/>
<syscall name="spu_create" number="279"/>
<syscall name="pselect6" number="280"/>
<syscall name="ppoll" number="281"/>
<syscall name="unshare" number="282"/>
<syscall name="unlinkat" number="286"/>
<syscall name="renameat" number="287"/>
<syscall name="linkat" number="288"/>
<syscall name="symlinkat" number="289"/>
<syscall name="readlinkat" number="290"/>
<syscall name="fchmodat" number="291"/>
<syscall name="faccessat" number="292"/>
</syscalls_info>

View File

@ -0,0 +1,344 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2010-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/sparc/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<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="wait4" number="7"/>
<syscall name="creat" number="8"/>
<syscall name="link" number="9"/>
<syscall name="unlink" number="10"/>
<syscall name="execv" number="11"/>
<syscall name="chdir" number="12"/>
<syscall name="chown" number="13"/>
<syscall name="mknod" number="14"/>
<syscall name="chmod" number="15"/>
<syscall name="lchown" number="16"/>
<syscall name="brk" number="17"/>
<syscall name="perfctr" number="18"/>
<syscall name="lseek" number="19"/>
<syscall name="getpid" number="20"/>
<syscall name="capget" number="21"/>
<syscall name="capset" number="22"/>
<syscall name="setuid" number="23"/>
<syscall name="getuid" number="24"/>
<syscall name="vmsplice" number="25"/>
<syscall name="ptrace" number="26"/>
<syscall name="alarm" number="27"/>
<syscall name="sigaltstack" number="28"/>
<syscall name="pause" number="29"/>
<syscall name="utime" number="30"/>
<syscall name="lchown32" number="31"/>
<syscall name="fchown32" number="32"/>
<syscall name="access" number="33"/>
<syscall name="nice" number="34"/>
<syscall name="chown32" number="35"/>
<syscall name="sync" number="36"/>
<syscall name="kill" number="37"/>
<syscall name="stat" number="38"/>
<syscall name="sendfile" number="39"/>
<syscall name="lstat" number="40"/>
<syscall name="dup" number="41"/>
<syscall name="pipe" number="42"/>
<syscall name="times" number="43"/>
<syscall name="getuid32" number="44"/>
<syscall name="umount2" number="45"/>
<syscall name="setgid" number="46"/>
<syscall name="getgid" number="47"/>
<syscall name="signal" number="48"/>
<syscall name="geteuid" number="49"/>
<syscall name="getegid" number="50"/>
<syscall name="acct" number="51"/>
<syscall name="getgid32" number="53"/>
<syscall name="ioctl" number="54"/>
<syscall name="reboot" number="55"/>
<syscall name="mmap2" number="56"/>
<syscall name="symlink" number="57"/>
<syscall name="readlink" number="58"/>
<syscall name="execve" number="59"/>
<syscall name="umask" number="60"/>
<syscall name="chroot" number="61"/>
<syscall name="fstat" number="62"/>
<syscall name="fstat64" number="63"/>
<syscall name="getpagesize" number="64"/>
<syscall name="msync" number="65"/>
<syscall name="vfork" number="66"/>
<syscall name="pread64" number="67"/>
<syscall name="pwrite64" number="68"/>
<syscall name="geteuid32" number="69"/>
<syscall name="getegid32" number="70"/>
<syscall name="mmap" number="71"/>
<syscall name="setreuid32" number="72"/>
<syscall name="munmap" number="73"/>
<syscall name="mprotect" number="74"/>
<syscall name="madvise" number="75"/>
<syscall name="vhangup" number="76"/>
<syscall name="truncate64" number="77"/>
<syscall name="mincore" number="78"/>
<syscall name="getgroups" number="79"/>
<syscall name="setgroups" number="80"/>
<syscall name="getpgrp" number="81"/>
<syscall name="setgroups32" number="82"/>
<syscall name="setitimer" number="83"/>
<syscall name="ftruncate64" number="84"/>
<syscall name="swapon" number="85"/>
<syscall name="getitimer" number="86"/>
<syscall name="setuid32" number="87"/>
<syscall name="sethostname" number="88"/>
<syscall name="setgid32" number="89"/>
<syscall name="dup2" number="90"/>
<syscall name="setfsuid32" number="91"/>
<syscall name="fcntl" number="92"/>
<syscall name="select" number="93"/>
<syscall name="setfsgid32" number="94"/>
<syscall name="fsync" number="95"/>
<syscall name="setpriority" number="96"/>
<syscall name="socket" number="97"/>
<syscall name="connect" number="98"/>
<syscall name="accept" number="99"/>
<syscall name="getpriority" number="100"/>
<syscall name="rt_sigreturn" number="101"/>
<syscall name="rt_sigaction" number="102"/>
<syscall name="rt_sigprocmask" number="103"/>
<syscall name="rt_sigpending" number="104"/>
<syscall name="rt_sigtimedwait" number="105"/>
<syscall name="rt_sigqueueinfo" number="106"/>
<syscall name="rt_sigsuspend" number="107"/>
<syscall name="setresuid32" number="108"/>
<syscall name="getresuid32" number="109"/>
<syscall name="setresgid32" number="110"/>
<syscall name="getresgid32" number="111"/>
<syscall name="setregid32" number="112"/>
<syscall name="recvmsg" number="113"/>
<syscall name="sendmsg" number="114"/>
<syscall name="getgroups32" number="115"/>
<syscall name="gettimeofday" number="116"/>
<syscall name="getrusage" number="117"/>
<syscall name="getsockopt" number="118"/>
<syscall name="getcwd" number="119"/>
<syscall name="readv" number="120"/>
<syscall name="writev" number="121"/>
<syscall name="settimeofday" number="122"/>
<syscall name="fchown" number="123"/>
<syscall name="fchmod" number="124"/>
<syscall name="recvfrom" number="125"/>
<syscall name="setreuid" number="126"/>
<syscall name="setregid" number="127"/>
<syscall name="rename" number="128"/>
<syscall name="truncate" number="129"/>
<syscall name="ftruncate" number="130"/>
<syscall name="flock" number="131"/>
<syscall name="lstat64" number="132"/>
<syscall name="sendto" number="133"/>
<syscall name="shutdown" number="134"/>
<syscall name="socketpair" number="135"/>
<syscall name="mkdir" number="136"/>
<syscall name="rmdir" number="137"/>
<syscall name="utimes" number="138"/>
<syscall name="stat64" number="139"/>
<syscall name="sendfile64" number="140"/>
<syscall name="getpeername" number="141"/>
<syscall name="futex" number="142"/>
<syscall name="gettid" number="143"/>
<syscall name="getrlimit" number="144"/>
<syscall name="setrlimit" number="145"/>
<syscall name="pivot_root" number="146"/>
<syscall name="prctl" number="147"/>
<syscall name="pciconfig_read" number="148"/>
<syscall name="pciconfig_write" number="149"/>
<syscall name="getsockname" number="150"/>
<syscall name="inotify_init" number="151"/>
<syscall name="inotify_add_watch" number="152"/>
<syscall name="poll" number="153"/>
<syscall name="getdents64" number="154"/>
<syscall name="fcntl64" number="155"/>
<syscall name="inotify_rm_watch" number="156"/>
<syscall name="statfs" number="157"/>
<syscall name="fstatfs" number="158"/>
<syscall name="umount" number="159"/>
<syscall name="sched_set_affinity" number="160"/>
<syscall name="sched_get_affinity" number="161"/>
<syscall name="getdomainname" number="162"/>
<syscall name="setdomainname" number="163"/>
<syscall name="quotactl" number="165"/>
<syscall name="set_tid_address" number="166"/>
<syscall name="mount" number="167"/>
<syscall name="ustat" number="168"/>
<syscall name="setxattr" number="169"/>
<syscall name="lsetxattr" number="170"/>
<syscall name="fsetxattr" number="171"/>
<syscall name="getxattr" number="172"/>
<syscall name="lgetxattr" number="173"/>
<syscall name="getdents" number="174"/>
<syscall name="setsid" number="175"/>
<syscall name="fchdir" number="176"/>
<syscall name="fgetxattr" number="177"/>
<syscall name="listxattr" number="178"/>
<syscall name="llistxattr" number="179"/>
<syscall name="flistxattr" number="180"/>
<syscall name="removexattr" number="181"/>
<syscall name="lremovexattr" number="182"/>
<syscall name="sigpending" number="183"/>
<syscall name="query_module" number="184"/>
<syscall name="setpgid" number="185"/>
<syscall name="fremovexattr" number="186"/>
<syscall name="tkill" number="187"/>
<syscall name="exit_group" number="188"/>
<syscall name="uname" number="189"/>
<syscall name="init_module" number="190"/>
<syscall name="personality" number="191"/>
<syscall name="remap_file_pages" number="192"/>
<syscall name="epoll_create" number="193"/>
<syscall name="epoll_ctl" number="194"/>
<syscall name="epoll_wait" number="195"/>
<syscall name="ioprio_set" number="196"/>
<syscall name="getppid" number="197"/>
<syscall name="sigaction" number="198"/>
<syscall name="sgetmask" number="199"/>
<syscall name="ssetmask" number="200"/>
<syscall name="sigsuspend" number="201"/>
<syscall name="oldlstat" number="202"/>
<syscall name="uselib" number="203"/>
<syscall name="readdir" number="204"/>
<syscall name="readahead" number="205"/>
<syscall name="socketcall" number="206"/>
<syscall name="syslog" number="207"/>
<syscall name="lookup_dcookie" number="208"/>
<syscall name="fadvise64" number="209"/>
<syscall name="fadvise64_64" number="210"/>
<syscall name="tgkill" number="211"/>
<syscall name="waitpid" number="212"/>
<syscall name="swapoff" number="213"/>
<syscall name="sysinfo" number="214"/>
<syscall name="ipc" number="215"/>
<syscall name="sigreturn" number="216"/>
<syscall name="clone" number="217"/>
<syscall name="ioprio_get" number="218"/>
<syscall name="adjtimex" number="219"/>
<syscall name="sigprocmask" number="220"/>
<syscall name="create_module" number="221"/>
<syscall name="delete_module" number="222"/>
<syscall name="get_kernel_syms" number="223"/>
<syscall name="getpgid" number="224"/>
<syscall name="bdflush" number="225"/>
<syscall name="sysfs" number="226"/>
<syscall name="afs_syscall" number="227"/>
<syscall name="setfsuid" number="228"/>
<syscall name="setfsgid" number="229"/>
<syscall name="_newselect" number="230"/>
<syscall name="time" number="231"/>
<syscall name="splice" number="232"/>
<syscall name="stime" number="233"/>
<syscall name="statfs64" number="234"/>
<syscall name="fstatfs64" number="235"/>
<syscall name="_llseek" number="236"/>
<syscall name="mlock" number="237"/>
<syscall name="munlock" number="238"/>
<syscall name="mlockall" number="239"/>
<syscall name="munlockall" number="240"/>
<syscall name="sched_setparam" number="241"/>
<syscall name="sched_getparam" number="242"/>
<syscall name="sched_setscheduler" number="243"/>
<syscall name="sched_getscheduler" number="244"/>
<syscall name="sched_yield" number="245"/>
<syscall name="sched_get_priority_max" number="246"/>
<syscall name="sched_get_priority_min" number="247"/>
<syscall name="sched_rr_get_interval" number="248"/>
<syscall name="nanosleep" number="249"/>
<syscall name="mremap" number="250"/>
<syscall name="_sysctl" number="251"/>
<syscall name="getsid" number="252"/>
<syscall name="fdatasync" number="253"/>
<syscall name="nfsservctl" number="254"/>
<syscall name="sync_file_range" number="255"/>
<syscall name="clock_settime" number="256"/>
<syscall name="clock_gettime" number="257"/>
<syscall name="clock_getres" number="258"/>
<syscall name="clock_nanosleep" number="259"/>
<syscall name="sched_getaffinity" number="260"/>
<syscall name="sched_setaffinity" number="261"/>
<syscall name="timer_settime" number="262"/>
<syscall name="timer_gettime" number="263"/>
<syscall name="timer_getoverrun" number="264"/>
<syscall name="timer_delete" number="265"/>
<syscall name="timer_create" number="266"/>
<syscall name="vserver" number="267"/>
<syscall name="io_setup" number="268"/>
<syscall name="io_destroy" number="269"/>
<syscall name="io_submit" number="270"/>
<syscall name="io_cancel" number="271"/>
<syscall name="io_getevents" number="272"/>
<syscall name="mq_open" number="273"/>
<syscall name="mq_unlink" number="274"/>
<syscall name="mq_timedsend" number="275"/>
<syscall name="mq_timedreceive" number="276"/>
<syscall name="mq_notify" number="277"/>
<syscall name="mq_getsetattr" number="278"/>
<syscall name="waitid" number="279"/>
<syscall name="tee" number="280"/>
<syscall name="add_key" number="281"/>
<syscall name="request_key" number="282"/>
<syscall name="keyctl" number="283"/>
<syscall name="openat" number="284"/>
<syscall name="mkdirat" number="285"/>
<syscall name="mknodat" number="286"/>
<syscall name="fchownat" number="287"/>
<syscall name="futimesat" number="288"/>
<syscall name="fstatat64" number="289"/>
<syscall name="unlinkat" number="290"/>
<syscall name="renameat" number="291"/>
<syscall name="linkat" number="292"/>
<syscall name="symlinkat" number="293"/>
<syscall name="readlinkat" number="294"/>
<syscall name="fchmodat" number="295"/>
<syscall name="faccessat" number="296"/>
<syscall name="pselect6" number="297"/>
<syscall name="ppoll" number="298"/>
<syscall name="unshare" number="299"/>
<syscall name="set_robust_list" number="300"/>
<syscall name="get_robust_list" number="301"/>
<syscall name="migrate_pages" number="302"/>
<syscall name="mbind" number="303"/>
<syscall name="get_mempolicy" number="304"/>
<syscall name="set_mempolicy" number="305"/>
<syscall name="kexec_load" number="306"/>
<syscall name="move_pages" number="307"/>
<syscall name="getcpu" number="308"/>
<syscall name="epoll_pwait" number="309"/>
<syscall name="utimensat" number="310"/>
<syscall name="signalfd" number="311"/>
<syscall name="timerfd_create" number="312"/>
<syscall name="eventfd" number="313"/>
<syscall name="fallocate" number="314"/>
<syscall name="timerfd_settime" number="315"/>
<syscall name="timerfd_gettime" number="316"/>
<syscall name="signalfd4" number="317"/>
<syscall name="eventfd2" number="318"/>
<syscall name="epoll_create1" number="319"/>
<syscall name="dup3" number="320"/>
<syscall name="pipe2" number="321"/>
<syscall name="inotify_init1" number="322"/>
<syscall name="accept4" number="323"/>
<syscall name="preadv" number="324"/>
<syscall name="pwritev" number="325"/>
<syscall name="rt_tgsigqueueinfo" number="326"/>
<syscall name="perf_event_open" number="327"/>
<syscall name="recvmmsg" number="328"/>
</syscalls_info>

View File

@ -0,0 +1,326 @@
<?xml version="1.0"?>
<!-- Copyright (C) 2010-2013 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. -->
<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
<!-- This file was generated using the following file:
/usr/src/linux/arch/sparc/include/asm/unistd.h
The file mentioned above belongs to the Linux Kernel. -->
<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="wait4" number="7"/>
<syscall name="creat" number="8"/>
<syscall name="link" number="9"/>
<syscall name="unlink" number="10"/>
<syscall name="execv" number="11"/>
<syscall name="chdir" number="12"/>
<syscall name="chown" number="13"/>
<syscall name="mknod" number="14"/>
<syscall name="chmod" number="15"/>
<syscall name="lchown" number="16"/>
<syscall name="brk" number="17"/>
<syscall name="perfctr" number="18"/>
<syscall name="lseek" number="19"/>
<syscall name="getpid" number="20"/>
<syscall name="capget" number="21"/>
<syscall name="capset" number="22"/>
<syscall name="setuid" number="23"/>
<syscall name="getuid" number="24"/>
<syscall name="vmsplice" number="25"/>
<syscall name="ptrace" number="26"/>
<syscall name="alarm" number="27"/>
<syscall name="sigaltstack" number="28"/>
<syscall name="pause" number="29"/>
<syscall name="utime" number="30"/>
<syscall name="access" number="33"/>
<syscall name="nice" number="34"/>
<syscall name="sync" number="36"/>
<syscall name="kill" number="37"/>
<syscall name="stat" number="38"/>
<syscall name="sendfile" number="39"/>
<syscall name="lstat" number="40"/>
<syscall name="dup" number="41"/>
<syscall name="pipe" number="42"/>
<syscall name="times" number="43"/>
<syscall name="umount2" number="45"/>
<syscall name="setgid" number="46"/>
<syscall name="getgid" number="47"/>
<syscall name="signal" number="48"/>
<syscall name="geteuid" number="49"/>
<syscall name="getegid" number="50"/>
<syscall name="acct" number="51"/>
<syscall name="memory_ordering" number="52"/>
<syscall name="ioctl" number="54"/>
<syscall name="reboot" number="55"/>
<syscall name="symlink" number="57"/>
<syscall name="readlink" number="58"/>
<syscall name="execve" number="59"/>
<syscall name="umask" number="60"/>
<syscall name="chroot" number="61"/>
<syscall name="fstat" number="62"/>
<syscall name="fstat64" number="63"/>
<syscall name="getpagesize" number="64"/>
<syscall name="msync" number="65"/>
<syscall name="vfork" number="66"/>
<syscall name="pread64" number="67"/>
<syscall name="pwrite64" number="68"/>
<syscall name="mmap" number="71"/>
<syscall name="munmap" number="73"/>
<syscall name="mprotect" number="74"/>
<syscall name="madvise" number="75"/>
<syscall name="vhangup" number="76"/>
<syscall name="mincore" number="78"/>
<syscall name="getgroups" number="79"/>
<syscall name="setgroups" number="80"/>
<syscall name="getpgrp" number="81"/>
<syscall name="setitimer" number="83"/>
<syscall name="swapon" number="85"/>
<syscall name="getitimer" number="86"/>
<syscall name="sethostname" number="88"/>
<syscall name="dup2" number="90"/>
<syscall name="fcntl" number="92"/>
<syscall name="select" number="93"/>
<syscall name="fsync" number="95"/>
<syscall name="setpriority" number="96"/>
<syscall name="socket" number="97"/>
<syscall name="connect" number="98"/>
<syscall name="accept" number="99"/>
<syscall name="getpriority" number="100"/>
<syscall name="rt_sigreturn" number="101"/>
<syscall name="rt_sigaction" number="102"/>
<syscall name="rt_sigprocmask" number="103"/>
<syscall name="rt_sigpending" number="104"/>
<syscall name="rt_sigtimedwait" number="105"/>
<syscall name="rt_sigqueueinfo" number="106"/>
<syscall name="rt_sigsuspend" number="107"/>
<syscall name="setresuid" number="108"/>
<syscall name="getresuid" number="109"/>
<syscall name="setresgid" number="110"/>
<syscall name="getresgid" number="111"/>
<syscall name="recvmsg" number="113"/>
<syscall name="sendmsg" number="114"/>
<syscall name="gettimeofday" number="116"/>
<syscall name="getrusage" number="117"/>
<syscall name="getsockopt" number="118"/>
<syscall name="getcwd" number="119"/>
<syscall name="readv" number="120"/>
<syscall name="writev" number="121"/>
<syscall name="settimeofday" number="122"/>
<syscall name="fchown" number="123"/>
<syscall name="fchmod" number="124"/>
<syscall name="recvfrom" number="125"/>
<syscall name="setreuid" number="126"/>
<syscall name="setregid" number="127"/>
<syscall name="rename" number="128"/>
<syscall name="truncate" number="129"/>
<syscall name="ftruncate" number="130"/>
<syscall name="flock" number="131"/>
<syscall name="lstat64" number="132"/>
<syscall name="sendto" number="133"/>
<syscall name="shutdown" number="134"/>
<syscall name="socketpair" number="135"/>
<syscall name="mkdir" number="136"/>
<syscall name="rmdir" number="137"/>
<syscall name="utimes" number="138"/>
<syscall name="stat64" number="139"/>
<syscall name="sendfile64" number="140"/>
<syscall name="getpeername" number="141"/>
<syscall name="futex" number="142"/>
<syscall name="gettid" number="143"/>
<syscall name="getrlimit" number="144"/>
<syscall name="setrlimit" number="145"/>
<syscall name="pivot_root" number="146"/>
<syscall name="prctl" number="147"/>
<syscall name="pciconfig_read" number="148"/>
<syscall name="pciconfig_write" number="149"/>
<syscall name="getsockname" number="150"/>
<syscall name="inotify_init" number="151"/>
<syscall name="inotify_add_watch" number="152"/>
<syscall name="poll" number="153"/>
<syscall name="getdents64" number="154"/>
<syscall name="inotify_rm_watch" number="156"/>
<syscall name="statfs" number="157"/>
<syscall name="fstatfs" number="158"/>
<syscall name="umount" number="159"/>
<syscall name="sched_set_affinity" number="160"/>
<syscall name="sched_get_affinity" number="161"/>
<syscall name="getdomainname" number="162"/>
<syscall name="setdomainname" number="163"/>
<syscall name="utrap_install" number="164"/>
<syscall name="quotactl" number="165"/>
<syscall name="set_tid_address" number="166"/>
<syscall name="mount" number="167"/>
<syscall name="ustat" number="168"/>
<syscall name="setxattr" number="169"/>
<syscall name="lsetxattr" number="170"/>
<syscall name="fsetxattr" number="171"/>
<syscall name="getxattr" number="172"/>
<syscall name="lgetxattr" number="173"/>
<syscall name="getdents" number="174"/>
<syscall name="setsid" number="175"/>
<syscall name="fchdir" number="176"/>
<syscall name="fgetxattr" number="177"/>
<syscall name="listxattr" number="178"/>
<syscall name="llistxattr" number="179"/>
<syscall name="flistxattr" number="180"/>
<syscall name="removexattr" number="181"/>
<syscall name="lremovexattr" number="182"/>
<syscall name="sigpending" number="183"/>
<syscall name="query_module" number="184"/>
<syscall name="setpgid" number="185"/>
<syscall name="fremovexattr" number="186"/>
<syscall name="tkill" number="187"/>
<syscall name="exit_group" number="188"/>
<syscall name="uname" number="189"/>
<syscall name="init_module" number="190"/>
<syscall name="personality" number="191"/>
<syscall name="remap_file_pages" number="192"/>
<syscall name="epoll_create" number="193"/>
<syscall name="epoll_ctl" number="194"/>
<syscall name="epoll_wait" number="195"/>
<syscall name="ioprio_set" number="196"/>
<syscall name="getppid" number="197"/>
<syscall name="sigaction" number="198"/>
<syscall name="sgetmask" number="199"/>
<syscall name="ssetmask" number="200"/>
<syscall name="sigsuspend" number="201"/>
<syscall name="oldlstat" number="202"/>
<syscall name="uselib" number="203"/>
<syscall name="readdir" number="204"/>
<syscall name="readahead" number="205"/>
<syscall name="socketcall" number="206"/>
<syscall name="syslog" number="207"/>
<syscall name="lookup_dcookie" number="208"/>
<syscall name="fadvise64" number="209"/>
<syscall name="fadvise64_64" number="210"/>
<syscall name="tgkill" number="211"/>
<syscall name="waitpid" number="212"/>
<syscall name="swapoff" number="213"/>
<syscall name="sysinfo" number="214"/>
<syscall name="ipc" number="215"/>
<syscall name="sigreturn" number="216"/>
<syscall name="clone" number="217"/>
<syscall name="ioprio_get" number="218"/>
<syscall name="adjtimex" number="219"/>
<syscall name="sigprocmask" number="220"/>
<syscall name="create_module" number="221"/>
<syscall name="delete_module" number="222"/>
<syscall name="get_kernel_syms" number="223"/>
<syscall name="getpgid" number="224"/>
<syscall name="bdflush" number="225"/>
<syscall name="sysfs" number="226"/>
<syscall name="afs_syscall" number="227"/>
<syscall name="setfsuid" number="228"/>
<syscall name="setfsgid" number="229"/>
<syscall name="_newselect" number="230"/>
<syscall name="splice" number="232"/>
<syscall name="stime" number="233"/>
<syscall name="statfs64" number="234"/>
<syscall name="fstatfs64" number="235"/>
<syscall name="_llseek" number="236"/>
<syscall name="mlock" number="237"/>
<syscall name="munlock" number="238"/>
<syscall name="mlockall" number="239"/>
<syscall name="munlockall" number="240"/>
<syscall name="sched_setparam" number="241"/>
<syscall name="sched_getparam" number="242"/>
<syscall name="sched_setscheduler" number="243"/>
<syscall name="sched_getscheduler" number="244"/>
<syscall name="sched_yield" number="245"/>
<syscall name="sched_get_priority_max" number="246"/>
<syscall name="sched_get_priority_min" number="247"/>
<syscall name="sched_rr_get_interval" number="248"/>
<syscall name="nanosleep" number="249"/>
<syscall name="mremap" number="250"/>
<syscall name="_sysctl" number="251"/>
<syscall name="getsid" number="252"/>
<syscall name="fdatasync" number="253"/>
<syscall name="nfsservctl" number="254"/>
<syscall name="sync_file_range" number="255"/>
<syscall name="clock_settime" number="256"/>
<syscall name="clock_gettime" number="257"/>
<syscall name="clock_getres" number="258"/>
<syscall name="clock_nanosleep" number="259"/>
<syscall name="sched_getaffinity" number="260"/>
<syscall name="sched_setaffinity" number="261"/>
<syscall name="timer_settime" number="262"/>
<syscall name="timer_gettime" number="263"/>
<syscall name="timer_getoverrun" number="264"/>
<syscall name="timer_delete" number="265"/>
<syscall name="timer_create" number="266"/>
<syscall name="vserver" number="267"/>
<syscall name="io_setup" number="268"/>
<syscall name="io_destroy" number="269"/>
<syscall name="io_submit" number="270"/>
<syscall name="io_cancel" number="271"/>
<syscall name="io_getevents" number="272"/>
<syscall name="mq_open" number="273"/>
<syscall name="mq_unlink" number="274"/>
<syscall name="mq_timedsend" number="275"/>
<syscall name="mq_timedreceive" number="276"/>
<syscall name="mq_notify" number="277"/>
<syscall name="mq_getsetattr" number="278"/>
<syscall name="waitid" number="279"/>
<syscall name="tee" number="280"/>
<syscall name="add_key" number="281"/>
<syscall name="request_key" number="282"/>
<syscall name="keyctl" number="283"/>
<syscall name="openat" number="284"/>
<syscall name="mkdirat" number="285"/>
<syscall name="mknodat" number="286"/>
<syscall name="fchownat" number="287"/>
<syscall name="futimesat" number="288"/>
<syscall name="fstatat64" number="289"/>
<syscall name="unlinkat" number="290"/>
<syscall name="renameat" number="291"/>
<syscall name="linkat" number="292"/>
<syscall name="symlinkat" number="293"/>
<syscall name="readlinkat" number="294"/>
<syscall name="fchmodat" number="295"/>
<syscall name="faccessat" number="296"/>
<syscall name="pselect6" number="297"/>
<syscall name="ppoll" number="298"/>
<syscall name="unshare" number="299"/>
<syscall name="set_robust_list" number="300"/>
<syscall name="get_robust_list" number="301"/>
<syscall name="migrate_pages" number="302"/>
<syscall name="mbind" number="303"/>
<syscall name="get_mempolicy" number="304"/>
<syscall name="set_mempolicy" number="305"/>
<syscall name="kexec_load" number="306"/>
<syscall name="move_pages" number="307"/>
<syscall name="getcpu" number="308"/>
<syscall name="epoll_pwait" number="309"/>
<syscall name="utimensat" number="310"/>
<syscall name="signalfd" number="311"/>
<syscall name="timerfd_create" number="312"/>
<syscall name="eventfd" number="313"/>
<syscall name="fallocate" number="314"/>
<syscall name="timerfd_settime" number="315"/>
<syscall name="timerfd_gettime" number="316"/>
<syscall name="signalfd4" number="317"/>
<syscall name="eventfd2" number="318"/>
<syscall name="epoll_create1" number="319"/>
<syscall name="dup3" number="320"/>
<syscall name="pipe2" number="321"/>
<syscall name="inotify_init1" number="322"/>
<syscall name="accept4" number="323"/>
<syscall name="preadv" number="324"/>
<syscall name="pwritev" number="325"/>
<syscall name="rt_tgsigqueueinfo" number="326"/>
<syscall name="perf_event_open" number="327"/>
<syscall name="recvmmsg" number="328"/>
</syscalls_info>

View File

@ -0,0 +1,79 @@
# Copyright (C) 2011-2013 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, it is then assumed that the ELinOS
environment is not properly set up. Return None in such a case,
and print a warning.
"""
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)
return None
result["xenomai"] = glob.glob(result["project"] + "/xenomai-[0-9.]*")
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 not, abort
with a warning.
"""
elinos_env = get_elinos_environment()
if elinos_env is None:
warn("ELinOS system libraries will not be loaded")
else:
solib_prefix = "%s/%s" % (elinos_env["cdk"], elinos_env["target"])
solib_dirs = []
for dir in elinos_env['xenomai']:
solib_dirs += ["%s/%s" % (dir, "xenomai-build/usr/realtime/lib")]
solib_dirs += ["%s/%s" % (solib_prefix, "lib")]
gdb.execute("set solib-absolute-prefix %s" % solib_prefix)
gdb.execute("set solib-search-path %s" % ":".join(solib_dirs))
if __name__ == "__main__":
elinos_init()

View File

@ -0,0 +1,25 @@
# Copyright (C) 2011-2013 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"

File diff suppressed because it is too large Load Diff

13096
local/share/info/bfd.info Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

22
local/share/info/dir Normal file
View File

@ -0,0 +1,22 @@
This is the file .../info/dir, which contains the
topmost node of the Info hierarchy, called (dir)Top.
The first time you invoke Info you start off looking at this node.

File: dir, Node: Top This is the top of the INFO tree
This (the Directory node) gives a menu of major topics.
Typing "q" exits, "?" lists all Info commands, "d" returns here,
"h" gives a primer for first-timers,
"mEmacs<Return>" visits the Emacs manual, etc.
In Emacs, you can click mouse button 2 on a menu item or cross reference
to select it.
* Menu:
Software development
* Annotate: (annotate). The obsolete annotation interface.
* Bfd: (bfd). The Binary File Descriptor library.
* Gdb: (gdb). The GNU debugger.
* Gdb-Internals: (gdbint). The GNU debugger's internals.
* Stabs: (stabs). The "stabs" debugging information format.

45536
local/share/info/gdb.info Normal file

File diff suppressed because it is too large Load Diff

9057
local/share/info/gdbint.info Normal file

File diff suppressed because it is too large Load Diff

4588
local/share/info/stabs.info Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

396
local/share/man/man1/gdb.1 Normal file
View File

@ -0,0 +1,396 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "GDB 1"
.TH GDB 1 "2013-08-01" "gdb-7.6.50.20130731-cvs" "GNU Development Tools"
.SH "NAME"
gdb \- The GNU Debugger
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
gdb [\fB\-help\fR] [\fB\-nh\fR] [\fB\-nx\fR] [\fB\-q\fR]
[\fB\-batch\fR] [\fB\-cd=\fR\fIdir\fR] [\fB\-f\fR]
[\fB\-b\fR\ \fIbps\fR]
[\fB\-tty=\fR\fIdev\fR] [\fB\-s\fR \fIsymfile\fR]
[\fB\-e\fR\ \fIprog\fR] [\fB\-se\fR\ \fIprog\fR]
[\fB\-c\fR\ \fIcore\fR] [\fB\-p\fR\ \fIprocID\fR]
[\fB\-x\fR\ \fIcmds\fR] [\fB\-d\fR\ \fIdir\fR]
[\fIprog\fR|\fIprog\fR \fIprocID\fR|\fIprog\fR \fIcore\fR]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The purpose of a debugger such as \s-1GDB\s0 is to allow you to see what is
going on \*(L"inside\*(R" another program while it executes \*(-- or what another
program was doing at the moment it crashed.
.PP
\&\s-1GDB\s0 can do four main kinds of things (plus other things in support of
these) to help you catch bugs in the act:
.IP "\(bu" 4
Start your program, specifying anything that might affect its behavior.
.IP "\(bu" 4
Make your program stop on specified conditions.
.IP "\(bu" 4
Examine what has happened, when your program has stopped.
.IP "\(bu" 4
Change things in your program, so you can experiment with correcting the
effects of one bug and go on to learn about another.
.PP
You can use \s-1GDB\s0 to debug programs written in C, C@t{++}, Fortran and
Modula\-2.
.PP
\&\s-1GDB\s0 is invoked with the shell command \f(CW\*(C`gdb\*(C'\fR. Once started, it reads
commands from the terminal until you tell it to exit with the \s-1GDB\s0
command \f(CW\*(C`quit\*(C'\fR. You can get online help from \s-1GDB\s0 itself
by using the command \f(CW\*(C`help\*(C'\fR.
.PP
You can run \f(CW\*(C`gdb\*(C'\fR with no arguments or options; but the most
usual way to start \s-1GDB\s0 is with one argument or two, specifying an
executable program as the argument:
.PP
.Vb 1
\& gdb program
.Ve
.PP
You can also start with both an executable program and a core file specified:
.PP
.Vb 1
\& gdb program core
.Ve
.PP
You can, instead, specify a process \s-1ID\s0 as a second argument, if you want
to debug a running process:
.PP
.Vb 2
\& gdb program 1234
\& gdb -p 1234
.Ve
.PP
would attach \s-1GDB\s0 to process \f(CW1234\fR (unless you also have a file
named \fI1234\fR; \s-1GDB\s0 does check for a core file first).
With option \fB\-p\fR you can omit the \fIprogram\fR filename.
.PP
Here are some of the most frequently needed \s-1GDB\s0 commands:
.IP "\fBbreak [\fR\fIfile\fR\fB:]\fR\fIfunctiop\fR" 4
.IX Item "break [file:]functiop"
Set a breakpoint at \fIfunction\fR (in \fIfile\fR).
.IP "\fBrun [\fR\fIarglist\fR\fB]\fR" 4
.IX Item "run [arglist]"
Start your program (with \fIarglist\fR, if specified).
.IP "\fBbt\fR" 4
.IX Item "bt"
Backtrace: display the program stack.
.IP "\fBprint\fR \fIexpr\fR" 4
.IX Item "print expr"
Display the value of an expression.
.IP "\fBc\fR" 4
.IX Item "c"
Continue running your program (after stopping, e.g. at a breakpoint).
.IP "\fBnext\fR" 4
.IX Item "next"
Execute next program line (after stopping); step \fIover\fR any
function calls in the line.
.IP "\fBedit [\fR\fIfile\fR\fB:]\fR\fIfunction\fR" 4
.IX Item "edit [file:]function"
look at the program line where it is presently stopped.
.IP "\fBlist [\fR\fIfile\fR\fB:]\fR\fIfunction\fR" 4
.IX Item "list [file:]function"
type the text of the program in the vicinity of where it is presently stopped.
.IP "\fBstep\fR" 4
.IX Item "step"
Execute next program line (after stopping); step \fIinto\fR any
function calls in the line.
.IP "\fBhelp [\fR\fIname\fR\fB]\fR" 4
.IX Item "help [name]"
Show information about \s-1GDB\s0 command \fIname\fR, or general information
about using \s-1GDB\s0.
.IP "\fBquit\fR" 4
.IX Item "quit"
Exit from \s-1GDB\s0.
.PP
For full details on \s-1GDB\s0,
see \fIUsing \s-1GDB:\s0 A Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
by Richard M. Stallman and Roland H. Pesch. The same text is available online
as the \f(CW\*(C`gdb\*(C'\fR entry in the \f(CW\*(C`info\*(C'\fR program.
.SH "OPTIONS"
.IX Header "OPTIONS"
Any arguments other than options specify an executable
file and core file (or process \s-1ID\s0); that is, the first argument
encountered with no
associated option flag is equivalent to a \fB\-se\fR option, and the second,
if any, is equivalent to a \fB\-c\fR option if it's the name of a file.
Many options have
both long and short forms; both are shown here. The long forms are also
recognized if you truncate them, so long as enough of the option is
present to be unambiguous. (If you prefer, you can flag option
arguments with \fB+\fR rather than \fB\-\fR, though we illustrate the
more usual convention.)
.PP
All the options and command line arguments you give are processed
in sequential order. The order makes a difference when the \fB\-x\fR
option is used.
.IP "\fB\-help\fR" 4
.IX Item "-help"
.PD 0
.IP "\fB\-h\fR" 4
.IX Item "-h"
.PD
List all options, with brief explanations.
.IP "\fB\-symbols=\fR\fIfile\fR" 4
.IX Item "-symbols=file"
.PD 0
.IP "\fB\-s\fR \fIfile\fR" 4
.IX Item "-s file"
.PD
Read symbol table from file \fIfile\fR.
.IP "\fB\-write\fR" 4
.IX Item "-write"
Enable writing into executable and core files.
.IP "\fB\-exec=\fR\fIfile\fR" 4
.IX Item "-exec=file"
.PD 0
.IP "\fB\-e\fR \fIfile\fR" 4
.IX Item "-e file"
.PD
Use file \fIfile\fR as the executable file to execute when
appropriate, and for examining pure data in conjunction with a core
dump.
.IP "\fB\-se=\fR\fIfile\fR" 4
.IX Item "-se=file"
Read symbol table from file \fIfile\fR and use it as the executable
file.
.IP "\fB\-core=\fR\fIfile\fR" 4
.IX Item "-core=file"
.PD 0
.IP "\fB\-c\fR \fIfile\fR" 4
.IX Item "-c file"
.PD
Use file \fIfile\fR as a core dump to examine.
.IP "\fB\-command=\fR\fIfile\fR" 4
.IX Item "-command=file"
.PD 0
.IP "\fB\-x\fR \fIfile\fR" 4
.IX Item "-x file"
.PD
Execute \s-1GDB\s0 commands from file \fIfile\fR.
.IP "\fB\-ex\fR \fIcommand\fR" 4
.IX Item "-ex command"
Execute given \s-1GDB\s0 \fIcommand\fR.
.IP "\fB\-directory=\fR\fIdirectory\fR" 4
.IX Item "-directory=directory"
.PD 0
.IP "\fB\-d\fR \fIdirectory\fR" 4
.IX Item "-d directory"
.PD
Add \fIdirectory\fR to the path to search for source files.
.IP "\fB\-nh\fR" 4
.IX Item "-nh"
Do not execute commands from \fI~/.gdbinit\fR.
.IP "\fB\-nx\fR" 4
.IX Item "-nx"
.PD 0
.IP "\fB\-n\fR" 4
.IX Item "-n"
.PD
Do not execute commands from any \fI.gdbinit\fR initialization files.
.IP "\fB\-quiet\fR" 4
.IX Item "-quiet"
.PD 0
.IP "\fB\-q\fR" 4
.IX Item "-q"
.PD
\&\*(L"Quiet\*(R". Do not print the introductory and copyright messages. These
messages are also suppressed in batch mode.
.IP "\fB\-batch\fR" 4
.IX Item "-batch"
Run in batch mode. Exit with status \f(CW0\fR after processing all the command
files specified with \fB\-x\fR (and \fI.gdbinit\fR, if not inhibited).
Exit with nonzero status if an error occurs in executing the \s-1GDB\s0
commands in the command files.
.Sp
Batch mode may be useful for running \s-1GDB\s0 as a filter, for example to
download and run a program on another computer; in order to make this
more useful, the message
.Sp
.Vb 1
\& Program exited normally.
.Ve
.Sp
(which is ordinarily issued whenever a program running under \s-1GDB\s0 control
terminates) is not issued when running in batch mode.
.IP "\fB\-cd=\fR\fIdirectory\fR" 4
.IX Item "-cd=directory"
Run \s-1GDB\s0 using \fIdirectory\fR as its working directory,
instead of the current directory.
.IP "\fB\-fullname\fR" 4
.IX Item "-fullname"
.PD 0
.IP "\fB\-f\fR" 4
.IX Item "-f"
.PD
Emacs sets this option when it runs \s-1GDB\s0 as a subprocess. It tells
\&\s-1GDB\s0 to output the full file name and line number in a standard,
recognizable fashion each time a stack frame is displayed (which
includes each time the program stops). This recognizable format looks
like two \fB\e032\fR characters, followed by the file name, line number
and character position separated by colons, and a newline. The
Emacs-to-GDB interface program uses the two \fB\e032\fR
characters as a signal to display the source code for the frame.
.IP "\fB\-b\fR \fIbps\fR" 4
.IX Item "-b bps"
Set the line speed (baud rate or bits per second) of any serial
interface used by \s-1GDB\s0 for remote debugging.
.IP "\fB\-tty=\fR\fIdevice\fR" 4
.IX Item "-tty=device"
Run using \fIdevice\fR for your program's standard input and output.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
The full documentation for \s-1GDB\s0 is maintained as a Texinfo manual.
If the \f(CW\*(C`info\*(C'\fR and \f(CW\*(C`gdb\*(C'\fR programs and \s-1GDB\s0's Texinfo
documentation are properly installed at your site, the command
.PP
.Vb 1
\& info gdb
.Ve
.PP
should give you access to the complete manual.
.PP
\&\fIUsing \s-1GDB:\s0 A Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
Richard M. Stallman and Roland H. Pesch, July 1991.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1988\-2013 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs
Free Documentation\*(R", with the Front-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R"
and with the Back-Cover Texts as in (a) below.
.PP
(a) The \s-1FSF\s0's Back-Cover Text is: \*(L"You are free to copy and modify
this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in
developing \s-1GNU\s0 and promoting software freedom.\*(R"

View File

@ -0,0 +1,364 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "GDBSERVER 1"
.TH GDBSERVER 1 "2013-08-01" "gdb-7.6.50.20130731-cvs" "GNU Development Tools"
.SH "NAME"
gdbserver \- Remote Server for the GNU Debugger
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
gdbserver \fIcomm\fR \fIprog\fR [\fIargs\fR...]
.PP
gdbserver \-\-attach \fIcomm\fR \fIpid\fR
.PP
gdbserver \-\-multi \fIcomm\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBgdbserver\fR is a program that allows you to run \s-1GDB\s0 on a different machine
than the one which is running the program being debugged.
.PP
Usage (server (target) side):
.PP
First, you need to have a copy of the program you want to debug put onto
the target system. The program can be stripped to save space if needed, as
\&\fBgdbserver\fR doesn't care about symbols. All symbol handling is taken care of by
the \s-1GDB\s0 running on the host system.
.PP
To use the server, you log on to the target system, and run the \fBgdbserver\fR
program. You must tell it (a) how to communicate with \s-1GDB\s0, (b) the name of
your program, and (c) its arguments. The general syntax is:
.PP
.Vb 1
\& target> gdbserver <comm> <program> [<args> ...]
.Ve
.PP
For example, using a serial port, you might say:
.PP
.Vb 1
\& target> gdbserver /dev/com1 emacs foo.txt
.Ve
.PP
This tells \fBgdbserver\fR to debug emacs with an argument of foo.txt, and
to communicate with \s-1GDB\s0 via \fI/dev/com1\fR. \fBgdbserver\fR now
waits patiently for the host \s-1GDB\s0 to communicate with it.
.PP
To use a \s-1TCP\s0 connection, you could say:
.PP
.Vb 1
\& target> gdbserver host:2345 emacs foo.txt
.Ve
.PP
This says pretty much the same thing as the last example, except that we are
going to communicate with the \f(CW\*(C`host\*(C'\fR \s-1GDB\s0 via \s-1TCP\s0. The \f(CW\*(C`host:2345\*(C'\fR argument means
that we are expecting to see a \s-1TCP\s0 connection from \f(CW\*(C`host\*(C'\fR to local \s-1TCP\s0 port
2345. (Currently, the \f(CW\*(C`host\*(C'\fR part is ignored.) You can choose any number you
want for the port number as long as it does not conflict with any existing \s-1TCP\s0
ports on the target system. This same port number must be used in the host
GDBs \f(CW\*(C`target remote\*(C'\fR command, which will be described shortly. Note that if
you chose a port number that conflicts with another service, \fBgdbserver\fR will
print an error message and exit.
.PP
\&\fBgdbserver\fR can also attach to running programs.
This is accomplished via the \fB\-\-attach\fR argument. The syntax is:
.PP
.Vb 1
\& target> gdbserver --attach <comm> <pid>
.Ve
.PP
\&\fIpid\fR is the process \s-1ID\s0 of a currently running process. It isn't
necessary to point \fBgdbserver\fR at a binary for the running process.
.PP
To start \f(CW\*(C`gdbserver\*(C'\fR without supplying an initial command to run
or process \s-1ID\s0 to attach, use the \fB\-\-multi\fR command line option.
In such case you should connect using \f(CW\*(C`target extended\-remote\*(C'\fR to start
the program you want to debug.
.PP
.Vb 1
\& target> gdbserver --multi <comm>
.Ve
.PP
Usage (host side):
.PP
You need an unstripped copy of the target program on your host system, since
\&\s-1GDB\s0 needs to examine it's symbol tables and such. Start up \s-1GDB\s0 as you normally
would, with the target program as the first argument. (You may need to use the
\&\fB\-\-baud\fR option if the serial line is running at anything except 9600 baud.)
That is \f(CW\*(C`gdb TARGET\-PROG\*(C'\fR, or \f(CW\*(C`gdb \-\-baud BAUD TARGET\-PROG\*(C'\fR. After that, the only
new command you need to know about is \f(CW\*(C`target remote\*(C'\fR
(or \f(CW\*(C`target extended\-remote\*(C'\fR). Its argument is either
a device name (usually a serial device, like \fI/dev/ttyb\fR), or a \f(CW\*(C`HOST:PORT\*(C'\fR
descriptor. For example:
.PP
.Vb 1
\& (gdb) target remote /dev/ttyb
.Ve
.PP
communicates with the server via serial line \fI/dev/ttyb\fR, and:
.PP
.Vb 1
\& (gdb) target remote the-target:2345
.Ve
.PP
communicates via a \s-1TCP\s0 connection to port 2345 on host `the\-target', where
you previously started up \fBgdbserver\fR with the same port number. Note that for
\&\s-1TCP\s0 connections, you must start up \fBgdbserver\fR prior to using the `target remote'
command, otherwise you may get an error that looks something like
`Connection refused'.
.PP
\&\fBgdbserver\fR can also debug multiple inferiors at once,
described in
the \s-1GDB\s0 manual in node \f(CW\*(C`Inferiors and Programs\*(C'\fR
\&\*(-- shell command \f(CW\*(C`info \-f gdb \-n 'Inferiors and Programs'\*(C'\fR.
In such case use the \f(CW\*(C`extended\-remote\*(C'\fR \s-1GDB\s0 command variant:
.PP
.Vb 1
\& (gdb) target extended-remote the-target:2345
.Ve
.PP
The \fBgdbserver\fR option \fB\-\-multi\fR may or may not be used in such
case.
.SH "OPTIONS"
.IX Header "OPTIONS"
There are three different modes for invoking \fBgdbserver\fR:
.IP "\(bu" 4
Debug a specific program specified by its program name:
.Sp
.Vb 1
\& gdbserver <comm> <prog> [<args>...]
.Ve
.Sp
The \fIcomm\fR parameter specifies how should the server communicate
with \s-1GDB\s0; it is either a device name (to use a serial line),
a \s-1TCP\s0 port number (\f(CW\*(C`:1234\*(C'\fR), or \f(CW\*(C`\-\*(C'\fR or \f(CW\*(C`stdio\*(C'\fR to use
stdin/stdout of \f(CW\*(C`gdbserver\*(C'\fR. Specify the name of the program to
debug in \fIprog\fR. Any remaining arguments will be passed to the
program verbatim. When the program exits, \s-1GDB\s0 will close the
connection, and \f(CW\*(C`gdbserver\*(C'\fR will exit.
.IP "\(bu" 4
Debug a specific program by specifying the process \s-1ID\s0 of a running
program:
.Sp
.Vb 1
\& gdbserver --attach <comm> <pid>
.Ve
.Sp
The \fIcomm\fR parameter is as described above. Supply the process \s-1ID\s0
of a running program in \fIpid\fR; \s-1GDB\s0 will do everything
else. Like with the previous mode, when the process \fIpid\fR exits,
\&\s-1GDB\s0 will close the connection, and \f(CW\*(C`gdbserver\*(C'\fR will exit.
.IP "\(bu" 4
Multi-process mode \*(-- debug more than one program/process:
.Sp
.Vb 1
\& gdbserver --multi <comm>
.Ve
.Sp
In this mode, \s-1GDB\s0 can instruct \fBgdbserver\fR which
command(s) to run. Unlike the other 2 modes, \s-1GDB\s0 will not
close the connection when a process being debugged exits, so you can
debug several processes in the same session.
.PP
In each of the modes you may specify these options:
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
List all options, with brief explanations.
.IP "\fB\-\-version\fR" 4
.IX Item "--version"
This option causes \fBgdbserver\fR to print its version number and exit.
.IP "\fB\-\-attach\fR" 4
.IX Item "--attach"
\&\fBgdbserver\fR will attach to a running program. The syntax is:
.Sp
.Vb 1
\& target> gdbserver --attach <comm> <pid>
.Ve
.Sp
\&\fIpid\fR is the process \s-1ID\s0 of a currently running process. It isn't
necessary to point \fBgdbserver\fR at a binary for the running process.
.IP "\fB\-\-multi\fR" 4
.IX Item "--multi"
To start \f(CW\*(C`gdbserver\*(C'\fR without supplying an initial command to run
or process \s-1ID\s0 to attach, use this command line option.
Then you can connect using \f(CW\*(C`target extended\-remote\*(C'\fR and start
the program you want to debug. The syntax is:
.Sp
.Vb 1
\& target> gdbserver --multi <comm>
.Ve
.IP "\fB\-\-debug\fR" 4
.IX Item "--debug"
Instruct \f(CW\*(C`gdbserver\*(C'\fR to display extra status information about the debugging
process.
This option is intended for \f(CW\*(C`gdbserver\*(C'\fR development and for bug reports to
the developers.
.IP "\fB\-\-remote\-debug\fR" 4
.IX Item "--remote-debug"
Instruct \f(CW\*(C`gdbserver\*(C'\fR to display remote protocol debug output.
This option is intended for \f(CW\*(C`gdbserver\*(C'\fR development and for bug reports to
the developers.
.IP "\fB\-\-wrapper\fR" 4
.IX Item "--wrapper"
Specify a wrapper to launch programs
for debugging. The option should be followed by the name of the
wrapper, then any command-line arguments to pass to the wrapper, then
\&\f(CW\*(C`\-\-\*(C'\fR indicating the end of the wrapper arguments.
.IP "\fB\-\-once\fR" 4
.IX Item "--once"
By default, \fBgdbserver\fR keeps the listening \s-1TCP\s0 port open, so that
additional connections are possible. However, if you start \f(CW\*(C`gdbserver\*(C'\fR
with the \fB\-\-once\fR option, it will stop listening for any further
connection attempts after connecting to the first \s-1GDB\s0 session.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
The full documentation for \s-1GDB\s0 is maintained as a Texinfo manual.
If the \f(CW\*(C`info\*(C'\fR and \f(CW\*(C`gdb\*(C'\fR programs and \s-1GDB\s0's Texinfo
documentation are properly installed at your site, the command
.PP
.Vb 1
\& info gdb
.Ve
.PP
should give you access to the complete manual.
.PP
\&\fIUsing \s-1GDB:\s0 A Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
Richard M. Stallman and Roland H. Pesch, July 1991.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1988\-2013 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs
Free Documentation\*(R", with the Front-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R"
and with the Back-Cover Texts as in (a) below.
.PP
(a) The \s-1FSF\s0's Back-Cover Text is: \*(L"You are free to copy and modify
this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in
developing \s-1GNU\s0 and promoting software freedom.\*(R"

View File

@ -0,0 +1,200 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "GDBINIT 5"
.TH GDBINIT 5 "2013-08-01" "gdb-7.6.50.20130731-cvs" "GNU Development Tools"
.SH "NAME"
gdbinit \- GDB initialization scripts
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
~/.gdbinit
.PP
\&./.gdbinit
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
These files contain \s-1GDB\s0 commands to automatically execute during
\&\s-1GDB\s0 startup. The lines of contents are canned sequences of commands,
described in
the \s-1GDB\s0 manual in node \f(CW\*(C`Sequences\*(C'\fR
\&\*(-- shell command \f(CW\*(C`info \-f gdb \-n Sequences\*(C'\fR.
.PP
Please read more in
the \s-1GDB\s0 manual in node \f(CW\*(C`Startup\*(C'\fR
\&\*(-- shell command \f(CW\*(C`info \-f gdb \-n Startup\*(C'\fR.
.ie n .IP "\fB(not enabled with \fB""\-\-with\-system\-gdbinit""\fB during compilation)\fR" 4
.el .IP "\fB(not enabled with \f(CB\-\-with\-system\-gdbinit\fB during compilation)\fR" 4
.IX Item "(not enabled with --with-system-gdbinit during compilation)"
System-wide initialization file. It is executed unless user specified
\&\s-1GDB\s0 option \f(CW\*(C`\-nx\*(C'\fR or \f(CW\*(C`\-n\*(C'\fR.
See more in
the \s-1GDB\s0 manual in node \f(CW\*(C`System\-wide configuration\*(C'\fR
\&\*(-- shell command \f(CW\*(C`info \-f gdb \-n 'System\-wide configuration'\*(C'\fR.
.IP "\fB~/.gdbinit\fR" 4
.IX Item "~/.gdbinit"
User initialization file. It is executed unless user specified
\&\s-1GDB\s0 options \f(CW\*(C`\-nx\*(C'\fR, \f(CW\*(C`\-n\*(C'\fR or \f(CW\*(C`\-nh\*(C'\fR.
.IP "\fB./.gdbinit\fR" 4
.IX Item "./.gdbinit"
Initialization file for current directory. It may need to be enabled with
\&\s-1GDB\s0 security command \f(CW\*(C`set auto\-load local\-gdbinit\*(C'\fR.
See more in
the \s-1GDB\s0 manual in node \f(CW\*(C`Init File in the Current Directory\*(C'\fR
\&\*(-- shell command \f(CW\*(C`info \-f gdb \-n 'Init File in the Current Directory'\*(C'\fR.
.SH "OPTIONS"
.IX Header "OPTIONS"
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIgdb\fR\|(1), \f(CW\*(C`info \-f gdb \-n Startup\*(C'\fR
.PP
The full documentation for \s-1GDB\s0 is maintained as a Texinfo manual.
If the \f(CW\*(C`info\*(C'\fR and \f(CW\*(C`gdb\*(C'\fR programs and \s-1GDB\s0's Texinfo
documentation are properly installed at your site, the command
.PP
.Vb 1
\& info gdb
.Ve
.PP
should give you access to the complete manual.
.PP
\&\fIUsing \s-1GDB:\s0 A Guide to the \s-1GNU\s0 Source-Level Debugger\fR,
Richard M. Stallman and Roland H. Pesch, July 1991.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1988\-2013 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs
Free Documentation\*(R", with the Front-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R"
and with the Back-Cover Texts as in (a) below.
.PP
(a) The \s-1FSF\s0's Back-Cover Text is: \*(L"You are free to copy and modify
this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in
developing \s-1GNU\s0 and promoting software freedom.\*(R"

0
yk3js40x.x3e.txt Normal file
View File