From d450852cb3f7b4919eaf956ea0c34a5caeecee5e Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Mon, 16 Aug 1999 19:57:19 +0000 Subject: import gdb-1999-08-16 snapshot --- gdb/ChangeLog | 192 ++++++++++++++++++++ gdb/MAINTAINERS | 3 +- gdb/Makefile.in | 6 +- gdb/arm-tdep.c | 7 +- gdb/coffread.c | 5 + gdb/config.in | 3 + gdb/config/arm/arm.mt | 2 +- gdb/config/i386/nm-i386sol2.h | 3 - gdb/config/mcore/tm-mcore.h | 1 + gdb/config/pa/tm-hppa.h | 15 +- gdb/config/pa/tm-hppa64.h | 19 +- gdb/config/pa/tm-hppah.h | 10 ++ gdb/config/sparc/nm-sun4sol2.h | 3 - gdb/configure | 371 +++++++++++++++++++++++++-------------- gdb/configure.host | 1 + gdb/configure.in | 7 +- gdb/configure.tgt | 10 +- gdb/defs.h | 1 - gdb/doc/ChangeLog | 22 +++ gdb/doc/Makefile.in | 18 +- gdb/doc/gdb.texinfo | 70 ++++++-- gdb/doc/gdbint.texinfo | 10 +- gdb/doc/remote.texi | 22 ++- gdb/event-loop.c | 18 +- gdb/event-loop.h | 11 +- gdb/event-top.c | 17 +- gdb/gdbarch.c | 2 +- gdb/gdbinit.in | 2 +- gdb/gnu-regex.c | 6 +- gdb/hp-symtab-read.c | 1 - gdb/hppa-tdep.c | 251 ++++++-------------------- gdb/hppah-nat.c | 124 +++++++++---- gdb/i386-tdep.c | 3 - gdb/infrun.c | 2 +- gdb/infttrace.c | 49 ++++++ gdb/kod-cisco.c | 3 +- gdb/maint.c | 24 +++ gdb/objfiles.c | 20 +++ gdb/objfiles.h | 3 + gdb/remote.c | 13 +- gdb/somread.c | 28 --- gdb/source.c | 52 ++++-- gdb/stabsread.c | 14 +- gdb/testsuite/ChangeLog | 28 +++ gdb/testsuite/gdb.base/dbx.exp | 49 ++++-- gdb/testsuite/gdb.base/maint.exp | 43 ++++- gdb/testsuite/gdb.hp/Makefile.in | 41 +++-- gdb/top.c | 3 - gdb/utils.c | 67 +++---- gdb/win32-nat.c | 25 +-- 50 files changed, 1119 insertions(+), 581 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bb3f6c634b1..3a63a2bd8f5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,195 @@ +Mon Aug 16 19:08:19 1999 Andrew Cagney + + * configure.in: Try -lsocket when looking for socketpair. + * configure, config.h: Re-generate. + +1999-08-13 Elena Zannoni + + From Christopher Faylor : + + * event-loop.c (gdb_wait_for_event): Before going to wait for + another event with select or poll, flush the error and the output + streams. + + * event-top.c (gdb_readline2): Do not buffer the input, because + doing so can interfere with select/poll in bad ways. + +Fri Aug 13 17:36:56 1999 Eli Zaretskii + + * maint.c (maintenance_dump_me) [__DJGPP__]: Simulate a core dump + with SIGABRT. + * utils.c (quit) [__MSDOS__]: Don't mention SIGINT, since it's not + gonna happen. + (notice_quit): No need to define this function for the DJGPP port. + +1999-08-13 James Ingham + + * arm-tdep.c (arm_frameless_function_invocation): SKIP_PROLOGUE + macro no longer modifies its argument. Update uses to accord. + + * config/arm/arm.mt (TDEPFILES): Add the remote-rdi.o to the + TDEPFILES. + * configure.tgt: Add rdi-share to configdir for the Arm targets. + +Fri Aug 13 11:16:32 1999 Jeffrey A Law (law@cygnus.com) + + * hppah-nat.c (store_inferior_registers): Revamp to be PA2.0W + aware. + + * infttrace.c (ttrace_write_reg_64): New function. + + * hp-symtab-read.c (is_in_import_list): Delete extern declaration. + * somread.c (is_in_import_list): Delete function. + * objfiles.c (is_in_import_list): New function. + * objfiles.h (is_in_import_list): Declare. + + * config/pa/tm-hppa64.h (GDB_TARGET_IS_HPPA20W): Define before + including tm-hppah.h. + (PC_IN_CALL_DUMMY): Define. + (HPUX_1100): Similarly. + * config/pa/tm-hppa.h (somsolib.h, pa64solib.h): Conditionalize + includes on GDB_TARGET_IS_HPPA20W. + + * configure.host: Distinguish between wide and narrow modes + for hpux11. + * config/pa/hpux1100w.mh, config/pa/hpux1100w.mt: New files. + + * config/pa/tm-hppa64.h (STACK_ALIGN): Redefine. + (REG_PARM_STACK_SPACE): Likewise. + + * config/pa/tm-hppa.h (CLEAN_UP_REGISTER_VALUE): Handle 64bit + PA target correctly. + (REG_PARM_STACK_SPACE): Define. + (struct unwind_table_entry): region_start and region_end are + CORE_ADDRs. + (typedef opd_data): New. + (obj_private_data_t): Include pointer to opd_data structure. + +1999-08-13 Keith Seitz + + * stabsread.c (stabsread_clear_cache): New funciton which clears + an optimization cache of the reader. + + * coffread.c (coff_symfile_finish): Give stabs reader a chance to + clean up. + + * win32-nat.c (handle_load_dll): Don't suppress re-reading symbols + from a DLL if an objfile for it already exists. (Not that this should + happen anymore anyway...) + +1999-08-13 Keith Seitz + + * config/mcore/tm-mcore.h (SAVE_DUMMY_FRAME_TOS): Define for MCore, + which also requires that the stack pointer be saved for call + dummies BEFORE arguments get pushed onto it. + +1999-08-12 Stan Shebs + + From Eli Zaretskii : + * source.c (mod_path) [_WIN32 || __DJGPP__]: Don't remove trailing + slash from "d:/". Don't overstep the beginning of name. + [_WIN32 || __MSDOS__]: Convert "d:" to "d:.", otherwise appending + a slash changes its meaning. + (openp): Use SLASH_P, not equality with SLASH_CHAR. + (print_source_lines_base) [CRLF_SOURCE_FILES]: Skip \r only before + a \n. + (forward_search_command) [CRLF_SOURCE_FILES]: Remove \r at the end + of all lines. + (reverse_search_command) [CRLF_SOURCE_FILES]: Likewise. + + * gnu-regex.c (CHAR_CLASS_MAX_LENGTH): Don't use wide characters + unless HAVE_BTOWC is defined. + +Fri Aug 13 10:20:12 1999 Andrew Cagney + + From J.T. Conklin : + * gdbinit.in: Change the template .gdbinit to match the recent + fatal error handling change. + +1999-08-11 Keith Seitz + + * maint.c (maintenance_internal_error): Fix typo in prototype. + +Wed Aug 11 15:38:05 1999 Andrew Cagney + + * remote.c (remote_rcmd): Pass an empty command across to the + target. Check for and handle an ``Enn'' return status. + +Tue Aug 10 13:59:45 1999 Andrew Cagney + + * maint.c (_initialize_maint_cmds): Add ``maintenance + internal-error'' command. + (maintenance_internal_error): New function. + +1999-08-10 James Ingham + + * top.c: Remove the disassembly_flavor_hook, use the new set_hook + instead. + * defs.h: Ditto. + * arm-tdep.c (set_disassembly_flavor_sfunc): Ditto. + +1999-08-10 Michael Snyder + + * config/i386/nm-i386sol2.h (FIND_NEW_THREADS): remove, obsolete. + * config/sparc/nm-sun4sol2.h (FIND_NEW_THREADS): remove, obsolete. + +1999-08-10 J.T. Conklin + + * configure.tgt (i[3456]86-*-aout*, i[3456]86-*-coff*, + i[3456]86-*-elf*): Use embed.mt. + * config/i386/embed.mt: New file. + +1999-08-10 Elena Zannoni + + * remote.c (remote_async_open_1): Remove casting in call to + add_file_handler. + (extended_remote_async_create_inferior): Ditto. + + * event-top.c (change_line_handler): Ditto. + (_initialize_event_loop): Ditto. + + * infrun.c (complete_execution): Ditto. + + * event-loop.c (add_file_handler): Change proc parameter to be ptr + to func with void parameter, rather than void*. Coerce second + paramter in calls to create_file_handler. Replace + async_handler_func and file_handler_func with handler_func. + + * event-loop.h: Get rid of typedefs for file_handler_func and + async_handler_func, just have one, and call it handler_func. + Replace async_handler_func and file_handler_func occurrences with + handler_func. + +Tue Aug 10 03:13:03 1999 Jeffrey A Law (law@cygnus.com) + + * hppa-tdep.c: Delete random #if 0 code. + (is_branch): Handle new branching opcodes from PA2.0 + (inst_saves_gr, inst_saves_fr): Handle additional instructions + used to save general and floating point registers in the stack. + (skip_prologue_hard_way): Handle additional instructions to + save the return pointer in the stack. + (after_prologue): Fix mis-guided and incorrect code to find + the end of the prologue using debug symbols. + (hppa_skip_prologue): Generally clean up comments, lose code + which does not apply to the PA, etc. + +Sun Aug 8 17:53:41 1999 Andrew Cagney + + * MAINTAINERS: Make Andrew Cagney the mn10300 maintainer. + Transfer responsibility for the PowerPC from Andrew Cagney to + Elena Zannoni. + +Tue Aug 10 13:59:45 1999 Andrew Cagney + + Based on code from J.T. Conklin : + * utils.c (internal_error): Make quit? and coredump? separate + questions so that the user can dump-core and not quit. + (internal_error): Cleanup error message. + +1999-08-09 Tom Tromey + + * kod-cisco.c (cisco_kod_open): Removed incorrect `arg' argument. + Sun Aug 8 12:06:47 1999 Fred Fish * coffread.c (process_coff_symbol): Remove section_offsets from diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 745d111753e..b9e8e0cb49b 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -2,7 +2,7 @@ hp testsuite (gdb.hp) Jimmy Guo adl-debugger-wdb-merge-guru@cup.hp.com d10v target Andrew Cagney cagney@cygnus.com d30v target Andrew Cagney cagney@cygnus.com mips target Andrew Cagney cagney@cygnus.com -powerpc target Andrew Cagney cagney@cygnus.com +mn10300 target Andrew Cagney cagney@cygnus.com generic arch support Andrew Cagney cagney@cygnus.com target vector Andrew Cagney cagney@cygnus.com remote.c Andrew Cagney cagney@cygnus.com @@ -11,6 +11,7 @@ win32 host & native Chris Faylor cgf@cygnus.com main (main.c, top.c) Elena Zannoni ezannoni@cygnus.com readline Elena Zannoni ezannoni@cygnus.com arm target Elena Zannoni ezannoni@cygnus.com +powerpc target Elena Zannoni ezannoni@cygnus.com command interpreter Fernando Nasser fnasser@cygnus.com generic symtabs Jim Blandy jimb@cygnus.com dwarf readers Jim Blandy jimb@cygnus.com diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 41fa52f324b..e669a18f55e 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -224,7 +224,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -VERSION = 19990809 +VERSION = 19990816 DIST=gdb LINT=/usr/5bin/lint @@ -531,9 +531,7 @@ NTSOBS = standalone.o NTSSTART = kdb-start.o -SUBDIRS = doc \ - testsuite \ - nlm +SUBDIRS = @SUBDIRS@ # For now, shortcut the "configure GDB for fewer languages" stuff. YYFILES = c-exp.tab.c \ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 994e48f7c95..7598a8decb8 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -186,8 +186,8 @@ arm_frameless_function_invocation (fi) int frameless; func_start = (get_pc_function_start ((fi)->pc) + FUNCTION_START_OFFSET); - after_prologue = func_start; - SKIP_PROLOGUE (after_prologue); + after_prologue = SKIP_PROLOGUE (func_start); + /* There are some frameless functions whose first two instructions follow the standard APCS form, in which case after_prologue will be func_start + 8. */ @@ -1201,9 +1201,6 @@ set_disassembly_flavor_sfunc (args, from_tty, c) struct cmd_list_element *c; { set_disassembly_flavor (); - - if (disassembly_flavor_hook != NULL) - disassembly_flavor_hook(args, from_tty); } static void diff --git a/gdb/coffread.c b/gdb/coffread.c index 29ec6651ff4..3ec0b708cfd 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -176,6 +176,8 @@ struct coff_symbol unsigned int c_type; }; +extern void stabsread_clear_cache PARAMS ((void)); + static struct type *coff_read_struct_type PARAMS ((int, int, int)); static struct type *decode_base_type PARAMS ((struct coff_symbol *, @@ -735,6 +737,9 @@ coff_symfile_finish (objfile) { mfree (objfile->md, objfile->sym_private); } + + /* Let stabs reader clean up */ + stabsread_clear_cache (); } diff --git a/gdb/config.in b/gdb/config.in index e691b8a8c4a..d0ae5a23057 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -285,6 +285,9 @@ /* Define if you have the m library (-lm). */ #undef HAVE_LIBM +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET + /* Define if you have the w library (-lw). */ #undef HAVE_LIBW diff --git a/gdb/config/arm/arm.mt b/gdb/config/arm/arm.mt index 4933c46bcde..0f2cab317bc 100644 --- a/gdb/config/arm/arm.mt +++ b/gdb/config/arm/arm.mt @@ -1,5 +1,5 @@ # Target: Acorn RISC machine (ARM) with simulator -TDEPFILES= arm-tdep.o remote-rdp.o +TDEPFILES= arm-tdep.o remote-rdp.o remote-rdi.o rdi-share/libangsd.a TM_FILE= tm-arm.h SIM_OBS = remote-sim.o diff --git a/gdb/config/i386/nm-i386sol2.h b/gdb/config/i386/nm-i386sol2.h index 68d61fcbbd7..279c9b09840 100644 --- a/gdb/config/i386/nm-i386sol2.h +++ b/gdb/config/i386/nm-i386sol2.h @@ -30,7 +30,4 @@ struct objfile; void sol_thread_new_objfile PARAMS ((struct objfile * objfile)); -#define FIND_NEW_THREADS sol_find_new_threads -void sol_find_new_threads PARAMS ((void)); - #endif diff --git a/gdb/config/mcore/tm-mcore.h b/gdb/config/mcore/tm-mcore.h index aab7b7475d1..69329b419f2 100644 --- a/gdb/config/mcore/tm-mcore.h +++ b/gdb/config/mcore/tm-mcore.h @@ -122,6 +122,7 @@ extern void mcore_pop_frame (struct frame_info *fi); #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) #define CALL_DUMMY_ADDRESS() entry_point_address () #define SIZEOF_CALL_DUMMY_WORDS 0 +#define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP) extern CORE_ADDR mcore_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); #define PUSH_RETURN_ADDRESS(PC, SP) mcore_push_return_address (PC, SP) diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index f284a189004..a35a098b389 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -254,7 +254,7 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((struct frame_info *)); #define CLEAN_UP_REGISTER_VALUE(regno, buf) \ do { \ if ((regno) == PCOQ_HEAD_REGNUM || (regno) == PCOQ_TAIL_REGNUM) \ - (buf)[3] &= ~0x3; \ + (buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \ } while (0) /* Define DO_REGISTERS_INFO() to do machine-specific formatting @@ -564,6 +564,7 @@ extern void hppa_pop_frame PARAMS ((void)); 0x00151820, 0xe6c00002, 0x08000240, 0x08000240} #define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28) +#define REG_PARM_STACK_SPACE 16 #else /* defined PA_LEVEL_0 */ @@ -648,8 +649,8 @@ extern CORE_ADDR struct unwind_table_entry { - unsigned int region_start; - unsigned int region_end; + CORE_ADDR region_start; + CORE_ADDR region_end; unsigned int Cannot_unwind:1; /* 0 */ unsigned int Millicode:1; /* 1 */ @@ -753,10 +754,18 @@ struct obj_unwind_info int last; /* Index of last entry */ }; +typedef struct data { + CORE_ADDR dummy[2]; + CORE_ADDR func_addr; + CORE_ADDR dp; +} opd_data; + typedef struct obj_private_struct { struct obj_unwind_info *unwind_info; /* a pointer */ struct so_list *so_info; /* a pointer */ + opd_data *opd; + int n_opd_entries; } obj_private_data_t; diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 3aaeaeedb7f..ea9090feabb 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* PA 64-bit specific definitions. Override those which are in tm-hppa.h */ -#include "pa/tm-hppah.h" - -#define HPUX_1100 1 - /* jimb: this must go. I'm just using it to disable code I haven't gotten working yet. */ #define GDB_TARGET_IS_HPPA_20W /* The low two bits of the IA are the privilege level of the instruction. */ +#include "pa/tm-hppah.h" + +#define HPUX_1100 1 + #define ADDR_BITS_REMOVE(addr) ((CORE_ADDR)addr & (CORE_ADDR)~3) /* Say how long (ordinary) registers are. This is used in @@ -191,11 +191,22 @@ call_dummy #undef CALL_DUMMY_LENGTH #define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 25) +/* The PA64 ABI mandates a 16 byte stack alignment. */ +#undef STACK_ALIGN +#define STACK_ALIGN(arg) ( ((arg)%16) ? (((arg)+15)&-16) : (arg)) + +/* The PA64 ABI reserves 64 bytes of stack space for outgoing register + parameters. */ +#undef REG_PARM_STACK_SPACE +#define REG_PARM_STACK_SPACE 64 + #undef FUNC_LDIL_OFFSET #undef FUNC_LDO_OFFSET #undef SR4EXPORT_LDIL_OFFSET #undef SR4EXPORT_LDO_OFFSET #undef CALL_DUMMY_LOCATION + +#define PC_IN_CALL_DUMMY(pc, sp, frame_address) hppa64_pc_in_call_dummy (pc) /* jimb: need to find out what AT_WDB_CALL_DUMMY is about */ #if 0 #define CALL_DUMMY_LOCATION AFTER_TEXT_END diff --git a/gdb/config/pa/tm-hppah.h b/gdb/config/pa/tm-hppah.h index d6906bf0925..8014aa9679b 100644 --- a/gdb/config/pa/tm-hppah.h +++ b/gdb/config/pa/tm-hppah.h @@ -24,7 +24,17 @@ #define HPUX_SNAP1 #define HPUX_SNAP2 +/* The solib hooks are not really designed to have a list of hook + and handler routines. So until we clean up those interfaces you + either get SOM shared libraries or HP's unusual PA64 ELF shared + libraries, but not both. */ +#ifdef GDB_TARGET_IS_HPPA_20W +#include "pa64solib.h" +#endif + +#ifndef GDB_TARGET_IS_HPPA_20W #include "somsolib.h" +#endif /* Actually, for a PA running HPUX the kernel calls the signal handler without an intermediate trampoline. Luckily the kernel always sets diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h index a1de6e4e63b..6b930f5a479 100644 --- a/gdb/config/sparc/nm-sun4sol2.h +++ b/gdb/config/sparc/nm-sun4sol2.h @@ -40,7 +40,4 @@ struct objfile; void sol_thread_new_objfile PARAMS ((struct objfile * objfile)); -#define FIND_NEW_THREADS sol_find_new_threads -void sol_find_new_threads PARAMS ((void)); - #endif diff --git a/gdb/configure b/gdb/configure index b2d683cc0b5..b487dbac163 100755 --- a/gdb/configure +++ b/gdb/configure @@ -3389,16 +3389,15 @@ EOF fi -for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll \ - socketpair +for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3397: checking for $ac_func" >&5 +echo "configure:3396: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3448,19 +3447,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3452: checking for working alloca.h" >&5 +echo "configure:3451: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3481,12 +3480,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3485: checking for alloca" >&5 +echo "configure:3484: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3546,12 +3545,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3550: checking whether alloca needs Cray hooks" >&5 +echo "configure:3549: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3580: checking for $ac_func" >&5 +echo "configure:3579: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3631,7 +3630,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3635: checking stack direction for C alloca" >&5 +echo "configure:3634: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3639,7 +3638,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3680,13 +3679,117 @@ EOF fi +echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 +echo "configure:3684: checking for socketpair in -lsocket" >&5 +ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +for ac_func in socketpair +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3733: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:3685: checking whether malloc must be declared" >&5 +echo "configure:3788: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3707,7 +3810,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:3711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -3728,12 +3831,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:3732: checking whether realloc must be declared" >&5 +echo "configure:3835: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3754,7 +3857,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:3758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -3775,12 +3878,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:3779: checking whether free must be declared" >&5 +echo "configure:3882: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3801,7 +3904,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:3805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -3822,12 +3925,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:3826: checking whether strerror must be declared" >&5 +echo "configure:3929: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3848,7 +3951,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:3852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -3869,12 +3972,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:3873: checking whether strdup must be declared" >&5 +echo "configure:3976: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3895,7 +3998,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:3899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -3916,12 +4019,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:3920: checking whether strstr must be declared" >&5 +echo "configure:4023: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3942,7 +4045,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:3946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -3969,9 +4072,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:3973: checking for HPUX save_state structure" >&5 +echo "configure:4076: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -3986,7 +4089,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4038,7 +4141,7 @@ EOF gdb_cv_hostos_is_solaris=yes ;; esac echo $ac_n "checking for directory proc entries""... $ac_c" 1>&6 -echo "configure:4042: checking for directory proc entries" >&5 +echo "configure:4145: checking for directory proc entries" >&5 # The [gdb_host != sun4sol2] hack is because Solaris does provide the # multiple procfs files as of Solaris 2.6, but GDB can't use it right now. if test "$ac_cv_header_sys_procfs_h" = yes -a \ @@ -4060,19 +4163,19 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4064: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4167: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4094,19 +4197,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4098: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:4201: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prrun_t avar ; return 0; } EOF -if { (eval echo configure:4110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -4128,19 +4231,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4132: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:4235: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { gregset_t avar ; return 0; } EOF -if { (eval echo configure:4144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -4162,19 +4265,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4166: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:4269: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpregset_t avar ; return 0; } EOF -if { (eval echo configure:4178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -4198,12 +4301,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4202: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:4305: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4216,7 +4319,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -4238,7 +4341,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:4242: checking for main in -lm" >&5 +echo "configure:4345: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4246,14 +4349,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4282,7 +4385,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:4286: checking for wctype in -lc" >&5 +echo "configure:4389: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4290,7 +4393,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4320,7 +4423,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:4324: checking for wctype in -lw" >&5 +echo "configure:4427: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4328,7 +4431,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4371,12 +4474,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:4375: checking for long long support in compiler" >&5 +echo "configure:4478: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -4408,7 +4511,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:4412: checking for long long support in printf" >&5 +echo "configure:4515: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4416,7 +4519,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -4454,19 +4557,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:4458: checking for long double support in compiler" >&5 +echo "configure:4561: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -4488,7 +4591,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:4492: checking for long double support in printf" >&5 +echo "configure:4595: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4496,7 +4599,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -4530,7 +4633,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:4534: checking for long double support in scanf" >&5 +echo "configure:4637: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4538,7 +4641,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:4552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -4574,17 +4677,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4578: checking for $ac_hdr" >&5 +echo "configure:4681: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4613,12 +4716,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4617: checking for $ac_func" >&5 +echo "configure:4720: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4666,7 +4769,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4670: checking for working mmap" >&5 +echo "configure:4773: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4674,7 +4777,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4843,7 +4946,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:4847: checking for HPUX/OSF thread support" >&5 +echo "configure:4950: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -4862,7 +4965,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:4866: checking for Solaris thread debugging library" >&5 +echo "configure:4969: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4872,7 +4975,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4876: checking for dlopen in -ldl" >&5 +echo "configure:4979: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4880,7 +4983,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4923,17 +5026,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:4927: checking for the ld -export-dynamic flag" >&5 +echo "configure:5030: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -4952,13 +5055,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:4956: checking if is old" >&5 +echo "configure:5059: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4969,7 +5072,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -5104,12 +5207,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:5231: checking for cygwin" >&5 +echo "configure:5334: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5270: checking for tgetent in -lncurses" >&5 +echo "configure:5373: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5151,7 +5254,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5181,7 +5284,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:5308: checking for tgetent in -lHcurses" >&5 +echo "configure:5411: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5189,7 +5292,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5219,7 +5322,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:5346: checking for tgetent in -ltermlib" >&5 +echo "configure:5449: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5227,7 +5330,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5257,7 +5360,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:5384: checking for tgetent in -ltermcap" >&5 +echo "configure:5487: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5265,7 +5368,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5295,7 +5398,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:5422: checking for tgetent in -lcurses" >&5 +echo "configure:5525: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5303,7 +5406,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5333,7 +5436,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:5460: checking for tgetent in -lterminfo" >&5 +echo "configure:5563: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5341,7 +5444,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5404,7 +5507,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:6615: checking for X" >&5 +echo "configure:6718: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5466,12 +5569,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5540,14 +5643,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5827,12 +5930,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:7109: checking for Cygwin environment" >&5 +echo "configure:7212: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -5860,19 +5963,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:7142: checking for mingw32 environment" >&5 +echo "configure:7245: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -5891,7 +5994,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:7173: checking for executable suffix" >&5 +echo "configure:7276: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5901,10 +6004,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:7183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:7286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done diff --git a/gdb/configure.host b/gdb/configure.host index 47e8603cc04..7ee60efb238 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -42,6 +42,7 @@ arm-*-*) gdb_host=arm ;; hppa*-*-bsd*) gdb_host=hppabsd ;; hppa*-*-hiux*) gdb_host=hppahpux ;; hppa*-*-hpux10.20) gdb_host=hpux1020 ;; +hppa2.0w-*-hpux11*) gdb_host=hpux1100w ;; hppa*-*-hpux11*) gdb_host=hpux1100 ;; hppa*-*-hpux*) gdb_host=hppahpux ;; hppa*-*-osf*) gdb_host=hppaosf ;; diff --git a/gdb/configure.in b/gdb/configure.in index ba70e75522e..5707546264a 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -88,10 +88,13 @@ AC_HEADER_STAT AC_C_CONST -AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll \ - socketpair) +AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll) AC_FUNC_ALLOCA +AC_CHECK_LIB(socket, socketpair) +AC_CHECK_FUNCS(socketpair) + + BFD_NEED_DECLARATION(malloc) BFD_NEED_DECLARATION(realloc) BFD_NEED_DECLARATION(free) diff --git a/gdb/configure.tgt b/gdb/configure.tgt index af1255cfba1..312b05016c0 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -51,7 +51,9 @@ alpha*-*-linux*) gdb_target=alpha-linux ;; arc-*-*) gdb_target=arc ;; arm-*-* | thumb-*-* | strongarm-*-*) - gdb_target=arm ;; + gdb_target=arm + configdirs="$configdirs rdi-share" + ;; # OBSOLETE c1-*-*) gdb_target=convex ;; # OBSOLETE c2-*-*) gdb_target=convex ;; @@ -75,9 +77,9 @@ i[3456]86-sequent-bsd*) gdb_target=symmetry ;; i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;; i[3456]86-sequent-sysv*) gdb_target=ptx ;; i[3456]86-ncr-*) gdb_target=ncr3000 ;; -i[3456]86-*-aout*) gdb_target=i386aout ;; -i[3456]86-*-coff*) gdb_target=i386v ;; -i[3456]86-*-elf*) gdb_target=i386v ;; +i[3456]86-*-aout*) gdb_target=embed ;; +i[3456]86-*-coff*) gdb_target=embed ;; +i[3456]86-*-elf*) gdb_target=embed ;; i[3456]86-*-aix*) gdb_target=i386aix ;; i[3456]86-*-bsd*) gdb_target=i386bsd ;; i[3456]86-*-freebsd*) gdb_target=fbsd ;; diff --git a/gdb/defs.h b/gdb/defs.h index c596ed99e5a..13c2bdf23ad 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -1155,7 +1155,6 @@ extern void (*readline_begin_hook) PARAMS ((char *, ...)); extern char * (*readline_hook) PARAMS ((char *)); extern void (*readline_end_hook) PARAMS ((void)); extern void (*register_changed_hook) PARAMS ((int regno)); -extern void (*disassembly_flavor_hook) PARAMS((char *args, int from_tty)); extern void (*memory_changed_hook) PARAMS ((CORE_ADDR addr, int len)); extern void (*context_hook) PARAMS ((int)); extern int (*target_wait_hook) PARAMS ((int pid, diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2d0b2ee108d..46bb910a91e 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,25 @@ +1999-08-12 Ben Elliston + + * gdbint.texinfo (Breakpoint Handling): Add missing words. + +1999-08-10 Eli Zaretskii + + * gdb.texinfo (Set Watchpoints): Explain some subtleties about + watch, awatch, and rwatch. Explain why the latter two cannot be + set as software watchpoints. Document that watchpoints for local + variables are deleted when the debuggee terminates. + +Wed Aug 11 13:18:14 1999 Andrew Cagney + + * remote.texi (Protocol): Further clarification of the "qRcmd" + packet. Allow E.. response packet. "qRcmd" packet is no longer + reserved. + +1999-08-10 Elena Zannoni + + * Makefile.in: Rename inc-hist.texi to inc-hist.texinfo. + * gdb.texinfo: Ditto. + 1999-08-06 Tom Tromey * gdb.texinfo (KOD): New node. diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index f81e58363b9..ad93b5ee046 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -88,7 +88,7 @@ SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/remote.texi SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED) SFILES_DOC = $(SFILES_LOCAL) \ - $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texi + $(READLINE_DIR)/rluser.texinfo $(READLINE_DIR)/inc-hist.texinfo #### Host, target, and site specific Makefile fragments come in here. ### @@ -152,7 +152,7 @@ mostlyclean: rm -f sedref.dvi sedref.tex tmp.sed clean: mostlyclean - rm -f rluser.texinfo inc-hist.texi gdb-cfg.texi + rm -f rluser.texinfo inc-hist.texinfo gdb-cfg.texi distclean: clean rm -f Makefile config.status @@ -260,13 +260,13 @@ rluser.texinfo: ${READLINE_DIR}/rluser.texinfo -e 's/^@end ftable/@end table/g' \ ${READLINE_DIR}/rluser.texinfo > ./rluser.texinfo -inc-hist.texi: ${READLINE_DIR}/inc-hist.texi - ln -s ${READLINE_DIR}/inc-hist.texi . || \ - ln ${READLINE_DIR}/inc-hist.texi . || \ - cp ${READLINE_DIR}/inc-hist.texi . +inc-hist.texinfo: ${READLINE_DIR}/inc-hist.texinfo + ln -s ${READLINE_DIR}/inc-hist.texinfo . || \ + ln ${READLINE_DIR}/inc-hist.texinfo . || \ + cp ${READLINE_DIR}/inc-hist.texinfo . # gdb manual suitable for [gtn]roff -me -gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi +gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -281,7 +281,7 @@ gdb.me: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi >gdb.me # gdb manual suitable for [gtn]roff -ms -gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi +gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ @@ -298,7 +298,7 @@ gdb.ms: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi # gdb manual suitable for [tn]roff -mm # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, # try leaving them in -gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi +gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texinfo sed -e '/\\input texinfo/d' \ -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ -e '/^@ifinfo/,/^@end ifinfo/d' \ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 92e4a21b392..d150881f608 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2667,14 +2667,11 @@ is written into by the program and its value changes. @kindex rwatch @item rwatch @var{expr} Set a watchpoint that will break when watch @var{expr} is read by the program. -If you use both watchpoints, both must be set with the @code{rwatch} -command. @kindex awatch @item awatch @var{expr} Set a watchpoint that will break when @var{args} is read and written into -by the program. If you use both watchpoints, both must be set with the -@code{awatch} command. +by the program. @kindex info watchpoints @item info watchpoints @@ -2698,14 +2695,49 @@ Hardware watchpoint @var{num}: @var{expr} @noindent if it was able to set a hardware watchpoint. -The SPARClite DSU will generate traps when a program accesses -some data or instruction address that is assigned to the debug registers. -For the data addresses, DSU facilitates the @code{watch} command. -However the hardware breakpoint registers can only take two data watchpoints, -and both watchpoints must be the same kind. For example, you can set two -watchpoints with @code{watch} commands, two with @code{rwatch} -commands, @strong{or} two with @code{awatch} commands, but you cannot set one -watchpoint with one command and the other with a different command. +Currently, the @code{awatch} and @code{rwatch} commands can only set +hardware watchpoints, because accesses to data that don't change the +value of the watched expression cannot be detected without examining +every instruction as it is being executed, and @value{GDBN} does not do +that currently. If @value{GDBN} finds that it is unable to set a +hardware breakpoint with the @code{awatch} or @code{rwatch} command, it +will print a message like this: + +@smallexample +Expression cannot be implemented with read/access watchpoint. +@end smallexample + +Sometimes, @value{GDBN} cannot set a hardware watchpoint because the +data type of the watched expression is wider than what a hardware +watchpoint on the target machine can handle. For example, some systems +can only watch regions that are up to 4 bytes wide; on such systems you +cannot set hardware watchpoints for an expression that yields a +double-precision floating-point number (which is typically 8 bytes +wide). As a work-around, it might be possible to break the large region +into a series of smaller ones and watch them with separate watchpoints. + +If you set too many hardware watchpoints, @value{GDBN} might be unable +to insert all of them when you resume the execution of your program. +Since the precise number of active watchpoints is unknown until such +time as the program is about to be resumed, @value{GDBN} might not be +able to warn you about this when you set the watchpoints, and the +warning will be printed only when the program is resumed: + +@smallexample +Hardware watchpoint @var{num}: Could not insert watchpoint +@end smallexample + +@noindent +If this happens, delete or disable some of the watchpoints. + +The SPARClite DSU will generate traps when a program accesses some data +or instruction address that is assigned to the debug registers. For the +data addresses, DSU facilitates the @code{watch} command. However the +hardware breakpoint registers can only take two data watchpoints, and +both watchpoints must be the same kind. For example, you can set two +watchpoints with @code{watch} commands, two with @code{rwatch} commands, +@strong{or} two with @code{awatch} commands, but you cannot set one +watchpoint with one command and the other with a different command. @value{GDBN} will reject the command if you try to mix watchpoints. Delete or disable unused watchpoint commands before setting new ones. @@ -2713,6 +2745,16 @@ If you call a function interactively using @code{print} or @code{call}, any watchpoints you have set will be inactive until GDB reaches another kind of breakpoint or the call completes. +@value{GDBN} automatically deletes watchpoints that watch local +(automatic) variables, or expressions that involve such variables, when +they go out of scope, that is, when the execution leaves the block in +which these variables were defined. In particular, when the program +being debugged terminates, @emph{all} local variables go out of scope, +and so only watchpoints that watch global variables remain set. If you +rerun the program, you will need to set all such watchpoints again. One +way of doing that would be to set a code breakpoint at the entry to the +@code{main} function and when it breaks, set all the watchpoints. + @quotation @cindex watchpoints and threads @cindex threads and watchpoints @@ -9820,11 +9862,11 @@ things without first using the debugger to find the facts. @c The readline documentation is distributed with the readline code @c and consists of the two following files: @c rluser.texinfo -@c inc-hist.texi +@c inc-hist.texinfo @c Use -I with makeinfo to point to the appropriate directory, @c environment var TEXINPUTS with TeX. @include rluser.texinfo -@include inc-hist.texi +@include inc-hist.texinfo @ifclear PRECONFIGURED diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index b98b0dfff0e..10981ee07b2 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -46,7 +46,7 @@ regarded as a program in the language TeX). @page @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.1.1.12 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.1.1.13 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Solutions\par \hfill \manvers\par @@ -262,10 +262,10 @@ limited in number; when the user asks for more, GDB will start trying to set software breakpoints. Software breakpoints require GDB to do somewhat more work. The basic -theory is that GDB will replace a program instruction a trap, illegal -divide, or some other instruction that will cause an exception, and then -when it's encountered, GDB will take the exception and stop the program. -When the user says to continue, GDB will restore the original +theory is that GDB will replace a program instruction with a trap, +illegal divide, or some other instruction that will cause an exception, +and then when it's encountered, GDB will take the exception and stop the +program. When the user says to continue, GDB will restore the original instruction, single-step, re-insert the trap, and continue on. Since it literally overwrites the program being tested, the program area diff --git a/gdb/doc/remote.texi b/gdb/doc/remote.texi index d8636dab954..714b2a217b2 100644 --- a/gdb/doc/remote.texi +++ b/gdb/doc/remote.texi @@ -763,19 +763,27 @@ encoded 32 bit mode; @var{threadid} is a hex encoded 64 bit thread ID. @tab See @code{remote.c:remote_unpack_thread_info_response()}. -@item remote command @strong{(reserved)} +@item remote command @tab @code{q}@code{Rcmd,}@var{COMMAND} @tab @var{COMMAND} (hex encoded) is passed to the local interpreter for -execution. @emph{Implementors should note that providing access to a +execution. Invalid commands should be reported using the output string. +Before the final result packet, the target may also respond with a +number of intermediate @code{O}@var{OUTPUT} console output +packets. @emph{Implementors should note that providing access to a stubs's interpreter may have security implications}. @item -@tab reply @var{OUTPUT} or @code{OK} +@tab reply @code{OK} +@tab +A command response with no output. +@item +@tab reply @var{OUTPUT} +@tab +A command response with the hex encoded output string @var{OUTPUT}. +@item +@tab reply @code{E}@var{NN} @tab -The @var{OUTPUT} is the hex encoded output from the command. @code{OK} -is returned when the @var{OUTPUT} would have been empty. The target may -also respond with a number of intermediate @code{O}@var{OUTPUT} console -output packets. +Indicate a badly formed request. @item @tab reply @samp{} diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 4d35ed785da..78ecb63e747 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -120,7 +120,7 @@ sighandler_list; function. */ static int async_handler_ready = 0; -static void create_file_handler PARAMS ((int, int, file_handler_func *, gdb_client_data)); +static void create_file_handler PARAMS ((int, int, handler_func *, gdb_client_data)); static void invoke_async_signal_handler PARAMS ((void)); static int gdb_wait_for_event PARAMS ((void)); static int gdb_do_one_event PARAMS ((void)); @@ -318,13 +318,13 @@ start_event_loop () void add_file_handler (fd, proc, client_data) int fd; - file_handler_func *proc; + void (*proc) (void); gdb_client_data client_data; { #ifdef HAVE_POLL - create_file_handler (fd, POLLIN, (file_handler_func *) proc, client_data); + create_file_handler (fd, POLLIN, (handler_func *) proc, client_data); #else - create_file_handler (fd, GDB_READABLE, (file_handler_func *) proc, client_data); + create_file_handler (fd, GDB_READABLE, (handler_func *) proc, client_data); #endif } @@ -342,7 +342,7 @@ static void create_file_handler (fd, mask, proc, client_data) int fd; int mask; - file_handler_func *proc; + handler_func *proc; gdb_client_data client_data; { file_handler *file_ptr; @@ -556,7 +556,7 @@ handle_file_event (event_file_desc) /* If there was a match, then call the handler. */ if (mask != 0) - (*file_ptr->proc) (file_ptr->client_data, mask); + (*file_ptr->proc) (file_ptr->client_data); break; } } @@ -581,6 +581,10 @@ gdb_wait_for_event () int mask, bit, index; #endif + /* Make sure all output is done before getting another event. */ + gdb_flush (gdb_stdout); + gdb_flush (gdb_stderr); + if (gdb_notifier.num_fds == 0) return -1; @@ -689,7 +693,7 @@ gdb_wait_for_event () whenever the handler is invoked. */ async_signal_handler * create_async_signal_handler (proc, client_data) - async_handler_func *proc; + handler_func *proc; gdb_client_data client_data; { async_signal_handler *async_handler_ptr; diff --git a/gdb/event-loop.h b/gdb/event-loop.h index 393b3e00ba3..bde1784a831 100644 --- a/gdb/event-loop.h +++ b/gdb/event-loop.h @@ -60,8 +60,7 @@ typedef PTR gdb_client_data; typedef struct gdb_event gdb_event; -typedef void (file_handler_func) PARAMS ((gdb_client_data, int mask)); -typedef void (async_handler_func) PARAMS ((gdb_client_data)); +typedef void (handler_func) PARAMS ((gdb_client_data)); typedef void (event_handler_func) PARAMS ((int)); /* Event for the GDB event system. Events are queued by calling @@ -91,7 +90,7 @@ typedef struct file_handler int mask; /* Events we want to monitor: POLLIN, etc. */ int ready_mask; /* Events that have been seen since the last time. */ - file_handler_func *proc; /* Procedure to call when fd is ready. */ + handler_func *proc; /* Procedure to call when fd is ready. */ gdb_client_data client_data; /* Argument to pass to proc. */ struct file_handler *next_file; /* Next registered file descriptor. */ } @@ -111,7 +110,7 @@ typedef struct async_signal_handler int ready; /* If ready, call this handler from the main event loop, using invoke_async_handler. */ struct async_signal_handler *next_handler; /* Ptr to next handler */ - async_handler_func *proc; /* Function to call to do the work */ + handler_func *proc; /* Function to call to do the work */ gdb_client_data client_data; /* Argument to async_handler_func */ } async_signal_handler; @@ -227,10 +226,10 @@ struct prompts extern void start_event_loop PARAMS ((void)); extern void delete_file_handler PARAMS ((int)); -extern void add_file_handler PARAMS ((int, file_handler_func, gdb_client_data)); +extern void add_file_handler PARAMS ((int, void (*) (void), gdb_client_data)); extern void mark_async_signal_handler PARAMS ((async_signal_handler *)); extern async_signal_handler * - create_async_signal_handler PARAMS ((async_handler_func *, gdb_client_data)); + create_async_signal_handler PARAMS ((handler_func *, gdb_client_data)); extern void delete_async_signal_handler PARAMS ((async_signal_handler ** async_handler_ptr)); /* Exported functions from event-top.c. diff --git a/gdb/event-top.c b/gdb/event-top.c index 639a71bd176..eb4f820635e 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -224,7 +224,7 @@ change_line_handler () off. This means that the 'set editing on/off' will have effect only on the interactive session. */ delete_file_handler (input_fd); - add_file_handler (input_fd, (file_handler_func *) call_readline, 0); + add_file_handler (input_fd, call_readline, 0); } /* Displays the prompt. The prompt that is displayed is the current @@ -774,6 +774,19 @@ gdb_readline2 () char *result; int input_index = 0; int result_size = 80; + static int done_once = 0; + + /* Unbuffer the input stream, so that, later on, the calls to fgetc + fetch only one char at the time from the stream. The fgetc's will + get up to the first newline, but there may be more chars in the + stream after '\n'. If we buffer the input and fgetc drains the + stream, getting stuff beyond the newline as well, a select, done + afterwards will not trigger. */ + if (!done_once && !ISATTY (instream)) + { + setbuf (instream, NULL); + done_once = 1; + } result = (char *) xmalloc (result_size); @@ -1100,7 +1113,7 @@ _initialize_event_loop () the target program (inferior), but that must be registered only when it actually exists (I.e. after we say 'run' or after we connect to a remote target. */ - add_file_handler (input_fd, (file_handler_func *) call_readline, 0); + add_file_handler (input_fd, call_readline, 0); /* Tell gdb that we will be using the readline library. This could be overwritten by a command in .gdbinit like 'set diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index b102c69f670..aceeed7da0e 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -1262,7 +1262,7 @@ set_gdbarch_pc_regnum (gdbarch, pc_regnum) char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr) { - if (gdbarch->register_name == 0 || 1) + if (gdbarch->register_name == 0) internal_error ("gdbarch: gdbarch_register_name invalid"); if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in index af97d2cae3d..b6a32dba09f 100644 --- a/gdb/gdbinit.in +++ b/gdb/gdbinit.in @@ -2,7 +2,7 @@ echo Setting up the environment for debugging gdb.\n set complaints 1 -b fatal +b internal_error b info_command commands diff --git a/gdb/gnu-regex.c b/gdb/gnu-regex.c index ef798075f83..8051c12d00c 100644 --- a/gdb/gnu-regex.c +++ b/gdb/gnu-regex.c @@ -1702,7 +1702,11 @@ typedef struct } \ } -#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) +/* Use this only if they have btowc(), since wctype() is used below + together with btowc(). btowc() is defined in the 1994 Amendment 1 + to ISO C and may not be present on systems where we have wchar.h + and wctype.h. */ +#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_BTOWC) /* The GNU C library provides support for user-defined character classes and the functions from ISO C amendement 1. */ # ifdef CHARCLASS_NAME_MAX diff --git a/gdb/hp-symtab-read.c b/gdb/hp-symtab-read.c index a4324734126..dc045a4ef4e 100644 --- a/gdb/hp-symtab-read.c +++ b/gdb/hp-symtab-read.c @@ -2830,7 +2830,6 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile, struct symbol *sym; struct context_stack *new; char *class_scope_name; - extern int is_in_import_list (); /* in somread.c */ /* Allocate one GDB debug symbol and fill in some default values. */ sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index ed41361458f..25dbcfba3c2 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -186,35 +186,6 @@ low_sign_extend (val, bits) /* extract the immediate field from a ld{bhw}s instruction */ -#if 0 - -unsigned -get_field (val, from, to) - unsigned val, from, to; -{ - val = val >> 31 - to; - return val & ((1 << 32 - from) - 1); -} - -unsigned -set_field (val, from, to, new_val) - unsigned *val, from, to; -{ - unsigned mask = ~((1 << (to - from + 1)) << (31 - from)); - return *val = *val & mask | (new_val << (31 - from)); -} - -/* extract a 3-bit space register number from a be, ble, mtsp or mfsp */ - -int -extract_3 (word) - unsigned word; -{ - return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17); -} - -#endif - static int extract_5_load (word) unsigned word; @@ -222,19 +193,6 @@ extract_5_load (word) return low_sign_extend (word >> 16 & MASK_5, 5); } -#if 0 - -/* extract the immediate field from a st{bhw}s instruction */ - -int -extract_5_store (word) - unsigned word; -{ - return low_sign_extend (word & MASK_5, 5); -} - -#endif /* 0 */ - /* extract the immediate field from a break instruction */ static unsigned @@ -253,19 +211,6 @@ extract_5R_store (word) return (word >> 16 & MASK_5); } -/* extract an 11 bit immediate field */ - -#if 0 - -int -extract_11 (word) - unsigned word; -{ - return low_sign_extend (word & MASK_11, 11); -} - -#endif - /* extract a 14 bit immediate field */ static int @@ -331,35 +276,6 @@ deposit_21 (opnd, word) return word | val; } -/* extract a 12 bit constant from branch instructions */ - -#if 0 - -int -extract_12 (word) - unsigned word; -{ - return sign_extend (GET_FIELD (word, 19, 28) | - GET_FIELD (word, 29, 29) << 10 | - (word & 0x1) << 11, 12) << 2; -} - -/* Deposit a 17 bit constant in an instruction (like bl). */ - -unsigned int -deposit_17 (opnd, word) - unsigned opnd, word; -{ - word |= GET_FIELD (opnd, 15 + 0, 15 + 0); /* w */ - word |= GET_FIELD (opnd, 15 + 1, 15 + 5) << 16; /* w1 */ - word |= GET_FIELD (opnd, 15 + 6, 15 + 6) << 2; /* w2[10] */ - word |= GET_FIELD (opnd, 15 + 7, 15 + 16) << 3; /* w2[0..9] */ - - return word; -} - -#endif - /* extract a 17 bit constant from branch instructions, returning the 19 bit signed value. */ @@ -3209,10 +3125,12 @@ is_branch (inst) case 0x21: case 0x22: case 0x23: + case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2b: + case 0x2f: case 0x30: case 0x31: case 0x32: @@ -3220,6 +3138,7 @@ is_branch (inst) case 0x38: case 0x39: case 0x3a: + case 0x3b: return 1; default: @@ -3235,7 +3154,16 @@ inst_saves_gr (inst) unsigned long inst; { /* Does it look like a stw? */ - if ((inst >> 26) == 0x1a) + if ((inst >> 26) == 0x1a || (inst >> 26) == 0x1b + || (inst >> 26) == 0x1f + || ((inst >> 26) == 0x1f + && ((inst >> 6) == 0xa))) + return extract_5R_store (inst); + + /* Does it look like a std? */ + if ((inst >> 26) == 0x1c + || ((inst >> 26) == 0x03 + && ((inst >> 6) & 0xf) == 0xb)) return extract_5R_store (inst); /* Does it look like a stwm? GCC & HPC may use this in prologues. */ @@ -3244,7 +3172,10 @@ inst_saves_gr (inst) /* Does it look like sth or stb? HPC versions 9.0 and later use these too. */ - if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18) + if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18 + || ((inst >> 26) == 0x3 + && (((inst >> 6) & 0xf) == 0x8 + || (inst >> 6) & 0xf) == 0x9)) return extract_5R_store (inst); return 0; @@ -3262,12 +3193,16 @@ static int inst_saves_fr (inst) unsigned long inst; { - /* is this an FSTDS ? */ + /* is this an FSTD ? */ if ((inst & 0xfc00dfc0) == 0x2c001200) return extract_5r_store (inst); - /* is this an FSTWS ? */ + if ((inst & 0xfc000002) == 0x70000002) + return extract_5R_store (inst); + /* is this an FSTW ? */ if ((inst & 0xfc00df80) == 0x24001200) return extract_5r_store (inst); + if ((inst & 0xfc000002) == 0x7c000000) + return extract_5R_store (inst); return 0; } @@ -3369,8 +3304,9 @@ restart: /* Note the interesting effects of this instruction. */ stack_remaining -= prologue_inst_adjust_sp (inst); - /* There is only one instruction used for saving RP into the stack. */ - if (inst == 0x6bc23fd9) + /* There are limited ways to store the return pointer into the + stack. */ + if (inst == 0x6bc23fd9 || inst == 0x0fc212c1) save_rp = 0; /* This is the only way we save SP into the stack. At this time @@ -3497,11 +3433,8 @@ restart: } - - - -/* return 0 if we cannot determine the end of the prologue, - return the new pc value if we know where the prologue ends */ +/* Return the address of the PC after the last prologue instruction if + we can determine it from the debug symbols. Else return zero. */ static CORE_ADDR after_prologue (pc) @@ -3511,46 +3444,29 @@ after_prologue (pc) CORE_ADDR func_addr, func_end; struct symbol *f; + /* If we can not find the symbol in the partial symbol table, then + there is no hope we can determine the function's start address + with this code. */ if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end)) - return 0; /* Unknown */ - - f = find_pc_function (pc); - if (!f) - return 0; /* no debug info, do it the hard way! */ + return 0; + /* Get the line associated with FUNC_ADDR. */ sal = find_pc_line (func_addr, 0); - if (sal.end < func_end) - { - /* this happens when the function has no prologue, because the way - find_pc_line works: elz. Note: this may not be a very good - way to decide whether a function has a prologue or not, but - it is the best I can do with the info available - Also, this will work for functions like: int f() - { - return 2; - } - I.e. the bp will be inserted at the first open brace. - For functions where the body is only one line written like this: - int f() - { return 2; } - this will make the breakpoint to be at the last brace, after the body - has been executed already. What's the point of stepping through a function - without any variables anyway?? */ - - if ((SYMBOL_LINE (f) > 0) && (SYMBOL_LINE (f) < sal.line)) - return pc; /*no adjusment will be made */ - else - return sal.end; /* this is the end of the prologue */ - } - /* The line after the prologue is after the end of the function. In this - case, put the end of the prologue is the beginning of the function. */ - /* This should happen only when the function is prologueless and has no - code in it. For instance void dumb(){} Note: this kind of function - is used quite a lot in the test system */ + /* There are only two cases to consider. First, the end of the source line + is within the function bounds. In that case we return the end of the + source line. Second is the end of the source line extends beyond the + bounds of the current function. We need to use the slow code to + examine instructions in that case. + Anything else is simply a bug elsewhere. Fixing it here is absolutely + the wrong thing to do. In fact, it should be entirely possible for this + function to always return zero since the slow instruction scanning code + is supposed to *always* work. If it does not, then it is a bug. */ + if (sal.end < func_end) + return sal.end; else - return pc; /* no adjustment will be made */ + return 0; } /* To skip prologues, I use this predicate. Returns either PC itself @@ -3571,85 +3487,22 @@ hppa_skip_prologue (pc) CORE_ADDR post_prologue_pc; char buf[4]; -#ifdef GDB_TARGET_HAS_SHARED_LIBS - /* Silently return the unaltered pc upon memory errors. - This could happen on OSF/1 if decode_line_1 tries to skip the - prologue for quickstarted shared library functions when the - shared library is not yet mapped in. - Reading target memory is slow over serial lines, so we perform - this check only if the target has shared libraries. */ - if (target_read_memory (pc, buf, 4)) - return pc; -#endif - /* See if we can determine the end of the prologue via the symbol table. If so, then return either PC, or the PC after the prologue, whichever is greater. */ post_prologue_pc = after_prologue (pc); + /* If after_prologue returned a useful address, then use it. Else + fall back on the instruction skipping code. + + Some folks have claimed this causes problems because the breakpoint + may be the first instruction of the prologue. If that happens, then + the instruction skipping code has a bug that needs to be fixed. */ if (post_prologue_pc != 0) return max (pc, post_prologue_pc); - - - /* Can't determine prologue from the symbol table, (this can happen if there - is no debug information) so we need to fall back on the old code, which - looks at the instructions */ - /* FIXME (elz) !!!!: this may create a problem if, once the bp is hit, the user says - where: the backtrace info is not right: this is because the point at which we - break is at the very first instruction of the function. At this time the stuff that - needs to be saved on the stack, has not been saved yet, so the backtrace - cannot know all it needs to know. This will need to be fixed in the - actual backtrace code. (Note: this is what DDE does) */ - else return (skip_prologue_hard_way (pc)); - -#if 0 -/* elz: I am keeping this code around just in case, but remember, all the - instructions are for alpha: you should change all to the hppa instructions */ - - /* Can't determine prologue from the symbol table, need to examine - instructions. */ - - /* Skip the typical prologue instructions. These are the stack adjustment - instruction and the instructions that save registers on the stack - or in the gcc frame. */ - for (offset = 0; offset < 100; offset += 4) - { - int status; - - status = read_memory_nobpt (pc + offset, buf, 4); - if (status) - memory_error (status, pc + offset); - inst = extract_unsigned_integer (buf, 4); - - /* The alpha has no delay slots. But let's keep the lenient stuff, - we might need it for something else in the future. */ - if (lenient && 0) - continue; - - if ((inst & 0xffff0000) == 0x27bb0000) /* ldah $gp,n($t12) */ - continue; - if ((inst & 0xffff0000) == 0x23bd0000) /* lda $gp,n($gp) */ - continue; - if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ - continue; - else if ((inst & 0xfc1f0000) == 0xb41e0000 - && (inst & 0xffff0000) != 0xb7fe0000) - continue; /* stq reg,n($sp) */ - /* reg != $zero */ - else if ((inst & 0xfc1f0000) == 0x9c1e0000 - && (inst & 0xffff0000) != 0x9ffe0000) - continue; /* stt reg,n($sp) */ - /* reg != $zero */ - else if (inst == 0x47de040f) /* bis sp,sp,fp */ - continue; - else - break; - } - return pc + offset; -#endif /* 0 */ } /* Put here the code to store, into a struct frame_saved_regs, @@ -3750,7 +3603,7 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs) For unoptimized GCC code and for any HP CC code this will never ever examine any user instructions. - For optimzied GCC code we're faced with problems. GCC will schedule + For optimized GCC code we're faced with problems. GCC will schedule its prologue and make prologue instructions available for delay slot filling. The end result is user code gets mixed in with the prologue and a prologue instruction may be in the delay slot of the first branch diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index 585ba71920b..11e9d02c235 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -46,6 +46,9 @@ fetch_inferior_registers (regno) fetch_register (regno); } +/* Our own version of the offsetof macro, since we can't assume ANSI C. */ +#define HPPAH_OFFSETOF(type, member) ((int) (&((type *) 0)->member)) + /* Store our register values back into the inferior. If REGNO is -1, do this for all registers. Otherwise, REGNO specifies which register (so we can save time). */ @@ -62,42 +65,104 @@ store_inferior_registers (regno) if (regno >= 0) { + unsigned int addr, len, offset; + if (CANNOT_STORE_REGISTER (regno)) return; - regaddr = register_addr (regno, offset); - errno = 0; - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + + offset = 0; + len = REGISTER_RAW_SIZE (regno); + + /* Requests for register zero actually want the save_state's + ss_flags member. As RM says: "Oh, what a hack!" */ + if (regno == 0) { - scratch = *(int *) ®isters[REGISTER_BYTE (regno)] | 0x3; - call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - scratch); + save_state_t ss; + addr = HPPAH_OFFSETOF (save_state_t, ss_flags); + len = sizeof (ss.ss_flags); + + /* Note that ss_flags is always an int, no matter what + REGISTER_RAW_SIZE(0) says. Assuming all HP-UX PA machines + are big-endian, put it at the least significant end of the + value, and zap the rest of the buffer. */ + offset = REGISTER_RAW_SIZE (0) - len; + } + + /* Floating-point registers come from the ss_fpblock area. */ + else if (regno >= FP0_REGNUM) + addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock) + + (REGISTER_BYTE (regno) - REGISTER_BYTE (FP0_REGNUM))); + + /* Wide registers come from the ss_wide area. + I think it's more PC to test (ss_flags & SS_WIDEREGS) to select + between ss_wide and ss_narrow than to use the raw register size. + But checking ss_flags would require an extra ptrace call for + every register reference. Bleah. */ + else if (len == 8) + addr = (HPPAH_OFFSETOF (save_state_t, ss_wide) + + REGISTER_BYTE (regno)); + + /* Narrow registers come from the ss_narrow area. Note that + ss_narrow starts with gr1, not gr0. */ + else if (len == 4) + addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow) + + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); + else + internal_error ("hppah-nat.c (write_register): unexpected register size"); + +#ifdef GDB_TARGET_IS_HPPA_20W + /* Unbelieveable. The PC head and tail must be written in 64bit hunks + or we will get an error. Worse yet, the oddball ptrace/ttrace + layering will not allow us to perform a 64bit register store. + + What a crock. */ + if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM && len == 8) + { + CORE_ADDR temp; + + temp = *(CORE_ADDR *)®isters[REGISTER_BYTE (regno)]; + + /* Set the priv level (stored in the low two bits of the PC. */ + temp |= 0x3; + + ttrace_write_reg_64 (inferior_pid, (CORE_ADDR)addr, (CORE_ADDR)&temp); + + /* If we fail to write the PC, give a true error instead of + just a warning. */ if (errno != 0) { - /* Error, even if attached. Failing to write these two - registers is pretty serious. */ - sprintf (buf, "writing register number %d", regno); - perror_with_name (buf); + char *err = safe_strerror (errno); + char *msg = alloca (strlen (err) + 128); + sprintf (msg, "writing `%s' register: %s", + REGISTER_NAME (regno), err); + perror_with_name (msg); } + return; } - else - for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - errno = 0; - call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(int *) ®isters[REGISTER_BYTE (regno) + i]); - if (errno != 0) - { - /* Warning, not error, in case we are attached; sometimes the - kernel doesn't let us at the registers. */ - char *err = safe_strerror (errno); - char *msg = alloca (strlen (err) + 128); - sprintf (msg, "writing register %s: %s", - REGISTER_NAME (regno), err); +#endif + + for (i = 0; i < len; i += sizeof (int)) + { + errno = 0; + call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) addr + i, + *(int *) ®isters[REGISTER_BYTE (regno) + i]); + if (errno != 0) + { + /* Warning, not error, in case we are attached; sometimes + the kernel doesn't let us at the registers. */ + char *err = safe_strerror (errno); + char *msg = alloca (strlen (err) + 128); + sprintf (msg, "reading `%s' register: %s", + REGISTER_NAME (regno), err); + /* If we fail to write the PC, give a true error instead of + just a warning. */ + if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + perror_with_name (msg); + else warning (msg); - return; - } - regaddr += sizeof (int); - } + return; + } + } } else for (regno = 0; regno < NUM_REGS; regno++) @@ -105,9 +170,6 @@ store_inferior_registers (regno) } -/* Our own version of the offsetof macro, since we can't assume ANSI C. */ -#define HPPAH_OFFSETOF(type, member) ((int) (&((type *) 0)->member)) - /* Fetch a register's value from the process's U area. */ static void fetch_register (regno) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index babae1c6a07..d0363e6dcea 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -931,9 +931,6 @@ set_disassembly_flavor_sfunc (args, from_tty, c) struct cmd_list_element *c; { set_disassembly_flavor (); - - if (disassembly_flavor_hook != NULL) - disassembly_flavor_hook (args, from_tty); } static void diff --git a/gdb/infrun.c b/gdb/infrun.c index 5d7fd76b72f..0ddb8f2613f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3088,7 +3088,7 @@ complete_execution (void) target_executing = 0; if (sync_execution) { - add_file_handler (input_fd, (file_handler_func *) call_readline, 0); + add_file_handler (input_fd, call_readline, 0); pop_prompt (); sync_execution = 0; cleanup_sigint_signal_handler (); diff --git a/gdb/infttrace.c b/gdb/infttrace.c index c76c5132201..3e94e8100b5 100644 --- a/gdb/infttrace.c +++ b/gdb/infttrace.c @@ -5863,6 +5863,55 @@ hppa_resume_execd_vforking_child_to_get_parent_vfork () } +/* Write a register as a 64bit value. This may be necessary if the + native OS is too braindamaged to allow some (or all) registers to + be written in 32bit hunks such as hpux11 and the PC queue registers. + + This is horribly gross and disgusting. */ + +int +ttrace_write_reg_64 (gdb_tid, dest_addr, src_addr) + int gdb_tid; + CORE_ADDR dest_addr; + CORE_ADDR src_addr; +{ + pid_t pid; + lwpid_t tid; + int tt_status; + + tid = map_from_gdb_tid (gdb_tid); + pid = get_pid_for (tid); + + errno = 0; + tt_status = ttrace (TT_LWP_WUREGS, + pid, + tid, + (TTRACE_ARG_TYPE) dest_addr, + 8, + (TTRACE_ARG_TYPE) src_addr ); + +#ifdef THREAD_DEBUG + if (errno) + { + /* Don't bother for a known benign error: if you ask for the + first thread state, but there is only one thread and it's + not stopped, ttrace complains. + + We have this inside the #ifdef because our caller will do + this check for real. */ + if( request != TT_PROC_GET_FIRST_LWP_STATE + || errno != EPROTO ) + { + if( debug_on ) + printf( "TT fail for %s, with pid %d, tid %d, status %d \n", + get_printable_name_of_ttrace_request (TT_LWP_WUREGS), + pid, tid, tt_status ); + } + } +#endif + + return tt_status; +} void _initialize_infttrace () diff --git a/gdb/kod-cisco.c b/gdb/kod-cisco.c index b33b9e58d8d..c5be81ade93 100644 --- a/gdb/kod-cisco.c +++ b/gdb/kod-cisco.c @@ -43,8 +43,7 @@ static void (*gdb_kod_query) (char *, char *, int *); displaying output (presumably to the user) and the other for querying the target. */ char * -cisco_kod_open (char *arg, - void (*display_func) (char *), +cisco_kod_open (void (*display_func) (char *), void (*query_func) (char *, char *, int *)) { char buffer[PBUFSIZ]; diff --git a/gdb/maint.c b/gdb/maint.c index 4ec051ad991..10cf6bbde5f 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -45,6 +45,8 @@ static void maintenance_command PARAMS ((char *, int)); static void maintenance_dump_me PARAMS ((char *, int)); +static void maintenance_internal_error PARAMS ((char *args, int from_tty)); + static void maintenance_demangle PARAMS ((char *, int)); static void maintenance_time_display PARAMS ((char *, int)); @@ -99,12 +101,29 @@ maintenance_dump_me (args, from_tty) { if (query ("Should GDB dump core? ")) { +#ifdef __DJGPP__ + /* SIGQUIT by default is ignored, so use SIGABRT instead. */ + signal (SIGABRT, SIG_DFL); + kill (getpid (), SIGABRT); +#else signal (SIGQUIT, SIG_DFL); kill (getpid (), SIGQUIT); +#endif } } #endif +/* Stimulate the internal error mechanism that GDB uses when an + internal problem is detected. Allows testing of the mechanism. + Also useful when the user wants to drop a core file but not exit + GDB. */ + +static void +maintenance_internal_error (char *args, int from_tty) +{ + internal_error ("internal maintenance"); +} + /* Someday we should allow demangling for things other than just explicit strings. For example, we might want to be able to specify the address of a string in either GDB's process space @@ -378,6 +397,11 @@ itself a SIGQUIT signal.", &maintenancelist); #endif + add_cmd ("internal-error", class_maintenance, maintenance_internal_error, + "Give GDB an internal error.\n\ +Cause GDB to behave as if an internal error was detected.", + &maintenancelist); + add_cmd ("demangle", class_maintenance, maintenance_demangle, "Demangle a C++ mangled name.\n\ Call internal GDB demangler routine to demangle a C++ link name\n\ diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 123c2308f74..a763a66d5d4 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1003,3 +1003,23 @@ in_plt_section (pc, name) && STREQ (s->the_bfd_section->name, ".plt")); return (retval); } + +/* Return nonzero if NAME is in the import list of OBJFILE. Else + return zero. */ + +int +is_in_import_list (name, objfile) + char *name; + struct objfile *objfile; +{ + register int i; + + if (!objfile || !name || !*name) + return 0; + + for (i = 0; i < objfile->import_list_size; i++) + if (objfile->import_list[i] && STREQ (name, objfile->import_list[i])) + return 1; + return 0; +} + diff --git a/gdb/objfiles.h b/gdb/objfiles.h index f6fe03ca533..f59feb2c7d3 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -515,6 +515,9 @@ extern struct obj_section * extern int in_plt_section PARAMS ((CORE_ADDR, char *)); +extern int +is_in_import_list PARAMS ((char *, struct objfile *)); + /* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete the objfile during the traversal. */ diff --git a/gdb/remote.c b/gdb/remote.c index 5b967052503..263e20b4c51 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1852,7 +1852,7 @@ serial device is attached to the remote system (e.g. /dev/ttya)."); file descriptor, the event loop will call fetch_inferior_event, which will do the proper analysis to determine what happened. */ if (async_p) - add_file_handler (remote_desc->fd, (file_handler_func *) fetch_inferior_event, 0); + add_file_handler (remote_desc->fd, fetch_inferior_event, 0); push_target (target); /* Switch to using remote target now */ @@ -3860,7 +3860,7 @@ extended_remote_async_create_inferior (exec_file, args, env) /* If running asynchronously, register the target file descriptor with the event loop. */ if (async_p) - add_file_handler (remote_desc->fd, (file_handler_func *) fetch_inferior_event, 0); + add_file_handler (remote_desc->fd, fetch_inferior_event, 0); /* Now restart the remote server. */ extended_remote_restart (); @@ -4354,6 +4354,10 @@ remote_rcmd (char *command, if (!remote_desc) error ("remote rcmd is only available after target open"); + /* Send a NULL command across as an empty command */ + if (command == NULL) + command = ""; + /* The query prefix */ strcpy (buf, "qRcmd,"); p = strchr (buf, '\0'); @@ -4387,6 +4391,11 @@ remote_rcmd (char *command, } if (strcmp (buf, "OK") == 0) break; + if (strlen (buf) == 3 && buf[0] == 'E' + && isdigit (buf[1]) && isdigit (buf[2])) + { + error ("Protocol error with Rcmd"); + } for (p = buf; p[0] != '\0' && p[1] != '\0'; p += 2) { char c = (fromhex (p[0]) << 4) + fromhex (p[1]); diff --git a/gdb/somread.c b/gdb/somread.c index 861f34d7549..55092b8955a 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -482,34 +482,6 @@ som_symfile_offsets (objfile, addr) return section_offsets; } - - -/* Check if a given symbol NAME is in the import list - of OBJFILE. - 1 => true, 0 => false - This is used in hp_symtab_read.c to deal with static variables - that are defined in a different shared library than the one - whose symbols are being processed. */ - -int -is_in_import_list (name, objfile) - char *name; - struct objfile *objfile; -{ - register int i; - - if (!objfile || - !name || - !*name) - return 0; - - for (i = 0; i < objfile->import_list_size; i++) - if (objfile->import_list[i] && STREQ (name, objfile->import_list[i])) - return 1; - return 0; -} - - /* Read in and initialize the SOM import list which is present for all executables and shared libraries. The import list consists of the symbols that are referenced in OBJFILE but diff --git a/gdb/source.c b/gdb/source.c index 928782cc913..3e36b1df889 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1,6 +1,5 @@ /* List lines of source files for GDB, the GNU debugger. - Copyright 1986, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 1998 - Free Software Foundation, Inc. + Copyright 1986-1989, 1991-1999 Free Software Foundation, Inc. This file is part of GDB. @@ -339,15 +338,17 @@ mod_path (dirname, which_path) } } -#ifndef _WIN32 - /* On win32 h:\ is different to h: */ - if (SLASH_P (p[-1])) + if (!(SLASH_P (*name) && p <= name + 1) /* "/" */ +#if defined(_WIN32) || defined(__MSDOS__) + /* On MS-DOS and MS-Windows, h:\ is different from h: */ + && !(!SLASH_P (*name) && ROOTED_P (name) && p <= name + 3) /* d:/ */ +#endif + && SLASH_P (p[-1])) /* Sigh. "foo/" => "foo" */ --p; -#endif *p = '\0'; - while (p[-1] == '.') + while (p > name && p[-1] == '.') { if (p - name == 1) { @@ -355,7 +356,7 @@ mod_path (dirname, which_path) name = current_directory; goto append; } - else if (SLASH_P (p[-2])) + else if (p > name + 1 && SLASH_P (p[-2])) { if (p - name == 2) { @@ -377,6 +378,10 @@ mod_path (dirname, which_path) if (name[0] == '~') name = tilde_expand (name); +#if defined(_WIN32) || defined(__MSDOS__) + else if (ROOTED_P (name) && p == name + 2) /* "d:" => "d:." */ + name = concat (name, ".", NULL); +#endif else if (!ROOTED_P (name) && name[0] != '$') name = concat (current_directory, SLASH_STRING, name, NULL); else @@ -412,6 +417,14 @@ mod_path (dirname, which_path) p = *which_path; while (1) { + /* FIXME: strncmp loses in interesting ways on MS-DOS and + MS-Windows because of case-insensitivity and two different + but functionally identical slash characters. We need a + special filesystem-dependent file-name comparison function. + + Actually, even on Unix I would use realpath() or its work- + alike before comparing. Then all the code above which + removes excess slashes and dots could simply go away. */ if (!strncmp (p, name, len) && (p[len] == '\0' || p[len] == DIRNAME_SEPARATOR)) { @@ -606,8 +619,7 @@ done: /* Beware the // my son, the Emacs barfs, the botch that catch... */ *filename_opened = concat (current_directory, - SLASH_CHAR - == current_directory[strlen (current_directory) - 1] + SLASH_P (current_directory[strlen (current_directory) - 1]) ? "" : SLASH_STRING, filename, NULL); } @@ -1515,6 +1527,16 @@ forward_search_command (regex, from_tty) } while (c != '\n' && (c = getc (stream)) >= 0); +#ifdef CRLF_SOURCE_FILES + /* Remove the \r, if any, at the end of the line, otherwise + regular expressions that end with $ or \n won't work. */ + if (p - buf > 1 && p[-2] == '\r') + { + p--; + p[-1] = '\n'; + } +#endif + /* we now have a source line in buf, null terminate and match */ *p = 0; if (re_exec (buf) > 0) @@ -1615,6 +1637,16 @@ reverse_search_command (regex, from_tty) } while (c != '\n' && (c = getc (stream)) >= 0); +#ifdef CRLF_SOURCE_FILES + /* Remove the \r, if any, at the end of the line, otherwise + regular expressions that end with $ or \n won't work. */ + if (p - buf > 1 && p[-2] == '\r') + { + p--; + p[-1] = '\n'; + } +#endif + /* We now have a source line in buf; null terminate and match. */ *p = 0; if (re_exec (buf) > 0) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 52b22f12158..98f377a88f8 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -194,6 +194,8 @@ static CORE_ADDR static int resolve_symbol_reference PARAMS ((struct objfile *, struct symbol *, char *)); +void stabsread_clear_cache PARAMS ((void)); + static const char vptr_name[] = {'_', 'v', 'p', 't', 'r', CPLUS_MARKER, '\0'}; static const char vb_name[] = @@ -1192,6 +1194,16 @@ static int ref_count = 0; /* Number of chunks malloced. */ static int ref_chunk = 0; +/* This file maintains a cache of stabs aliases found in the symbol + table. If the symbol table changes, this cache must be cleared + or we are left holding onto data in invalid obstacks. */ +void +stabsread_clear_cache () +{ + ref_count = 0; + ref_chunk = 0; +} + /* Create array of pointers mapping refids to symbols and stab strings. Add pointers to reference definition symbols and/or their values as we find them, using their reference numbers as our index. @@ -4710,7 +4722,7 @@ read_range_type (pp, typenums, objfile) return init_type (TYPE_CODE_INT, -n3, TYPE_FLAG_UNSIGNED, NULL, objfile); - /* Is n3 == 2**(8n))-1 for some integer n? Then it's an + /* Is n3 == 2**(8n)-1 for some integer n? Then it's an unsigned n-byte integer. But do require n to be a power of two; we don't want 3- and 5-byte integers flying around. */ { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7d31fa831ff..4b0a6238a7d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,31 @@ +1999-08-13 Keith Seitz + + * gdb.base/dbx.exp (dbx_gdb_file_cmd): Rename to gdb_file_cmd. + (dbx_gdb_load): Remove. Use gdb_load instead, since that + proc knows about targets other than the natives. + (test_assign): Use "gdb_run_cmd" to "run" the target. + Check that we've actually hit the breakpoint at main. + When we attempt to assign a value to a local variable, check + that the variable is in the current scope, i.e., don't use + a test with an empty result. + +Tue Aug 10 15:25:16 1999 Andrew Cagney + + * gdb.base/maint.exp: Add test of ``maintenance internal-error'' + command. + +1999-08-09 Stan Shebs + + From Jimmy Guo and others at HP: + gdb.hp: Move tests into subdirectories gdb.aCC, gdb.base-hp, + gdb.compat, gdb.threads-hp. + gdb.hp/configure, gdb.hp/configure.in: New files. + gdb.hp/Makefile.in: Recurse into new subdirs. + gdb.hp/gdb.defects: New directory, tests for HP bug reports. + gdb.hp/gdb.objdbg: New directory, tests for debugging info + in object files. + gdb.hp/tools: New directory, aux tools for HP-specific tests. + 1999-08-05 Stan Shebs * gdb.base/display.exp: Help expect by putting a newline in the diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp index 05f3fe492b2..092b31ace71 100644 --- a/gdb/testsuite/gdb.base/dbx.exp +++ b/gdb/testsuite/gdb.base/dbx.exp @@ -160,7 +160,15 @@ proc dbx_reinitialize_dir { subdir } { # of this command returns, causing the test to get out of sync and fail # seemingly randomly or only on a loaded system. # -proc dbx_gdb_file_cmd {arg } { +# Problem is, though, that the testsuite config files can override the definition of +# gdb_load (without notice, as was mentioned above). Unfortunately, the gdb_load proc +# that was copied into this test was a copy of the unix native version. +# +# The real problem that we're attempting to solve is how to load an exec and symbol +# file into gdb for a dbx session. So why not just override gdb_file_cmd with the +# right sequence of events, allowing gdb_load to do its normal thing? This way +# remotes and simulators will work, too. +proc gdb_file_cmd {arg} { global verbose global loadpath global loadfile @@ -169,6 +177,14 @@ proc dbx_gdb_file_cmd {arg } { global spawn_id upvar timeout timeout + if [is_remote host] { + set arg [remote_download host $arg]; + if { $arg == "" } { + error "download failed" + return -1; + } + } + send_gdb "symbol-file $arg\n" gdb_expect { -re "Detected 64-bit symbol file.\r\nInvoking.*gdb64.*$gdb_prompt $" { @@ -245,17 +261,6 @@ proc dbx_gdb_file_cmd {arg } { } } -proc dbx_gdb_load { arg } { - global verbose - global loadpath - global loadfile - global GDB - global prompt - upvar timeout timeout - - return [dbx_gdb_file_cmd $arg] -} - # #test_breakpoints # @@ -271,8 +276,22 @@ proc test_breakpoints { } { #test_assign # proc test_assign { } { - gdb_test "run" "" - gdb_test "assign first=1" "" + global decimal + global gdb_prompt + + gdb_run_cmd + gdb_expect 30 { + -re "Break.* at .*:$decimal.*$gdb_prompt $" { pass "running to main" } + -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" { pass "running to main" } + -re "$gdb_prompt $" { fail "running to main" } + timeout { fail "running to main (timeout)" } + } + send_gdb "assign first=1\n" + gdb_expect { + -re "No symbol \"first\" in current context.*$" { fail "assign first" } + "$gdb_prompt $" { pass "assign first" } + timeout { fail "assign first (timeout)" } + } gdb_test "print first" ".1 = 1" } @@ -304,7 +323,7 @@ set saved_gdbflags $GDBFLAGS set GDBFLAGS "$GDBFLAGS --dbx" gdb_start dbx_reinitialize_dir $srcdir/$subdir -dbx_gdb_load ${binfile} +gdb_load ${binfile} test_breakpoints test_assign diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index b1f7c53f28d..4c64b973563 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -31,6 +31,7 @@ #maintenance dump-me -- Get fatal error; make debugger dump its core #maintenance print -- Maintenance command for printing GDB internal state #maintenance info -- Commands for showing internal info about the program being debugged +#maintenance internal-error -- Give GDB an internal error. # #maintenance print statistics -- Print statistics about internal gdb state #maintenance print objfiles -- Print dump of current object file definitions @@ -442,7 +443,7 @@ set timeout $oldtimeout send_gdb "help maint\n" gdb_expect { - -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\ + -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\ { pass "help maint" } -re ".*$gdb_prompt $" { fail "help maint" } timeout { fail "(timeout) help maint" } @@ -489,6 +490,14 @@ gdb_expect { timeout { fail "(timeout) help maint dump-me" } } +send_gdb "help maint internal-error\n" +gdb_expect { + -re "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*$gdb_prompt $"\ + { pass "help maint internal-error" } + -re ".*$gdb_prompt $" { fail "help maint internal-error" } + timeout { fail "(timeout) help maint internal-error" } + } + send_gdb "help maint print statistics\n" gdb_expect { -re "Print statistics about internal gdb state\\..*$gdb_prompt $"\ @@ -612,6 +621,38 @@ gdb_expect { timeout { fail "(timeout) maint dump-me" } } +send_gdb "maint internal-error\n" +gdb_expect { + -re "Continue this debugging session.*\\(y or n\\) $" { + send_gdb "y\n" + gdb_expect { + -re "Create a core file.*\\(y or n\\) $" { + send_gdb "n\n" + gdb_expect { + -re ".*$gdb_prompt $" { + pass "maint internal-error" + } + timeout { + fail "(timeout) maint internal-error" + } + } + } + -re ".*$gdb_prompt $" { + fail "maint internal-error" + } + timeout { + fail "(timeout) maint internal-error" + } + } + } + -re ".*$gdb_prompt $" { + fail "maint internal-error" + } + timeout { + fail "(timeout) maint internal-error" + } +} + #set timeout $oldtimeout diff --git a/gdb/testsuite/gdb.hp/Makefile.in b/gdb/testsuite/gdb.hp/Makefile.in index d65fc75e222..2a1a9df175b 100644 --- a/gdb/testsuite/gdb.hp/Makefile.in +++ b/gdb/testsuite/gdb.hp/Makefile.in @@ -1,25 +1,44 @@ VPATH = @srcdir@ srcdir = @srcdir@ -PROGS = ambiguous ctti-add exception gen-so-thresh namespace \ - optimize pxdb so-thresh templ-hp watch-hp xdb +SUBDIRS = @subdirs@ -MISCELLANEOUS = \ - lib00-so-thresh.c lib00-so-thresh.sl \ - lib01-so-thresh.c lib01-so-thresh.sl \ - lib02-so-thresh.c lib02-so-thresh.sl \ - so-thresh.c so-thresh.linkopts - -all: +all: @echo "Nothing to be done for all..." -#### host, target, and site specific Makefile frags come in here. +info: +install-info: +dvi: +install: +uninstall: force +installcheck: +check: clean mostlyclean: - -rm -f *.ci *.o $(OBJS) $(PROGS) $(MISCELLANEOUS) *~ core + -rm -f *~ core *.o + if [ x"${SUBDIRS}" != x ] ; then \ + for dir in ${SUBDIRS}; \ + do \ + echo "$$dir:"; \ + if [ -d $$dir ]; then \ + (cd $$dir; $(MAKE) clean); \ + fi; \ + done ; \ + else true; fi distclean maintainer-clean realclean: clean -rm -f Makefile config.status config.log + -rm -f *-init.exp + -rm -fr *.log summary detail *.plog *.sum *.psum site.* + if [ x"${SUBDIRS}" != x ] ; then \ + for dir in ${SUBDIRS}; \ + do \ + echo "$$dir:"; \ + if [ -d $$dir ]; then \ + (cd $$dir; $(MAKE) distclean); \ + fi; \ + done ; \ + else true; fi Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in $(SHELL) ./config.status --recheck diff --git a/gdb/top.c b/gdb/top.c index 40955abe63d..2c5edceb543 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -445,9 +445,6 @@ void (*registers_changed_hook) PARAMS ((void)); that several registers have changed (see value_assign). */ void (*register_changed_hook) PARAMS ((int regno)); -/* Tell the GUI that the disassembly flavor has changed */ -void (*disassembly_flavor_hook) PARAMS((char *args, int from_tty)); - /* Tell the GUI someone changed LEN bytes of memory at ADDR */ void (*memory_changed_hook) PARAMS ((CORE_ADDR addr, int len)); diff --git a/gdb/utils.c b/gdb/utils.c index 58cefdf2675..314a8310b45 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -498,6 +498,8 @@ internal_error (char *string, ...) static char msg[] = "Internal GDB error: recursive internal error.\n"; static int dejavu = 0; va_list args; + int continue_p; + int dump_core_p; /* don't allow infinite error recursion. */ switch (dejavu) @@ -516,16 +518,38 @@ internal_error (char *string, ...) } /* Try to get the message out */ - fputs_unfiltered ("\nGDB-INTERNAL-ERROR: ", gdb_stderr); + fputs_unfiltered ("gdb-internal-error: ", gdb_stderr); va_start (args, string); vfprintf_unfiltered (gdb_stderr, string, args); va_end (args); fputs_unfiltered ("\n", gdb_stderr); - if (query ("\ -An internal GDB error has been detected.\n\ -Do you want to quit GDB (dumping core)? ")) - abort (); + /* Default (no case) is to quit GDB. When in batch mode this + lessens the likelhood of GDB going into an infinate loop. */ + continue_p = query ("\ +An internal GDB error was detected. This may make make further\n\ +debugging unreliable. Continue this debugging session? "); + + /* Default (no case) is to not dump core. Lessen the chance of GDB + leaving random core files around. */ + dump_core_p = query ("\ +Create a core file containing the current state of GDB? "); + + if (continue_p) + { + if (dump_core_p) + { + if (fork () == 0) + abort (); + } + } + else + { + if (dump_core_p) + abort (); + else + exit (1); + } dejavu = 0; return_to_top_level (RETURN_ERROR); @@ -650,6 +674,11 @@ quit () if (quit_pre_print) fprintf_unfiltered (gdb_stderr, quit_pre_print); +#ifdef __MSDOS__ + /* No steenking SIGINT will ever be coming our way when the + program is resumed. Don't lie. */ + fprintf_unfiltered (gdb_stderr, "Quit\n"); +#else if (job_control /* If there is no terminal switching for this target, then we can't possibly get screwed by the lack of job control. */ @@ -658,36 +687,12 @@ quit () else fprintf_unfiltered (gdb_stderr, "Quit (expect signal SIGINT when the program is resumed)\n"); +#endif return_to_top_level (RETURN_QUIT); } -#if defined(__GO32__) - -/* In the absence of signals, poll keyboard for a quit. - Called from #define QUIT pollquit() in xm-go32.h. */ - -void -notice_quit () -{ - if (kbhit ()) - switch (getkey ()) - { - case 1: - quit_flag = 1; - break; - case 2: - immediate_quit = 2; - break; - default: - /* We just ignore it */ - /* FIXME!! Don't think this actually works! */ - fprintf_unfiltered (gdb_stderr, "CTRL-A to quit, CTRL-B to quit harder\n"); - break; - } -} - -#elif defined(_MSC_VER) /* should test for wingdb instead? */ +#if defined(_MSC_VER) /* should test for wingdb instead? */ /* * Windows translates all keyboard and mouse events diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 71d8efd5809..eaac180454a 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -323,7 +323,7 @@ handle_load_dll (PTR dummy) DWORD dll_name_ptr; DWORD done; char dll_buf[MAX_PATH + 1]; - char *p, *dll_name = NULL, *dll_basename; + char *p, *dll_name = NULL; struct objfile *objfile; MEMORY_BASIC_INFORMATION minfo; @@ -411,28 +411,6 @@ handle_load_dll (PTR dummy) while ((p = strchr (dll_name, '\\'))) *p = '/'; - /* FIXME!! It would be nice to define one symbol which pointed to the - front of the dll if we can't find any symbols. */ - - if (!(dll_basename = strrchr (dll_name, '/'))) - dll_basename = dll_name; - else - dll_basename++; - - ALL_OBJFILES (objfile) - { - char *objfile_basename; - objfile_basename = strrchr (objfile->name, '/'); - - if (objfile_basename && - strcmp (dll_basename, objfile_basename + 1) == 0) - { - printf_unfiltered ("%x:%s (symbols previously loaded)\n", - event->lpBaseOfDll, dll_name); - goto out; - } - } - /* The symbols in a dll are offset by 0x1000, which is the the offset from 0 of the first byte in an image - because of the file header and the section alignment. @@ -443,7 +421,6 @@ handle_load_dll (PTR dummy) symbol_file_add (dll_name, 0, (int) event->lpBaseOfDll + 0x1000, 0, 0, 0, 0, 1); printf_unfiltered ("\n"); -out: return 1; } -- cgit v1.2.1