x86_64 support for GDB.

As mentioned in one of the previous commits, breakpoints don't work
properly yet, and I haven't done much extensive testing yet, but the
basic functionality works.
This commit is contained in:
Alex Smith
2012-08-07 20:24:55 +01:00
parent a731ad19e6
commit a3802ca967
18 changed files with 10884 additions and 16 deletions
+5 -5
View File
@@ -23,14 +23,14 @@ SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr chgrp chmod
chown chroot cksum clear clockconfig cmp collectcatkeys comm compress chown chroot cksum clear clockconfig cmp collectcatkeys comm compress
copyattr cp csplit cut date dd diff diff3 dircolors dirname df du copyattr cp csplit cut date dd diff diff3 dircolors dirname df du
dumpcatalog echo eject env error expand expr factor false find finddir dumpcatalog echo eject env error expand expr factor false find finddir
fmt fold fortune gawk gzip gzexe getlimits groups head hostname id fmt fold fortune gawk gdb gzip gzexe getlimits groups head hostname id
<bin>install isvolume join kernel_debugger kill less lessecho lesskey link <bin>install isvolume join kernel_debugger kill less lessecho lesskey link
linkcatkeys listdev ln locale locate logger logname ls md5sum mkdir mkfifo linkcatkeys listdev ln locale locate logger logname ls md5sum mkdir mkfifo
mktemp mount mountvolume mv nl nohup nproc od paste patch pathchk pr mktemp mount mountvolume mv nl nohup nproc od paste patch pathchk pr
printenv printf ps ptx pwd readlink rm rmattr rmdir safemode sdiff seq printenv printf ps ptx pwd readlink rm rmattr rmdir safemode sdiff seq
sha1sum shred shuf sleep sort split stat stty su sum sync sysinfo tac tail sha1sum shred shuf sleep sort split stat strace stty su sum sync sysinfo
tee test timeout touch tr true truncate tsort tty unexpand uname uniq tac tail tee test timeout touch tr true truncate tsort tty unexpand uname
unlink unmount unzip <bin>updatedb waitfor wc whoami xargs xres yes uniq unlink unmount unzip <bin>updatedb waitfor wc whoami xargs xres yes
zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
; ;
@@ -40,7 +40,7 @@ SYSTEM_PREFERENCES = ;
SYSTEM_DEMOS = ; SYSTEM_DEMOS = ;
SYSTEM_LIBS = libbe.so libbnetapi.so libnetwork.so SYSTEM_LIBS = libbe.so libbnetapi.so libdebug.so libnetwork.so
libroot.so libroot-addon-icu.so libroot.so libroot-addon-icu.so
libtextencoding.so libtracker.so libtranslation.so libtextencoding.so libtracker.so libtranslation.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
+4 -4
View File
@@ -20,13 +20,13 @@ Context::FormatSigned(int64 value, int bytes) const
// decimal // decimal
if (fDecimal) { if (fDecimal) {
snprintf(tmp, sizeof(tmp), "%lld", value); snprintf(tmp, sizeof(tmp), "%" B_PRId64, value);
return tmp; return tmp;
} }
// hex // hex
snprintf(tmp, sizeof(tmp), "0x%llx", value); snprintf(tmp, sizeof(tmp), "0x%" B_PRIx64, value);
// Negative numbers are expanded when being converted to int64. Hence // Negative numbers are expanded when being converted to int64. Hence
// we skip all but the last 2 * bytes hex digits to retain the original // we skip all but the last 2 * bytes hex digits to retain the original
@@ -49,7 +49,7 @@ string
Context::FormatUnsigned(uint64 value) const Context::FormatUnsigned(uint64 value) const
{ {
char tmp[32]; char tmp[32];
snprintf(tmp, sizeof(tmp), fDecimal ? "%llu" : "0x%llx", value); snprintf(tmp, sizeof(tmp), fDecimal ? "%" B_PRIu64 : "0x%" B_PRIx64, value);
return tmp; return tmp;
} }
@@ -57,7 +57,7 @@ string
Context::FormatFlags(uint64 value) const Context::FormatFlags(uint64 value) const
{ {
char tmp[32]; char tmp[32];
snprintf(tmp, sizeof(tmp), "0x%llx", value); snprintf(tmp, sizeof(tmp), "0x%" B_PRIx64, value);
return tmp; return tmp;
} }
+2 -2
View File
@@ -528,8 +528,8 @@ main(int argc, const char *const *argv)
thread_info threadInfo; thread_info threadInfo;
status_t error = get_thread_info(threadID, &threadInfo); status_t error = get_thread_info(threadID, &threadInfo);
if (error != B_OK) { if (error != B_OK) {
fprintf(stderr, "%s: Failed to get info for thread %ld: %s\n", fprintf(stderr, "%s: Failed to get info for thread %" B_PRId32
kCommandName, threadID, strerror(error)); ": %s\n", kCommandName, threadID, strerror(error));
exit(1); exit(1);
} }
teamID = threadInfo.team; teamID = threadInfo.team;
+31 -3
View File
@@ -8,6 +8,9 @@ SubDirSysHdrs [ FDirName $(HAIKU_TOP) src bin gawk intl ] ;
SubDirCcFlags -DHAVE_CONFIG_H -D_GNU_SOURCE ; SubDirCcFlags -DHAVE_CONFIG_H -D_GNU_SOURCE ;
local bfd32SelectVecs = &bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec ;
local bfd64SelectVecs = &bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec ;
# architecture specific sources # architecture specific sources
local bfdArchSources ; local bfdArchSources ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
@@ -20,7 +23,7 @@ if $(TARGET_ARCH) = x86 {
ObjectCcFlags archures.c targets.c : ObjectCcFlags archures.c targets.c :
-DDEFAULT_VECTOR=bfd_elf32_i386_vec -DDEFAULT_VECTOR=bfd_elf32_i386_vec
-DSELECT_VECS=\"&bfd_elf32_i386_vec,&i386pe_vec,&i386pei_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec\" -DSELECT_VECS=\"&bfd_elf32_i386_vec,&i386pe_vec,&i386pei_vec,$(bfd32SelectVecs)\"
-DSELECT_ARCHITECTURES=\"&bfd_i386_arch\" -DSELECT_ARCHITECTURES=\"&bfd_i386_arch\"
-DHAVE_bfd_elf32_i386_vec -DHAVE_bfd_elf32_i386_vec
-DHAVE_i386pe_vec -DHAVE_i386pe_vec
@@ -28,6 +31,26 @@ if $(TARGET_ARCH) = x86 {
-DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_little_generic_vec
-DHAVE_bfd_elf32_big_generic_vec -DHAVE_bfd_elf32_big_generic_vec
; ;
} else if $(TARGET_ARCH) = x86_64 {
bfdArchSources =
cpu-i386.c
elf64-x86-64.c
elf32-i386.c
elf64.c
elf64-gen.c
;
ObjectCcFlags archures.c targets.c :
-DDEFAULT_VECTOR=bfd_elf64_x86_64_vec
-DSELECT_VECS=\"&bfd_elf64_x86_64_vec,&bfd_elf32_i386_vec,$(bfd32SelectVecs),$(bfd64SelectVecs)\"
-DSELECT_ARCHITECTURES=\"&bfd_i386_arch\"
-DHAVE_bfd_elf64_x86_64_vec
-DHAVE_bfd_elf32_i386_vec
-DHAVE_bfd_elf64_little_generic_vec
-DHAVE_bfd_elf64_big_generic_vec
-DHAVE_bfd_elf32_little_generic_vec
-DHAVE_bfd_elf32_big_generic_vec
;
} else if $(TARGET_ARCH) = ppc { } else if $(TARGET_ARCH) = ppc {
bfdArchSources = bfdArchSources =
cpu-powerpc.c cpu-powerpc.c
@@ -81,7 +104,10 @@ local bfdGenericSources =
elf-strtab.c elf-strtab.c
; ;
local bfdGeneratedSources = peigen.c ; local bfdGeneratedSources ;
if $(TARGET_ARCH) != x86_64 {
bfdGeneratedSources = peigen.c ;
}
local bfdAllSources = local bfdAllSources =
$(bfdBaseSources) $(bfdBaseSources)
@@ -167,6 +193,7 @@ local bfdHeadersToCopy =
BFDSimpleSed peigen.c : peXXigen.c : s/XX/pe/g ; BFDSimpleSed peigen.c : peXXigen.c : s/XX/pe/g ;
BFDSimpleSed elf32-target.h : elfxx-target.h : s/NN/32/g ; BFDSimpleSed elf32-target.h : elfxx-target.h : s/NN/32/g ;
BFDSimpleSed elf64-target.h : elfxx-target.h : s/NN/64/g ;
BFDFileSed targmatch.h : config.bfd : targmatch.sed ; BFDFileSed targmatch.h : config.bfd : targmatch.sed ;
BFDCopyConfigHeaders $(bfdHeadersToCopy) ; BFDCopyConfigHeaders $(bfdHeadersToCopy) ;
@@ -174,7 +201,8 @@ BFDCopyConfigHeaders $(bfdHeadersToCopy) ;
# depend on them. # depend on them.
local bfdGeneratedHeaders local bfdGeneratedHeaders
= [ FGristFiles $(bfdHeadersToCopy) elf32-target.h targmatch.h ] ; = [ FGristFiles $(bfdHeadersToCopy) elf32-target.h elf64-target.h
targmatch.h ] ;
Depends gdb-bfd-generated-headers : $(bfdGeneratedHeaders) ; Depends gdb-bfd-generated-headers : $(bfdGeneratedHeaders) ;
NotFile gdb-bfd-generated-headers ; NotFile gdb-bfd-generated-headers ;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
#define BFD_VERSION_DATE 20041018
#define BFD_VERSION 215930000
#define BFD_VERSION_STRING "2.15.93 20041018"
+322
View File
@@ -0,0 +1,322 @@
/* config.h. Generated by configure. */
/* config.in. Generated from configure.in by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */
/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */
/* Define to 1 if NLS is requested */
#define ENABLE_NLS 1
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#define HAVE_ALLOCA_H 1
/* Define to 1 if you have the <argz.h> header file. */
/* #undef HAVE_ARGZ_H */
/* Define to 1 if you have the `dcgettext' function. */
/* #undef HAVE_DCGETTEXT */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the `fcntl' function. */
#define HAVE_FCNTL 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fdopen' function. */
#define HAVE_FDOPEN 1
/* Define to 1 if you have the `fseeko' function. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the `fseeko64' function. */
/* #undef HAVE_FSEEKO64 */
/* Define to 1 if you have the `ftello' function. */
#define HAVE_FTELLO 1
/* Define to 1 if you have the `ftello64' function. */
/* #undef HAVE_FTELLO64 */
/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the `getgid' function. */
#define HAVE_GETGID 1
/* Define to 1 if you have the `getpagesize' function. */
/* #undef HAVE_GETPAGESIZE */
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have the `getuid' function. */
#define HAVE_GETUID 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define if your locale.h file contains LC_MESSAGES. */
#define HAVE_LC_MESSAGES 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define if <sys/procfs.h> has lwpstatus_t. */
/* #undef HAVE_LWPSTATUS_T */
/* Define if <sys/procfs.h> has lwpstatus_t.pr_context. */
/* #undef HAVE_LWPSTATUS_T_PR_CONTEXT */
/* Define if <sys/procfs.h> has lwpstatus_t.pr_reg. */
/* #undef HAVE_LWPSTATUS_T_PR_REG */
/* Define if <sys/procfs.h> has lwpxstatus_t. */
/* #undef HAVE_LWPXSTATUS_T */
/* Define to 1 if you have the `madvise' function. */
/* #undef HAVE_MADVISE */
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the `mprotect' function. */
/* #undef HAVE_MPROTECT */
/* Define to 1 if you have the `munmap' function. */
/* #undef HAVE_MUNMAP */
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <nl_types.h> header file. */
#define HAVE_NL_TYPES_H 1
/* Define if <sys/procfs.h> has prpsinfo32_t. */
/* #undef HAVE_PRPSINFO32_T */
/* Define if <sys/procfs.h> has prpsinfo_t. */
/* #undef HAVE_PRPSINFO_T */
/* Define if <sys/procfs.h> has prstatus32_t. */
/* #undef HAVE_PRSTATUS32_T */
/* Define if <sys/procfs.h> has prstatus32_t.pr_who. */
/* #undef HAVE_PRSTATUS32_T_PR_WHO */
/* Define if <sys/procfs.h> has prstatus_t. */
/* #undef HAVE_PRSTATUS_T */
/* Define if <sys/procfs.h> has prstatus_t.pr_who. */
/* #undef HAVE_PRSTATUS_T_PR_WHO */
/* Define if <sys/procfs.h> has psinfo32_t. */
/* #undef HAVE_PSINFO32_T */
/* Define if <sys/procfs.h> has psinfo_t. */
/* #undef HAVE_PSINFO_T */
/* Define if <sys/procfs.h> has pstatus32_t. */
/* #undef HAVE_PSTATUS32_T */
/* Define if <sys/procfs.h> has pstatus_t. */
/* #undef HAVE_PSTATUS_T */
/* Define to 1 if you have the `putenv' function. */
#define HAVE_PUTENV 1
/* Define if <sys/procfs.h> has pxstatus_t. */
/* #undef HAVE_PXSTATUS_T */
/* Define to 1 if you have the `setenv' function. */
#define HAVE_SETENV 1
/* Define to 1 if you have the `setitimer' function. */
#define HAVE_SETITIMER 1
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the stpcpy function */
#define HAVE_STPCPY 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strtoull' function. */
#define HAVE_STRTOULL 1
/* Define if struct core_dumpx has member c_impl */
/* #undef HAVE_ST_C_IMPL */
/* Define to 1 if you have the `sysconf' function. */
#define HAVE_SYSCONF 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/file.h> header file. */
/* #undef HAVE_SYS_FILE_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/procfs.h> header file. */
/* #undef HAVE_SYS_PROCFS_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <values.h> header file. */
/* #undef HAVE_VALUES_H */
/* Define if <sys/procfs.h> has win32_pstatus_t. */
/* #undef HAVE_WIN32_PSTATUS_T */
/* Define to 1 if you have the `__argz_count' function. */
/* #undef HAVE___ARGZ_COUNT */
/* Define to 1 if you have the `__argz_next' function. */
/* #undef HAVE___ARGZ_NEXT */
/* Define to 1 if you have the `__argz_stringify' function. */
/* #undef HAVE___ARGZ_STRINGIFY */
/* Define if free is not declared in system header files. */
/* #undef NEED_DECLARATION_FREE */
/* Define if getenv is not declared in system header files. */
/* #undef NEED_DECLARATION_GETENV */
/* Define if malloc is not declared in system header files. */
/* #undef NEED_DECLARATION_MALLOC */
/* Define if realloc is not declared in system header files. */
/* #undef NEED_DECLARATION_REALLOC */
/* Define if strstr is not declared in system header files. */
/* #undef NEED_DECLARATION_STRSTR */
/* Name of package */
#define PACKAGE "bfd"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* The number of bytes in type long */
#define SIZEOF_LONG 8
/* The number of bytes in type long long */
#define SIZEOF_LONG_LONG 8
/* The number of bytes in type off_t */
#define SIZEOF_OFF_T 8
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Name of host specific header file to include in trad-core.c. */
/* #undef TRAD_HEADER */
/* Use b modifier when opening binary files? */
/* #undef USE_BINARY_FOPEN */
/* Use mmap if it's available? */
/* #undef USE_MMAP */
/* Version number of package */
#define VERSION "2.15.93"
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `long' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
+5
View File
@@ -33,6 +33,11 @@ if $(TARGET_ARCH) = x86 {
gdbHaikuArchTargetSources = i386-tdep.c i386-haiku-tdep.c i387-tdep.c ; gdbHaikuArchTargetSources = i386-tdep.c i386-haiku-tdep.c i387-tdep.c ;
gdbHaikuArchNativeSources = i386-haiku-nat.c ; gdbHaikuArchNativeSources = i386-haiku-nat.c ;
gdbProcessorName = i386 ; gdbProcessorName = i386 ;
} else if $(TARGET_ARCH) = x86_64 {
gdbHaikuArchTargetSources = amd64-tdep.c amd64-haiku-tdep.c i386-tdep.c
i387-tdep.c ;
gdbHaikuArchNativeSources = amd64-haiku-nat.c ;
gdbProcessorName = i386 ;
} else if $(TARGET_ARCH) = ppc { } else if $(TARGET_ARCH) = ppc {
# TODO: Not yet implemented! # TODO: Not yet implemented!
gdbProcessorName = ppc ; gdbProcessorName = ppc ;
+96
View File
@@ -0,0 +1,96 @@
/* Native-dependent code for Haiku x86_64.
Copyright 2012 Alex Smith <[email protected]>.
Copyright 2005 Ingo Weinhold <[email protected]>.
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 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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "haiku-nat.h"
#include "amd64-tdep.h"
#include "i387-tdep.h"
#include "inferior.h"
#include "regcache.h"
#include "target.h"
/* Offset in `struct debug_cpu_state' where MEMBER is stored. */
#define REG_OFFSET(member) offsetof (struct x86_64_debug_cpu_state, member)
/* At kHaikuAMD64RegOffset[REGNUM] you'll find the offset in `struct
debug_cpu_state' where the GDB register REGNUM is stored. */
static int kHaikuAMD64RegOffset[] = {
REG_OFFSET (rax),
REG_OFFSET (rbx),
REG_OFFSET (rcx),
REG_OFFSET (rdx),
REG_OFFSET (rsi),
REG_OFFSET (rdi),
REG_OFFSET (rbp),
REG_OFFSET (rsp),
REG_OFFSET (r8),
REG_OFFSET (r9),
REG_OFFSET (r10),
REG_OFFSET (r11),
REG_OFFSET (r12),
REG_OFFSET (r13),
REG_OFFSET (r14),
REG_OFFSET (r15),
REG_OFFSET (rip),
REG_OFFSET (rflags),
REG_OFFSET (cs),
REG_OFFSET (ss),
REG_OFFSET (ds),
REG_OFFSET (es),
REG_OFFSET (fs),
REG_OFFSET (gs)
};
void
haiku_supply_registers(int reg, const debug_cpu_state *cpuState)
{
if (reg == -1) {
int i;
for (i = 0; i < NUM_REGS; i++)
haiku_supply_registers(i, cpuState);
} else if (reg < AMD64_ST0_REGNUM) {
int offset = kHaikuAMD64RegOffset[reg];
regcache_raw_supply (current_regcache, reg, (char*)cpuState + offset);
} else {
amd64_supply_fxsave (current_regcache, -1,
&cpuState->extended_registers);
}
}
void
haiku_collect_registers(int reg, debug_cpu_state *cpuState)
{
if (reg == -1) {
int i;
for (i = 0; i < NUM_REGS; i++)
haiku_collect_registers(i, cpuState);
} else if (reg < AMD64_ST0_REGNUM) {
int offset = kHaikuAMD64RegOffset[reg];
regcache_raw_collect (current_regcache, reg, (char*)cpuState + offset);
} else {
amd64_collect_fxsave (current_regcache, -1,
&cpuState->extended_registers);
}
}
+61
View File
@@ -0,0 +1,61 @@
/* Target-dependent code for Haiku x86_64.
Copyright 2012 Alex Smith <[email protected]>.
Copyright 2005 Ingo Weinhold <[email protected]>.
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 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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbarch.h"
#include "amd64-tdep.h"
#include "osabi.h"
static void
amd64_haiku_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
amd64_init_abi (info, gdbarch);
// the offset of the PC in the jmp_buf structure (cf. setjmp(), longjmp())
tdep->jb_pc_offset = 0;
}
static enum gdb_osabi
amd64_haiku_osabi_sniffer (bfd * abfd)
{
char *targetName = bfd_get_target (abfd);
if (strcmp (targetName, "elf64-x86-64") == 0)
return GDB_OSABI_HAIKU;
return GDB_OSABI_UNKNOWN;
}
void
_initialize_amd64_haiku_tdep (void)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
amd64_haiku_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_HAIKU,
amd64_haiku_init_abi);
}
+593
View File
@@ -0,0 +1,593 @@
/* config.h. Generated automatically by configure. */
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#define HAVE_ALLOCA_H 1
/* Define if the `long double' type works. */
#define HAVE_LONG_DOUBLE 1
/* Define if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if the `setpgrp' function takes no argument. */
#define SETPGRP_VOID 1
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define vfork as fork if vfork does not work. */
#define vfork fork
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Define if your struct reg has r_fs. */
/* #undef HAVE_STRUCT_REG_R_FS */
/* Define if your struct stat has st_blocks. */
/* #undef HAVE_STRUCT_STAT_ST_BLOCKS */
/* Define if your struct reg has r_gs. */
/* #undef HAVE_STRUCT_REG_R_GS */
/* Define if <link.h> exists and defines struct link_map which has
members with an ``l_'' prefix. (For Solaris, SVR4, and
SVR4-like systems.) */
/* #undef HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS */
/* Define if <link.h> exists and defines struct link_map which has
members with an ``lm_'' prefix. (For SunOS.) */
/* #undef HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS */
/* Define if <link.h> exists and defines a struct so_map which has
members with an ``som_'' prefix. (Found on older *BSD systems.) */
/* #undef HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS */
/* Define if <sys/link.h> has struct link_map32 */
/* #undef HAVE_STRUCT_LINK_MAP32 */
/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
/* #undef _SYSCALL32 */
/* Define if the prfpregset_t type is broken. */
/* #undef PRFPREGSET_T_BROKEN */
/* Define if you want to use new multi-fd /proc interface
(replaces HAVE_MULTIPLE_PROC_FDS as well as other macros). */
/* #undef NEW_PROC_API */
/* Define if ioctl argument PIOCSET is available. */
/* #undef HAVE_PROCFS_PIOCSET */
/* Define if the `long long' type works. */
#define CC_HAS_LONG_LONG 1
/* Define if the "ll" format works to print long long ints. */
#define PRINTF_HAS_LONG_LONG 1
/* Define if the "%Lg" format works to print long doubles. */
/* #undef PRINTF_HAS_LONG_DOUBLE */
/* Define if the "%Lg" format works to scan long doubles. */
/* #undef SCANF_HAS_LONG_DOUBLE */
/* Define if using Solaris thread debugging. */
/* #undef HAVE_THREAD_DB_LIB */
/* Define on a GNU/Linux system to work around problems in sys/procfs.h. */
/* #undef START_INFERIOR_TRAPS_EXPECTED */
/* #undef sys_quotactl */
/* Define if you have HPUX threads */
/* #undef HAVE_HPUX_THREAD_SUPPORT */
/* Define if <proc_service.h> on solaris uses int instead of
size_t, and assorted other type changes. */
/* #undef PROC_SERVICE_IS_OLD */
/* Define if the simulator is being linked in. */
#define WITH_SIM 1
/* Set to true if the save_state_t structure is present */
/* #undef HAVE_STRUCT_SAVE_STATE_T */
/* Set to true if the save_state_t structure has the ss_wide member */
/* #undef HAVE_STRUCT_MEMBER_SS_WIDE */
/* Define if <sys/ptrace.h> defines the PTRACE_GETREGS request. */
/* #undef HAVE_PTRACE_GETREGS */
/* Define if <sys/ptrace.h> defines the PTRACE_GETFPXREGS request. */
/* #undef HAVE_PTRACE_GETFPXREGS */
/* Define if <sys/ptrace.h> defines the PT_GETDBREGS request. */
/* #undef HAVE_PT_GETDBREGS */
/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
/* #undef HAVE_PT_GETXMMREGS */
/* Define if libunwind library is being used. */
/* #undef HAVE_LIBUNWIND */
/* hostfile */
/* #undef GDB_XM_FILE */
/* targetfile */
#define GDB_TM_FILE "config/i386/tm-haiku.h"
/* nativefile */
#define GDB_NM_FILE "config/i386/nm-haiku.h"
/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
around a <sys/proc.h> problem on IRIX 5. */
#ifndef _KMEMUSER
/* #undef _KMEMUSER */
#endif
/* Define if you have the __argz_count function. */
/* #undef HAVE___ARGZ_COUNT */
/* Define if you have the __argz_next function. */
/* #undef HAVE___ARGZ_NEXT */
/* Define if you have the __argz_stringify function. */
/* #undef HAVE___ARGZ_STRINGIFY */
/* Define if you have the _mcleanup function. */
/* #undef HAVE__MCLEANUP */
/* Define if you have the canonicalize_file_name function. */
/* #undef HAVE_CANONICALIZE_FILE_NAME */
/* Define if you have the dcgettext function. */
/* #undef HAVE_DCGETTEXT */
/* Define if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getpagesize function. */
/* #undef HAVE_GETPAGESIZE */
/* Define if you have the monstartup function. */
/* #undef HAVE_MONSTARTUP */
/* Define if you have the munmap function. */
/* #undef HAVE_MUNMAP */
/* Define if you have the poll function. */
/* #undef HAVE_POLL */
/* Define if you have the pread64 function. */
/* #undef HAVE_PREAD64 */
/* Define if you have the putenv function. */
#define HAVE_PUTENV 1
/* Define if you have the realpath function. */
/* #undef HAVE_REALPATH */
/* Define if you have the sbrk function. */
#define HAVE_SBRK 1
/* Define if you have the setenv function. */
/* #undef HAVE_SETENV */
/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
/* Define if you have the setpgid function. */
#define HAVE_SETPGID 1
/* Define if you have the setpgrp function. */
#define HAVE_SETPGRP 1
/* Define if you have the sigaction function. */
#define HAVE_SIGACTION 1
/* Define if you have the sigprocmask function. */
#define HAVE_SIGPROCMASK 1
/* Define if you have the sigsetmask function. */
/* #undef HAVE_SIGSETMASK */
/* Define if you have the socketpair function. */
/* #undef HAVE_SOCKETPAIR */
/* Define if you have the stpcpy function. */
#define HAVE_STPCPY 1
/* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the syscall function. */
/* #undef HAVE_SYSCALL */
/* Define if you have the ttrace function. */
/* #undef HAVE_TTRACE */
/* Define if you have the wborder function. */
/* #undef HAVE_WBORDER */
/* Define if you have the <argz.h> header file. */
/* #undef HAVE_ARGZ_H */
/* Define if you have the <ctype.h> header file. */
#define HAVE_CTYPE_H 1
/* Define if you have the <curses.h> header file. */
/* #undef HAVE_CURSES_H */
/* Define if you have the <cursesX.h> header file. */
/* #undef HAVE_CURSESX_H */
/* Define if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define if you have the <gnu/libc-version.h> header file. */
/* #undef HAVE_GNU_LIBC_VERSION_H */
/* Define if you have the <libunwind-ia64.h> header file. */
/* #undef HAVE_LIBUNWIND_IA64_H */
/* Define if you have the <libunwind.h> header file. */
/* #undef HAVE_LIBUNWIND_H */
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <link.h> header file. */
/* #undef HAVE_LINK_H */
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define if you have the <machine/reg.h> header file. */
/* #undef HAVE_MACHINE_REG_H */
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if you have the <ncurses.h> header file. */
#define HAVE_NCURSES_H 1
/* Define if you have the <ncurses/ncurses.h> header file. */
/* #undef HAVE_NCURSES_NCURSES_H */
/* Define if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */
/* Define if you have the <nlist.h> header file. */
/* #undef HAVE_NLIST_H */
/* Define if you have the <poll.h> header file. */
/* #undef HAVE_POLL_H */
/* Define if you have the <proc_service.h> header file. */
/* #undef HAVE_PROC_SERVICE_H */
/* Define if you have the <ptrace.h> header file. */
/* #undef HAVE_PTRACE_H */
/* Define if you have the <sgtty.h> header file. */
/* #undef HAVE_SGTTY_H */
/* Define if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <sys/debugreg.h> header file. */
/* #undef HAVE_SYS_DEBUGREG_H */
/* Define if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/fault.h> header file. */
/* #undef HAVE_SYS_FAULT_H */
/* Define if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define if you have the <sys/filio.h> header file. */
/* #undef HAVE_SYS_FILIO_H */
/* Define if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define if you have the <sys/poll.h> header file. */
/* #undef HAVE_SYS_POLL_H */
/* Define if you have the <sys/proc.h> header file. */
/* #undef HAVE_SYS_PROC_H */
/* Define if you have the <sys/procfs.h> header file. */
/* #undef HAVE_SYS_PROCFS_H */
/* Define if you have the <sys/ptrace.h> header file. */
/* #undef HAVE_SYS_PTRACE_H */
/* Define if you have the <sys/reg.h> header file. */
/* #undef HAVE_SYS_REG_H */
/* Define if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define if you have the <sys/syscall.h> header file. */
/* #undef HAVE_SYS_SYSCALL_H */
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if you have the <sys/user.h> header file. */
/* #undef HAVE_SYS_USER_H */
/* Define if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
/* Define if you have the <term.h> header file. */
/* #undef HAVE_TERM_H */
/* Define if you have the <termio.h> header file. */
/* #undef HAVE_TERMIO_H */
/* Define if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define if you have the <thread_db.h> header file. */
/* #undef HAVE_THREAD_DB_H */
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <values.h> header file. */
/* #undef HAVE_VALUES_H */
/* Define if you have the <wait.h> header file. */
/* #undef HAVE_WAIT_H */
/* Define if you have the dl library (-ldl). */
/* #undef HAVE_LIBDL */
/* Define if you have the m library (-lm). */
/* #undef HAVE_LIBM */
/* Define if you have the w library (-lw). */
/* #undef HAVE_LIBW */
/* Define if you have the stpcpy function */
#define HAVE_STPCPY 1
/* Define if your locale.h file contains LC_MESSAGES. */
#define HAVE_LC_MESSAGES 1
/* Define to 1 if NLS is requested */
#define ENABLE_NLS 1
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Name of this package. */
#define PACKAGE "gdb"
/* Global directory for separate debug files. */
#define DEBUGDIR "/usr/local/lib/debug"
/* Define to BFD's default architecture. */
#define DEFAULT_BFD_ARCH bfd_i386_arch
/* Define to BFD's default target vector. */
#define DEFAULT_BFD_VEC bfd_elf64_x86_64_vec
/* Define to 1 if your system has the _etext variable. */
#define HAVE__ETEXT 1
/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
Solaris 2.[789] when using GCC. */
/* #undef _MSE_INT_H */
/* Define to 1 if we found this declaration otherwise define to 0. */
#define HAVE_DECL_GETOPT 0
/* Define to 1 if we found this declaration otherwise define to 0. */
#define HAVE_DECL_PTRACE 0
/* Define as the return type of ptrace. */
#define PTRACE_TYPE_RET int
/* Define to the type of arg 3 for ptrace. */
#define PTRACE_TYPE_ARG3 long
/* Define to the type of arg 5 for ptrace. */
/* #undef PTRACE_TYPE_ARG5 */
/* Define if sigsetjmp is available. */
#define HAVE_SIGSETJMP 1
/* Define to 1 if the regex included in libiberty should be used. */
#define USE_INCLUDED_REGEX 1
/* Define to 1 if your system has td_pcb in struct thread. */
/* #undef HAVE_STRUCT_THREAD_TD_PCB */
/* Define to 1 if your system has struct lwp. */
/* #undef HAVE_STRUCT_LWP */
/* Define to 1 if your system has struct reg in <machine/reg.h>. */
/* #undef HAVE_STRUCT_REG */
/* Define if <stdint.h> provides the uintptr_t type. */
#define HAVE_UINTPTR_T 1
/* Define if malloc is not declared in system header files. */
/* #undef NEED_DECLARATION_MALLOC */
/* Define if realloc is not declared in system header files. */
/* #undef NEED_DECLARATION_REALLOC */
/* Define if free is not declared in system header files. */
/* #undef NEED_DECLARATION_FREE */
/* Define if strerror is not declared in system header files. */
/* #undef NEED_DECLARATION_STRERROR */
/* Define if strdup is not declared in system header files. */
/* #undef NEED_DECLARATION_STRDUP */
/* Define if strstr is not declared in system header files. */
/* #undef NEED_DECLARATION_STRSTR */
/* Define if canonicalize_file_name is not declared in system header files. */
#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
/* Define if <sys/procfs.h> has pstatus_t. */
/* #undef HAVE_PSTATUS_T */
/* Define if <sys/procfs.h> has prrun_t. */
/* #undef HAVE_PRRUN_T */
/* Define if <sys/procfs.h> has gregset_t. */
/* #undef HAVE_GREGSET_T */
/* Define if <sys/procfs.h> has fpregset_t. */
/* #undef HAVE_FPREGSET_T */
/* Define if <sys/procfs.h> has prgregset_t. */
/* #undef HAVE_PRGREGSET_T */
/* Define if <sys/procfs.h> has prfpregset_t. */
/* #undef HAVE_PRFPREGSET_T */
/* Define if <sys/procfs.h> has prgregset32_t. */
/* #undef HAVE_PRGREGSET32_T */
/* Define if <sys/procfs.h> has prfpregset32_t. */
/* #undef HAVE_PRFPREGSET32_T */
/* Define if <sys/procfs.h> has lwpid_t. */
/* #undef HAVE_LWPID_T */
/* Define if <sys/procfs.h> has psaddr_t. */
/* #undef HAVE_PSADDR_T */
/* Define if <sys/procfs.h> has prsysent_t. */
/* #undef HAVE_PRSYSENT_T */
/* Define if <sys/procfs.h> has pr_sigset_t. */
/* #undef HAVE_PR_SIGSET_T */
/* Define if <sys/procfs.h> has pr_sigaction64_t. */
/* #undef HAVE_PR_SIGACTION64_T */
/* Define if <sys/procfs.h> has pr_siginfo64_t. */
/* #undef HAVE_PR_SIGINFO64_T */
/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
/* #undef THREAD_DB_HAS_TD_NOTALLOC */
/* Define if we can use the tkill syscall. */
/* #undef HAVE_TKILL_SYSCALL */
/* Host float floatformat */
#define GDB_HOST_FLOAT_FORMAT 0
/* Host double floatformat */
#define GDB_HOST_DOUBLE_FORMAT 0
/* Host long double floatformat */
#define GDB_HOST_LONG_DOUBLE_FORMAT 0
/* Define to the default OS ABI for this configuration. */
/* #undef GDB_OSABI_DEFAULT */
/* Define to be a string naming the default host character set. */
#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
/* Define if you have the iconv() function. */
/* #undef HAVE_ICONV */
/* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */
+224
View File
@@ -0,0 +1,224 @@
/* Do not modify this file. */
/* It is created automatically by the Makefile. */
#include "defs.h" /* For initialize_file_ftype. */
#include "call-cmds.h" /* For initialize_all_files. */
extern initialize_file_ftype _initialize_gdbtypes;
extern initialize_file_ftype _initialize_amd64_haiku_tdep;
extern initialize_file_ftype _initialize_i386_tdep;
extern initialize_file_ftype _initialize_solib;
extern initialize_file_ftype _initialize_haiku_solib;
extern initialize_file_ftype _initialize_symfile_mem;
extern initialize_file_ftype _initialize_ser_hardwire;
extern initialize_file_ftype _initialize_ser_pipe;
extern initialize_file_ftype _initialize_ser_tcp;
extern initialize_file_ftype _initialize_haiku_nat;
extern initialize_file_ftype _initialize_remote;
extern initialize_file_ftype _initialize_dcache;
extern initialize_file_ftype _initialize_sr_support;
extern initialize_file_ftype _initialize_tracepoint;
extern initialize_file_ftype _initialize_ax_gdb;
extern initialize_file_ftype _initialize_ada_exp;
extern initialize_file_ftype _initialize_annotate;
extern initialize_file_ftype _initialize_auxv;
extern initialize_file_ftype _initialize_breakpoint;
extern initialize_file_ftype _initialize_regcache;
extern initialize_file_ftype _initialize_charset;
extern initialize_file_ftype _initialize_dummy_frame;
extern initialize_file_ftype _initialize_source;
extern initialize_file_ftype _initialize_values;
extern initialize_file_ftype _initialize_valops;
extern initialize_file_ftype _initialize_valarith;
extern initialize_file_ftype _initialize_valprint;
extern initialize_file_ftype _initialize_printcmd;
extern initialize_file_ftype _initialize_symtab;
extern initialize_file_ftype _initialize_symfile;
extern initialize_file_ftype _initialize_symmisc;
extern initialize_file_ftype _initialize_infcall;
extern initialize_file_ftype _initialize_infcmd;
extern initialize_file_ftype _initialize_infrun;
extern initialize_file_ftype _initialize_stack;
extern initialize_file_ftype _initialize_thread;
extern initialize_file_ftype _initialize_interpreter;
extern initialize_file_ftype _initialize_macrocmd;
extern initialize_file_ftype _initialize_gdbarch;
extern initialize_file_ftype _initialize_gdbarch_utils;
extern initialize_file_ftype _initialize_gdb_osabi;
extern initialize_file_ftype _initialize_copying;
extern initialize_file_ftype _initialize_mem;
extern initialize_file_ftype _initialize_parse;
extern initialize_file_ftype _initialize_language;
extern initialize_file_ftype _initialize_frame_reg;
extern initialize_file_ftype _initialize_signals;
extern initialize_file_ftype _initialize_kod;
extern initialize_file_ftype _initialize_gdb_events;
extern initialize_file_ftype _initialize_exec;
extern initialize_file_ftype _initialize_observer;
extern initialize_file_ftype _initialize_maint_cmds;
extern initialize_file_ftype _initialize_demangler;
extern initialize_file_ftype _initialize_dbxread;
extern initialize_file_ftype _initialize_coffread;
extern initialize_file_ftype _initialize_elfread;
extern initialize_file_ftype _initialize_dwarf2_read;
extern initialize_file_ftype _initialize_mipsread;
extern initialize_file_ftype _initialize_stabsread;
extern initialize_file_ftype _initialize_core;
extern initialize_file_ftype _initialize_dwarf2_frame;
extern initialize_file_ftype _initialize_ada_language;
extern initialize_file_ftype _initialize_c_language;
extern initialize_file_ftype _initialize_f_language;
extern initialize_file_ftype _initialize_objc_language;
extern initialize_file_ftype _initialize_ui_out;
extern initialize_file_ftype _initialize_cli_out;
extern initialize_file_ftype _initialize_varobj;
extern initialize_file_ftype _initialize_java_language;
extern initialize_file_ftype _initialize_m2_language;
extern initialize_file_ftype _initialize_pascal_language;
extern initialize_file_ftype _initialize_pascal_valprint;
extern initialize_file_ftype _initialize_scheme_language;
extern initialize_file_ftype _initialize_complaints;
extern initialize_file_ftype _initialize_typeprint;
extern initialize_file_ftype _initialize_cp_valprint;
extern initialize_file_ftype _initialize_f_valprint;
extern initialize_file_ftype _initialize_nlmread;
extern initialize_file_ftype _initialize_serial;
extern initialize_file_ftype _initialize_mdebugread;
extern initialize_file_ftype _initialize_user_regs;
extern initialize_file_ftype _initialize_frame;
extern initialize_file_ftype _initialize_frame_unwind;
extern initialize_file_ftype _initialize_doublest;
extern initialize_file_ftype _initialize_frame_base;
extern initialize_file_ftype _initialize_gnu_v2_abi;
extern initialize_file_ftype _initialize_gnu_v3_abi;
extern initialize_file_ftype _initialize_hpacc_abi;
extern initialize_file_ftype _initialize_cp_abi;
extern initialize_file_ftype _initialize_cp_support;
extern initialize_file_ftype _initialize_cp_namespace;
extern initialize_file_ftype _initialize_reggroup;
extern initialize_file_ftype _initialize_inflow;
extern initialize_file_ftype _initialize_cli_dump;
extern initialize_file_ftype _initialize_cli_logging;
extern initialize_file_ftype _initialize_cli_interp;
extern initialize_file_ftype _initialize_mi_out;
extern initialize_file_ftype _initialize_mi_cmds;
extern initialize_file_ftype _initialize_mi_cmd_env;
extern initialize_file_ftype _initialize_mi_interp;
extern initialize_file_ftype _initialize_mi_main;
extern initialize_file_ftype _initialize_tui_hooks;
extern initialize_file_ftype _initialize_tui_interp;
extern initialize_file_ftype _initialize_tui_layout;
extern initialize_file_ftype _initialize_tui_out;
extern initialize_file_ftype _initialize_tui_regs;
extern initialize_file_ftype _initialize_tui_stack;
extern initialize_file_ftype _initialize_tui_win;
void
initialize_all_files (void)
{
_initialize_gdbtypes ();
_initialize_amd64_haiku_tdep();
_initialize_i386_tdep ();
_initialize_solib ();
_initialize_haiku_solib ();
_initialize_symfile_mem ();
_initialize_ser_hardwire ();
_initialize_ser_pipe ();
_initialize_ser_tcp ();
_initialize_haiku_nat ();
_initialize_remote ();
_initialize_dcache ();
_initialize_sr_support ();
_initialize_tracepoint ();
_initialize_ax_gdb ();
_initialize_ada_exp ();
_initialize_annotate ();
_initialize_auxv ();
_initialize_breakpoint ();
_initialize_regcache ();
_initialize_charset ();
_initialize_dummy_frame ();
_initialize_source ();
_initialize_values ();
_initialize_valops ();
_initialize_valarith ();
_initialize_valprint ();
_initialize_printcmd ();
_initialize_symtab ();
_initialize_symfile ();
_initialize_symmisc ();
_initialize_infcall ();
_initialize_infcmd ();
_initialize_infrun ();
_initialize_stack ();
_initialize_thread ();
_initialize_interpreter ();
_initialize_macrocmd ();
_initialize_gdbarch ();
_initialize_gdbarch_utils ();
_initialize_gdb_osabi ();
_initialize_copying ();
_initialize_mem ();
_initialize_parse ();
_initialize_language ();
_initialize_frame_reg ();
_initialize_signals ();
_initialize_kod ();
_initialize_gdb_events ();
_initialize_exec ();
_initialize_observer ();
_initialize_maint_cmds ();
_initialize_demangler ();
_initialize_dbxread ();
_initialize_coffread ();
_initialize_elfread ();
_initialize_dwarf2_read ();
_initialize_mipsread ();
_initialize_stabsread ();
_initialize_core ();
_initialize_dwarf2_frame ();
_initialize_ada_language ();
_initialize_c_language ();
_initialize_f_language ();
_initialize_objc_language ();
_initialize_ui_out ();
_initialize_cli_out ();
_initialize_varobj ();
_initialize_java_language ();
_initialize_m2_language ();
_initialize_pascal_language ();
_initialize_pascal_valprint ();
_initialize_scheme_language ();
_initialize_complaints ();
_initialize_typeprint ();
_initialize_cp_valprint ();
_initialize_f_valprint ();
_initialize_nlmread ();
_initialize_serial ();
_initialize_mdebugread ();
_initialize_user_regs ();
_initialize_frame ();
_initialize_frame_unwind ();
_initialize_doublest ();
_initialize_frame_base ();
_initialize_gnu_v2_abi ();
_initialize_gnu_v3_abi ();
_initialize_hpacc_abi ();
_initialize_cp_abi ();
_initialize_cp_support ();
_initialize_cp_namespace ();
_initialize_reggroup ();
_initialize_inflow ();
_initialize_cli_dump ();
_initialize_cli_logging ();
_initialize_cli_interp ();
_initialize_mi_out ();
_initialize_mi_cmds ();
_initialize_mi_cmd_env ();
_initialize_mi_interp ();
_initialize_mi_main ();
_initialize_tui_hooks ();
_initialize_tui_interp ();
_initialize_tui_layout ();
_initialize_tui_out ();
_initialize_tui_regs ();
_initialize_tui_stack ();
_initialize_tui_win ();
}
+65
View File
@@ -0,0 +1,65 @@
/* GDB Notifications to Observers.
Copyright 2004 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 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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
--
This file was generated using observer.sh and observer.texi. */
#ifndef OBSERVER_H
#define OBSERVER_H
struct observer;
struct bpstats;
struct so_list;
/* normal_stop notifications. */
typedef void (observer_normal_stop_ftype) (struct bpstats *bs);
extern struct observer *observer_attach_normal_stop (observer_normal_stop_ftype *f);
extern void observer_detach_normal_stop (struct observer *observer);
extern void observer_notify_normal_stop (struct bpstats *bs);
/* target_changed notifications. */
typedef void (observer_target_changed_ftype) (struct target_ops *target);
extern struct observer *observer_attach_target_changed (observer_target_changed_ftype *f);
extern void observer_detach_target_changed (struct observer *observer);
extern void observer_notify_target_changed (struct target_ops *target);
/* inferior_created notifications. */
typedef void (observer_inferior_created_ftype) (struct target_ops *objfile, int from_tty);
extern struct observer *observer_attach_inferior_created (observer_inferior_created_ftype *f);
extern void observer_detach_inferior_created (struct observer *observer);
extern void observer_notify_inferior_created (struct target_ops *objfile, int from_tty);
/* solib_unloaded notifications. */
typedef void (observer_solib_unloaded_ftype) (struct so_list *solib);
extern struct observer *observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f);
extern void observer_detach_solib_unloaded (struct observer *observer);
extern void observer_notify_solib_unloaded (struct so_list *solib);
#endif /* OBSERVER_H */
+177
View File
@@ -0,0 +1,177 @@
/* GDB Notifications to Observers.
Copyright 2004 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 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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
--
This file was generated using observer.sh and observer.texi. */
/* normal_stop notifications. */
static struct observer_list *normal_stop_subject = NULL;
struct normal_stop_args { struct bpstats *bs; };
static void
observer_normal_stop_notification_stub (const void *data, const void *args_data)
{
observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data;
const struct normal_stop_args *args = args_data;
notify (args->bs);
}
struct observer *
observer_attach_normal_stop (observer_normal_stop_ftype *f)
{
return generic_observer_attach (&normal_stop_subject,
&observer_normal_stop_notification_stub,
(void *) f);
}
void
observer_detach_normal_stop (struct observer *observer)
{
generic_observer_detach (&normal_stop_subject, observer);
}
void
observer_notify_normal_stop (struct bpstats *bs)
{
struct normal_stop_args args;
args.bs = bs;
if (observer_debug)
fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n");
generic_observer_notify (normal_stop_subject, &args);
}
/* target_changed notifications. */
static struct observer_list *target_changed_subject = NULL;
struct target_changed_args { struct target_ops *target; };
static void
observer_target_changed_notification_stub (const void *data, const void *args_data)
{
observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data;
const struct target_changed_args *args = args_data;
notify (args->target);
}
struct observer *
observer_attach_target_changed (observer_target_changed_ftype *f)
{
return generic_observer_attach (&target_changed_subject,
&observer_target_changed_notification_stub,
(void *) f);
}
void
observer_detach_target_changed (struct observer *observer)
{
generic_observer_detach (&target_changed_subject, observer);
}
void
observer_notify_target_changed (struct target_ops *target)
{
struct target_changed_args args;
args.target = target;
if (observer_debug)
fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n");
generic_observer_notify (target_changed_subject, &args);
}
/* inferior_created notifications. */
static struct observer_list *inferior_created_subject = NULL;
struct inferior_created_args { struct target_ops *objfile; int from_tty; };
static void
observer_inferior_created_notification_stub (const void *data, const void *args_data)
{
observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data;
const struct inferior_created_args *args = args_data;
notify (args->objfile, args->from_tty);
}
struct observer *
observer_attach_inferior_created (observer_inferior_created_ftype *f)
{
return generic_observer_attach (&inferior_created_subject,
&observer_inferior_created_notification_stub,
(void *) f);
}
void
observer_detach_inferior_created (struct observer *observer)
{
generic_observer_detach (&inferior_created_subject, observer);
}
void
observer_notify_inferior_created (struct target_ops *objfile, int from_tty)
{
struct inferior_created_args args;
args.objfile = objfile, args.from_tty = from_tty;
if (observer_debug)
fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n");
generic_observer_notify (inferior_created_subject, &args);
}
/* solib_unloaded notifications. */
static struct observer_list *solib_unloaded_subject = NULL;
struct solib_unloaded_args { struct so_list *solib; };
static void
observer_solib_unloaded_notification_stub (const void *data, const void *args_data)
{
observer_solib_unloaded_ftype *notify = (observer_solib_unloaded_ftype *) data;
const struct solib_unloaded_args *args = args_data;
notify (args->solib);
}
struct observer *
observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f)
{
return generic_observer_attach (&solib_unloaded_subject,
&observer_solib_unloaded_notification_stub,
(void *) f);
}
void
observer_detach_solib_unloaded (struct observer *observer)
{
generic_observer_detach (&solib_unloaded_subject, observer);
}
void
observer_notify_solib_unloaded (struct so_list *solib)
{
struct solib_unloaded_args args;
args.solib = solib;
if (observer_debug)
fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_unloaded() called\n");
generic_observer_notify (solib_unloaded_subject, &args);
}
+4
View File
@@ -0,0 +1,4 @@
#include "version.h"
const char version[] = "6.3";
const char host_name[] = "x86_64-unknown-haiku";
const char target_name[] = "x86_64-unknown-haiku";
+1 -1
View File
@@ -66,7 +66,7 @@ number of seconds used.
/* FIXME: should be able to declare as clock_t. */ /* FIXME: should be able to declare as clock_t. */
long clock_t
clock () clock ()
{ {
#ifdef HAVE_GETRUSAGE #ifdef HAVE_GETRUSAGE
+1 -1
View File
@@ -13,7 +13,7 @@ SubDirCcFlags -DHAVE_CONFIG_H -D_GNU_SOURCE ;
# architecture specific sources # architecture specific sources
local opcodesArchSources ; local opcodesArchSources ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
opcodesArchSources = i386-dis.c ; opcodesArchSources = i386-dis.c ;
} else if $(TARGET_ARCH) = ppc { } else if $(TARGET_ARCH) = ppc {
opcodesArchSources = ppc-dis.c ; opcodesArchSources = ppc-dis.c ;