diff options
author | Jason Molenda <jsm@bugshack.cygnus.com> | 2000-01-18 00:55:13 +0000 |
---|---|---|
committer | Jason Molenda <jsm@bugshack.cygnus.com> | 2000-01-18 00:55:13 +0000 |
commit | 3737fc11419f15ae6e62cc9bfbc045e70b6b4e4d (patch) | |
tree | bd191e1f9d4f39010488623b3f0da4fafd4e6c11 /gdb | |
parent | fc40d2f38bbc9727fca36b079b035400de581f7a (diff) | |
download | gdb-3737fc11419f15ae6e62cc9bfbc045e70b6b4e4d.tar.gz |
import gdb-2000-01-17 snapshot
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 79 | ||||
-rw-r--r-- | gdb/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/config/sparc/tm-sun4sol2.h | 2 | ||||
-rwxr-xr-x | gdb/configure | 34 | ||||
-rw-r--r-- | gdb/configure.in | 8 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 22 | ||||
-rw-r--r-- | gdb/event-top.c | 2 | ||||
-rw-r--r-- | gdb/frame.h | 16 | ||||
-rw-r--r-- | gdb/i386-linux-nat.c | 2 | ||||
-rw-r--r-- | gdb/infrun.c | 16 | ||||
-rw-r--r-- | gdb/rdi-share/ardi.c | 13 | ||||
-rw-r--r-- | gdb/rdi-share/serdrv.c | 8 | ||||
-rw-r--r-- | gdb/remote-rdi.c | 2 | ||||
-rw-r--r-- | gdb/stack.c | 253 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/default.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/help.exp | 2 | ||||
-rw-r--r-- | gdb/thread.c | 28 | ||||
-rw-r--r-- | gdb/v850-tdep.c | 1 |
20 files changed, 333 insertions, 170 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ccd11123b75..dd46c8280f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,82 @@ +2000-01-17 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in (NEW_PROC_API): Fix Unixware-matching regexp. + Fix from Robert Lipe <robertl@sco.com>. + * configure: Regenerated. + +2000-01-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * stack.c (print_frame_info_base): Break up into the frame info + (location) printing part and the rest (source line printing). + (print_frame): New function. Take care of printing the location + information. + Update copyright. + + * infrun.c (normal_stop): Use enum values rather than integers for the + source_flag to be passed to show_and_print_stack_frame(). + Update copyright. + + * frame.h (print_what): New enum for 'source' argument to + print_frame_info_base(). Use this instead of obscure numbers. + Update copyright. + +Sun Jan 16 17:58:00 2000 David Taylor <taylor@texas.cygnus.com> + + * event-top.c (stdin_event_handler): call quit_command rather than + exit -- run cleanups, give target code a chance to say goodbye to + the target. Fixes bug where the inferior processes were left + around on Solaris (and probably elsewhere) by the testsuite. + +2000-01-14 Mark Salter <msalter@cygnus.com> + + * v850-tdep.c (v850_target_architecture_hook): Setup correct + machine id for disassembly. + +Thu Jan 13 23:34:17 EST 2000 Nicholas Duffek <nsd@cygnus.com> + + * uw-thread.c: Document libthread.so debugging interface. Minor + comment and formatting tweaks. + (DEBUG): #define as 0 instead of 1. + (CALL_BASE): Include function name in error msg. + (libthread_stub): Adjust inferior_pid after thread exit. + (uw_thread_create_inferior): Deactivate uw_thread_ops before + asking procfs_ops to create inferior. + (libthread_init): Don't return nonlocally on error. + +2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com> + + * rdi-share/ardi.c (negotiate_params): Fix initialization of static + variable. + +2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com> + + * remote-rdi.c (arm_rdi_open): Call arm-rdi-close() to make sure + both sides are on the same state. + +2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com> + + * rdi-share/serdrv.c (find_baud_rate): Fix entries for 57600 and + 115200 (minor syntax mistake). + +2000-01-12 Jim Blandy <jimb@cygnus.com> + + * config/sparc/tm-sun4sol2.h (MERGEPID): Provide a definition for + this here, to go along with the definitions of PIDGET and TIDGET. + +2000-01-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * thread.c (do_captured_thread_select): New function. Switch + current thread, safely from within catch_errors(). + (gdb_thread_select): New function. Switch threads safely. + (thread_command): Use gdb_thread_select(). + +2000-01-11 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Avoid linking -limagehlp unless it's a native build. + * configure: Regenerate. + * thread.cc (add_thread): Clear private data pointer here or suffer + strange behavior when it is checked for NULL later. + 2000-01-09 Christopher Faylor <cgf@cygnus.com> * win32nat.c (handle_exceptions): Handle various arithmetic exceptions. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 76574a5ab03..8ce6044fd75 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -229,7 +229,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 = 20000110 +VERSION = 20000117 DIST=gdb LINT=/usr/5bin/lint diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h index cc3abfcb6f2..e348f79d3b9 100644 --- a/gdb/config/sparc/tm-sun4sol2.h +++ b/gdb/config/sparc/tm-sun4sol2.h @@ -78,4 +78,4 @@ extern char *sunpro_static_transform_name PARAMS ((char *)); /* Macros to extract process id and thread id from a composite pid/tid */ #define PIDGET(pid) ((pid) & 0xffff) #define TIDGET(pid) (((pid) >> 16) & 0xffff) - +#define MERGEPID(pid, tid) (((tid) << 16) | (pid)) diff --git a/gdb/configure b/gdb/configure index 4d760959618..6e456d71264 100755 --- a/gdb/configure +++ b/gdb/configure @@ -4181,7 +4181,7 @@ EOF EOF ;; - *-*-unixware* | *-*-sysv4.2uw2.* | *-*-sysv4.2uw7.*) + *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*) cat >> confdefs.h <<\EOF #define NEW_PROC_API 1 EOF @@ -5546,7 +5546,11 @@ fi # libreadline needs libuser32.a in a cygwin environment WIN32LIBS= if test x$gdb_cv_os_cygwin = xyes; then - WIN32LIBS="-luser32 -limagehlp" + WIN32LIBS="-luser32" + case "${target}" in + *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp" + ;; + esac fi @@ -5556,7 +5560,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:6767: checking for X" >&5 +echo "configure:6771: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5618,12 +5622,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 6829 "configure" +#line 6833 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6838: \"$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* @@ -5692,14 +5696,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 6903 "configure" +#line 6907 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:6910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6914: \"$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. @@ -5979,12 +5983,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:7261: checking for Cygwin environment" >&5 +echo "configure:7265: 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 <<EOF -#line 7266 "configure" +#line 7270 "configure" #include "confdefs.h" int main() { @@ -5995,7 +5999,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:7277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -6012,19 +6016,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:7294: checking for mingw32 environment" >&5 +echo "configure:7298: 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 <<EOF -#line 7299 "configure" +#line 7303 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:7306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -6043,7 +6047,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:7325: checking for executable suffix" >&5 +echo "configure:7329: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6053,7 +6057,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:7335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:7339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; diff --git a/gdb/configure.in b/gdb/configure.in index d967116761f..e8d6c3bcc8c 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -152,7 +152,7 @@ if test "${target}" = "${host}"; then AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2) AC_DEFINE(sys_quotactl) ;; - *-*-unixware* | *-*-sysv4.2uw2.* | *-*-sysv4.2uw7.*) + *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*) AC_DEFINE(NEW_PROC_API) ;; # FIXME: we would like to define NEW_PROC_API for all versions of @@ -488,7 +488,11 @@ AC_SUBST(TERM_LIB) # libreadline needs libuser32.a in a cygwin environment WIN32LIBS= if test x$gdb_cv_os_cygwin = xyes; then - WIN32LIBS="-luser32 -limagehlp" + WIN32LIBS="-luser32" + case "${target}" in + *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp" + ;; + esac fi AC_SUBST(WIN32LIBS) diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 30bef42a13b..d6aedaa57f1 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2000-01-16 Tom Tromey <tromey@cygnus.com> + + * gdb.texinfo (Breakpoints): Mention breakpoint ranges. + (Delete Breaks): Mention range arguments. + (Disabling): Likewise. + 2000-01-05 Dmitry Sivachenko <dima@Chg.RU> * gdb.texinfo: Wrap "ASCII" in @sc{}; clarify a few sentences. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 0f34d26c3de..63f33551d85 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2100,6 +2100,14 @@ breakpoint you want to change. Each breakpoint may be @dfn{enabled} or @dfn{disabled}; if disabled, it has no effect on your program until you enable it again. +@cindex breakpoint ranges +@cindex ranges of breakpoints +Some @value{GDBN} commands accept a range of breakpoints on which to +operate. A breakpoint range is either a single breakpoint number, like +@samp{5}, or two such numbers, in increasing order, separated by a +hyphen, like @samp{5-7}. When a breakpoint range is given to a command, +all breakpoint in that range are operated on. + @menu * Set Breaks:: Setting breakpoints * Set Watchpoints:: Setting watchpoints @@ -2633,9 +2641,9 @@ Delete any breakpoints set at or within the code of the specified line. @cindex delete breakpoints @kindex delete @kindex d -@item delete @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]} -Delete the breakpoints, watchpoints, or catchpoints of the numbers -specified as arguments. If no argument is specified, delete all +@item delete @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} +Delete the breakpoints, watchpoints, or catchpoints of the breakpoint +ranges specified as arguments. If no argument is specified, delete all breakpoints (@value{GDBN} asks confirmation, unless you have @code{set confirm off}). You can abbreviate this command as @code{d}. @end table @@ -2681,7 +2689,7 @@ watchpoints, and catchpoints: @kindex disable breakpoints @kindex disable @kindex dis -@item disable @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]} +@item disable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} Disable the specified breakpoints---or all breakpoints, if none are listed. A disabled breakpoint has no effect but is not forgotten. All options such as ignore-counts, conditions and commands are remembered in @@ -2690,15 +2698,15 @@ case the breakpoint is enabled again later. You may abbreviate @kindex enable breakpoints @kindex enable -@item enable @r{[}breakpoints@r{]} @r{[}@var{bnums}@dots{}@r{]} +@item enable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} Enable the specified breakpoints (or all defined breakpoints). They become effective once again in stopping your program. -@item enable @r{[}breakpoints@r{]} once @var{bnums}@dots{} +@item enable @r{[}breakpoints@r{]} once @var{range}@dots{} Enable the specified breakpoints temporarily. @value{GDBN} disables any of these breakpoints immediately after stopping your program. -@item enable @r{[}breakpoints@r{]} delete @var{bnums}@dots{} +@item enable @r{[}breakpoints@r{]} delete @var{range}@dots{} Enable the specified breakpoints to work once, then die. @value{GDBN} deletes any of these breakpoints as soon as your program stops there. @end table diff --git a/gdb/event-top.c b/gdb/event-top.c index cac492220b7..3d21a1a2b21 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -410,7 +410,7 @@ stdin_event_handler (int error, gdb_client_data client_data) delete_file_handler (input_fd); discard_all_continuations (); /* If stdin died, we may as well kill gdb. */ - exit (1); + quit_command ((char *) 0, stdin == instream); } else (*call_readline) (client_data); diff --git a/gdb/frame.h b/gdb/frame.h index ad329c5e776..0912205e6f6 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -1,5 +1,5 @@ /* Definitions for dealing with stack frames, for GDB, the GNU debugger. - Copyright 1986, 1989, 1991, 1992, 1999 Free Software Foundation, Inc. + Copyright 1986, 1989, 1991, 1992, 1999, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -99,6 +99,20 @@ struct frame_info struct frame_info *next, *prev; }; +/* Values for the source flag to be used in print_frame_info_base(). */ +enum print_what + { + /* Print only the source line, like in stepi. */ + SRC_LINE = -1, + /* Print only the location, i.e. level, address (sometimes) + function, args, file, line, line num. */ + LOCATION, + /* Print both of the above. */ + SRC_AND_LOC, + /* Print location only, but always include the address. */ + LOC_AND_ADDRESS + }; + /* Allocate additional space for appendices to a struct frame_info. */ #ifndef SIZEOF_FRAME_SAVED_REGS diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 2b350f07b2c..dddb218ba6a 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -146,7 +146,7 @@ fill_gregset (gregset_t *gregsetp, signed char valid[NUM_GREGS]; memset (valid, 0, sizeof (valid)); valid[regno] = 1; - convert_to_gregset (gregsetp, valid, valid); + convert_to_gregset (gregsetp, registers, valid); } } diff --git a/gdb/infrun.c b/gdb/infrun.c index be1e6c78105..549c515327f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1,5 +1,5 @@ /* Target-struct-independent code to start (run) and stop an inferior process. - Copyright 1986-1989, 1991-1999 Free Software Foundation, Inc. + Copyright 1986-1989, 1991-2000 Free Software Foundation, Inc. This file is part of GDB. @@ -3381,15 +3381,15 @@ The same program may be running in another process.\n"); if (stop_step && step_frame_address == FRAME_FP (get_current_frame ()) && step_start_function == find_pc_function (stop_pc)) - source_flag = -1; /* finished step, just print source line */ + source_flag = SRC_LINE; /* finished step, just print source line */ else - source_flag = 1; /* print location and source line */ + source_flag = SRC_AND_LOC; /* print location and source line */ break; case PRINT_SRC_AND_LOC: - source_flag = 1; /* print location and source line */ + source_flag = SRC_AND_LOC; /* print location and source line */ break; case PRINT_SRC_ONLY: - source_flag = -1; + source_flag = SRC_LINE; break; case PRINT_NOTHING: do_frame_printing = 0; @@ -3400,9 +3400,9 @@ The same program may be running in another process.\n"); /* The behavior of this routine with respect to the source flag is: - -1: Print only source line - 0: Print only location - 1: Print location and source line */ + SRC_LINE: Print only source line + LOCATION: Print only location + SRC_AND_LOC: Print location and source line */ if (do_frame_printing) show_and_print_stack_frame (selected_frame, -1, source_flag); diff --git a/gdb/rdi-share/ardi.c b/gdb/rdi-share/ardi.c index 3805352150a..f536ce3fc33 100644 --- a/gdb/rdi-share/ardi.c +++ b/gdb/rdi-share/ardi.c @@ -11,8 +11,8 @@ * Angel Remote Debug Interface * * - * $Revision: 1.6 $ - * $Date: 2000/01/05 11:22:21 $ + * $Revision: 1.7 $ + * $Date: 2000/01/12 17:26:37 $ * * This file is based on /plg/pisd/rdi.c, but instead of using RDP it uses * ADP messages. @@ -320,9 +320,12 @@ static AdpErrs negotiate_params( const ParameterOptions *user_options ) time_t t; - static volatile NegotiateState n_state = { - FALSE, FALSE, FALSE, &accepted_config }; - + static volatile NegotiateState n_state; + n_state.negotiate_resp = FALSE; + n_state.negotiate_ack = FALSE; + n_state.link_check_resp = FALSE; + n_state.accepted_config = &accepted_config; + #ifdef DEBUG angel_DebugPrint( "negotiate_params\n" ); #endif diff --git a/gdb/rdi-share/serdrv.c b/gdb/rdi-share/serdrv.c index a8e89ca4de5..a26e0ec91f0 100644 --- a/gdb/rdi-share/serdrv.c +++ b/gdb/rdi-share/serdrv.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.6 $ - * $Date: 2000/01/06 14:01:53 $ + * $Revision: 1.7 $ + * $Date: 2000/01/12 12:53:29 $ * * * serdrv.c - Synchronous Serial Driver for Angel. @@ -85,10 +85,10 @@ static struct writestate wstate; * The set of parameter options supported by the device */ static unsigned int baud_options[] = { -#ifdef B115200 || __hpux +#if defined(B115200) || defined(__hpux) 115200, #endif -#ifdef B57600 || __hpux +#if defined(B57600) || defined(__hpux) 57600, #endif 38400, 19200, 9600 diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c index 01433c82375..63c8d600aba 100644 --- a/gdb/remote-rdi.c +++ b/gdb/remote-rdi.c @@ -251,7 +251,7 @@ device is attached to the remote system (e.g. /dev/ttya)."); /* Make the basic low-level connection. */ - Adp_CloseDevice (); + arm_rdi_close (0); rslt = Adp_OpenDevice (devName, openArgs, rdi_heartbeat); if (rslt != adp_ok) diff --git a/gdb/stack.c b/gdb/stack.c index 52a7d9984b0..d344baba2f1 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1,5 +1,5 @@ /* Print and select stack frames for GDB, the GNU debugger. - Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 98, 1999 + Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 98, 1999, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -92,6 +92,12 @@ static int print_block_frame_locals PARAMS ((struct block *, int, GDB_FILE *)); +static void print_frame (struct frame_info *fi, + int level, + int source, + int args, + struct symtab_and_line sal); + static void print_frame_info_base PARAMS ((struct frame_info *, int, int, int)); static void print_stack_frame_base PARAMS ((struct frame_info *, int, int)); @@ -328,14 +334,14 @@ print_args_stub (args) } /* Print information about a frame for frame "fi" at level "level". - * Used in "where" output, also used to emit breakpoint or step messages. - * LEVEL is the level of the frame, or -1 if it is the innermost frame - * but we don't want to print the level. - * The meaning of the SOURCE argument is: - * -1: Print only source line - * 0: Print only location - * 1: Print location and source line - */ + Used in "where" output, also used to emit breakpoint or step + messages. + LEVEL is the level of the frame, or -1 if it is the + innermost frame but we don't want to print the level. + The meaning of the SOURCE argument is: + SRC_LINE: Print only source line + LOCATION: Print only location + LOC_AND_SRC: Print location and source line. */ static void print_frame_info_base (fi, level, source, args) @@ -345,9 +351,8 @@ print_frame_info_base (fi, level, source, args) int args; { struct symtab_and_line sal; - struct symbol *func; - register char *funname = 0; - enum language funlang = language_unknown; + int source_print; + int location_print; #if 0 char buf[MAX_REGISTER_RAW_SIZE]; @@ -406,6 +411,57 @@ print_frame_info_base (fi, level, source, args) && !fi->next->signal_handler_caller && !frame_in_dummy (fi->next)); + location_print = (source == LOCATION + || source == LOC_AND_ADDRESS + || source == SRC_AND_LOC); + + if (location_print || !sal.symtab) + print_frame (fi, level, source, args, sal); + + source_print = (source == SRC_LINE || source == SRC_AND_LOC); + + if (source_print && sal.symtab) + { + int done = 0; + int mid_statement = (source == SRC_LINE) && (fi->pc != sal.pc); + + if (annotation_level) + done = identify_source_line (sal.symtab, sal.line, mid_statement, + fi->pc); + if (!done) + { + if (addressprint && mid_statement && !tui_version) + { + print_address_numeric (fi->pc, 1, gdb_stdout); + printf_filtered ("\t"); + } + if (print_frame_info_listing_hook) + print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0); + else if (!tui_version) + print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); + } + current_source_line = max (sal.line - lines_to_list / 2, 1); + } + + if (source != 0) + set_default_breakpoint (1, fi->pc, sal.symtab, sal.line); + + annotate_frame_end (); + + gdb_flush (gdb_stdout); +} + +static void +print_frame (struct frame_info *fi, + int level, + int source, + int args, + struct symtab_and_line sal) +{ + struct symbol *func; + register char *funname = 0; + enum language funlang = language_unknown; + func = find_pc_function (fi->pc); if (func) { @@ -446,19 +502,17 @@ print_frame_info_base (fi, level, source, args) } else { - /* I'd like to use SYMBOL_SOURCE_NAME() here, to display - * the demangled name that we already have stored in - * the symbol table, but we stored a version with - * DMGL_PARAMS turned on, and here we don't want - * to display parameters. So call the demangler again, - * with DMGL_ANSI only. RT - * (Yes, I know that printf_symbol_filtered() will - * again try to demangle the name on the fly, but - * the issue is that if cplus_demangle() fails here, - * it'll fail there too. So we want to catch the failure - * ("demangled==NULL" case below) here, while we still - * have our hands on the function symbol.) - */ + /* I'd like to use SYMBOL_SOURCE_NAME() here, to display the + demangled name that we already have stored in the symbol + table, but we stored a version with DMGL_PARAMS turned + on, and here we don't want to display parameters. So call + the demangler again, with DMGL_ANSI only. (Yes, I know + that printf_symbol_filtered() will again try to demangle + the name on the fly, but the issue is that if + cplus_demangle() fails here, it'll fail there too. So we + want to catch the failure ("demangled==NULL" case below) + here, while we still have our hands on the function + symbol.) */ char *demangled; funname = SYMBOL_NAME (func); funlang = SYMBOL_LANGUAGE (func); @@ -466,10 +520,9 @@ print_frame_info_base (fi, level, source, args) { demangled = cplus_demangle (funname, DMGL_ANSI); if (demangled == NULL) - /* If the demangler fails, try the demangled name - * from the symbol table. This'll have parameters, - * but that's preferable to diplaying a mangled name. - */ + /* If the demangler fails, try the demangled name from + the symbol table. This'll have parameters, but + that's preferable to diplaying a mangled name. */ funname = SYMBOL_SOURCE_NAME (func); } } @@ -484,104 +537,76 @@ print_frame_info_base (fi, level, source, args) } } - if (source >= 0 || !sal.symtab) - { - annotate_frame_begin (level == -1 ? 0 : level, fi->pc); + annotate_frame_begin (level == -1 ? 0 : level, fi->pc); - if (level >= 0) - printf_filtered ("#%-2d ", level); - if (addressprint) - if (fi->pc != sal.pc || !sal.symtab) - { - annotate_frame_address (); - print_address_numeric (fi->pc, 1, gdb_stdout); - annotate_frame_address_end (); - printf_filtered (" in "); - } - annotate_frame_function_name (); - fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang, - DMGL_ANSI); + + if (level >= 0) + printf_filtered ("#%-2d ", level); + if (addressprint) + if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS) + { + annotate_frame_address (); + print_address_numeric (fi->pc, 1, gdb_stdout); + annotate_frame_address_end (); + printf_filtered (" in "); + } + annotate_frame_function_name (); + fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang, + DMGL_ANSI); + wrap_here (" "); + annotate_frame_args (); + + fputs_filtered (" (", gdb_stdout); + if (args) + { + struct print_args_args args; + args.fi = fi; + args.func = func; + args.stream = gdb_stdout; + catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL); + QUIT; + } + printf_filtered (")"); + if (sal.symtab && sal.symtab->filename) + { + annotate_frame_source_begin (); wrap_here (" "); - annotate_frame_args (); - fputs_filtered (" (", gdb_stdout); - if (args) - { - struct print_args_args args; - args.fi = fi; - args.func = func; - args.stream = gdb_stdout; - catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL); - QUIT; - } - printf_filtered (")"); - if (sal.symtab && sal.symtab->filename) - { - annotate_frame_source_begin (); - wrap_here (" "); - printf_filtered (" at "); - annotate_frame_source_file (); - printf_filtered ("%s", sal.symtab->filename); - annotate_frame_source_file_end (); - printf_filtered (":"); - annotate_frame_source_line (); - printf_filtered ("%d", sal.line); - annotate_frame_source_end (); - } + printf_filtered (" at "); + annotate_frame_source_file (); + printf_filtered ("%s", sal.symtab->filename); + annotate_frame_source_file_end (); + printf_filtered (":"); + annotate_frame_source_line (); + printf_filtered ("%d", sal.line); + annotate_frame_source_end (); + } #ifdef PC_LOAD_SEGMENT - /* If we couldn't print out function name but if can figure out what + /* If we couldn't print out function name but if can figure out what load segment this pc value is from, at least print out some info about its load segment. */ - if (!funname) - { - annotate_frame_where (); - wrap_here (" "); - printf_filtered (" from %s", PC_LOAD_SEGMENT (fi->pc)); - } -#endif -#ifdef PC_SOLIB - if (!funname || (!sal.symtab || !sal.symtab->filename)) - { - char *lib = PC_SOLIB (fi->pc); - if (lib) - { - annotate_frame_where (); - wrap_here (" "); - printf_filtered (" from %s", lib); - } - } -#endif - printf_filtered ("\n"); + if (!funname) + { + annotate_frame_where (); + wrap_here (" "); + printf_filtered (" from %s", PC_LOAD_SEGMENT (fi->pc)); } +#endif /* PC_LOAD_SEGMENT */ - if ((source != 0) && sal.symtab) +#ifdef PC_SOLIB + if (!funname || (!sal.symtab || !sal.symtab->filename)) { - int done = 0; - int mid_statement = source < 0 && fi->pc != sal.pc; - if (annotation_level) - done = identify_source_line (sal.symtab, sal.line, mid_statement, - fi->pc); - if (!done) + char *lib = PC_SOLIB (fi->pc); + if (lib) { - if (addressprint && mid_statement && !tui_version) - { - print_address_numeric (fi->pc, 1, gdb_stdout); - printf_filtered ("\t"); - } - if (print_frame_info_listing_hook) - print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0); - else if (!tui_version) - print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); + annotate_frame_where (); + wrap_here (" "); + printf_filtered (" from %s", lib); } - current_source_line = max (sal.line - lines_to_list / 2, 1); } +#endif /* PC_SOLIB */ - if (source != 0) - set_default_breakpoint (1, fi->pc, sal.symtab, sal.line); - - annotate_frame_end (); - - gdb_flush (gdb_stdout); + printf_filtered ("\n"); } diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5d44af639f1..27c1004655a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2000-01-17 Fernando Nasser <fnasser@totem.to.cygnus.com> + + * gdb.base/default.exp: Fix expected pattern. + * gdb.base/help.exp: Same. + 2000-01-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com> * gdb.base/so-indr-cl.exp: Don't execute the test if not on HPUX. diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 6d11effef49..8fcfc51055a 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -727,7 +727,7 @@ gdb_expect { if ![istarget "*-*-udi*"] then { send_gdb "target remote\n" gdb_expect { - -re "To open a remote debug connection, you need to specify what.*serial.*device is attached to the remote system .e.g. .*$gdb_prompt $"\ + -re "To open a remote debug connection, you need to specify what.*serial.*device is attached to the remote system.*.e.g. .*$gdb_prompt $"\ { pass "target remote" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp index 9c98c7279d1..c78bd893899 100644 --- a/gdb/testsuite/gdb.base/help.exp +++ b/gdb/testsuite/gdb.base/help.exp @@ -504,7 +504,7 @@ gdb_test "help target core" ".*Use a core file as a target.*Specify the filename # test help target exec gdb_test "help target exec" "Use an executable file as a target..*\[\r\n\]+Specify the filename of the executable file." "help target exec" # test help target remote -gdb_test "help target remote" "Use a remote computer via a serial line, using a gdb-specific protocol..*\[\r\n\]+Specify the serial device it is connected to .e.g. .*" "help target remote" +gdb_test "help target remote" "Use a remote computer via a serial line, using a gdb-specific protocol..*\[\r\n\]+Specify the serial device it is connected to.*\[\r\n\]+.e.g. .*" "help target remote" # test help target # the child process target may be "target child" or "target procfs" gdb_test "help target" "Connect to a target machine or process..*\[\r\n\]+The first argument is the type or protocol of the target machine..*\[\r\n\]+Remaining arguments are interpreted by the target protocol. For more.*\[\r\n\]+information on the arguments for a particular protocol, type.*\[\r\n\]+`help target ' followed by the protocol name..*\[\r\n\]+List of target subcommands:.*\[\r\n\]+target exec -- Use an executable file as a target.*\[\r\n\]+Type \"help target\" followed by target subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help target" diff --git a/gdb/thread.c b/gdb/thread.c index f4b57afc636..0ef9a76e325 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -106,6 +106,7 @@ add_thread (pid) tp->stepping_through_solib_catchpoints = NULL; tp->stepping_through_sigtramp = 0; tp->next = thread_list; + tp->private = NULL; thread_list = tp; return tp; } @@ -602,9 +603,6 @@ thread_command (tidstr, from_tty) char *tidstr; int from_tty; { - int num; - struct thread_info *tp; - if (!tidstr) { /* Don't generate an error, just say which thread is current. */ @@ -621,7 +619,17 @@ thread_command (tidstr, from_tty) error ("No stack."); return; } - num = atoi (tidstr); + + gdb_thread_select (tidstr); +} + +static int +do_captured_thread_select (void *tidstr) +{ + int num; + struct thread_info *tp; + + num = atoi ((char *)tidstr); tp = find_thread_id (num); @@ -634,9 +642,6 @@ see the IDs of currently known threads.", num); switch_to_thread (tp->pid); - if (context_hook) - context_hook (num); - printf_filtered ("[Switching to thread %d (%s)]\n", pid_to_thread_id (inferior_pid), #if defined(HPUXHPPA) @@ -645,7 +650,16 @@ see the IDs of currently known threads.", num); target_pid_to_str (inferior_pid) #endif ); + print_stack_frame (selected_frame, selected_frame_level, 1); + return GDB_RC_OK; +} + +enum gdb_rc +gdb_thread_select (char *tidstr) +{ + return catch_errors (do_captured_thread_select, tidstr, + NULL, RETURN_MASK_ALL); } /* Commands with a prefix of `thread'. */ diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 060200f7588..5f71b5e19d6 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -869,6 +869,7 @@ v850_target_architecture_hook (ap) if (v850_processor_type_table[i].mach == ap->mach) { v850_register_names = v850_processor_type_table[i].regnames; + tm_print_insn_info.mach = ap->mach; return 1; } } |