import gdb-1999-06-21 snapshot

This commit is contained in:
Jason Molenda
1999-06-21 13:27:42 +00:00
parent a8e53fb060
commit 9e0b60a847
18 changed files with 2891 additions and 110 deletions

View File

@ -1,3 +1,61 @@
1999-06-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* top.c: Move include of event-loop.h, to avoid redefinition of
NFDBITS.
* event-loop.c (create_file_handler): Do not do a realloc of the
pollfd structure of the notifier, unless there is already one.
Include <sys/types.h> for platforms that have no poll.
* event-top.c: Fix prototype for _initialize_event_loop.
(_initialize_event_loop): Do something only if running in async
mode.
1999-06-17 Jim Blandy <jimb@zwingli.cygnus.com>
Make the '/c' print format use a true character type. This is
more appropriate than builtin_type_char for languages other than
C, and C tolerates it.
* gdbtypes.c (builtin_type_true_char): New variable.
(build_gdbtypes): Initialize it.
* gdbtypes.h (builtin_type_true_char): New declaration.
* printcmd.c (print_scalar_formatted): When the format is 'c',
extract the value as a builtin_type_true_char.
* jv-exp.y (yylex): Say character literals are java_char_type, not
builtin_type_char. Java treats the latter like `byte'.
1999-06-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* Makefile.in (top_h): Define.
(event-loop.o): Add dependencies on top.h and defs.h.
(event-top.o): Add dependency on terminal.h.
* event-loop.c: Get rid of #include <readline.h>.
* event-loop.h: Get rid of nested #include's.
* event-loop.c: Rearrange includes to accomodate change in
event-loop.h. Include poll.h, not sys/poll.h.
* event-top.c: Ditto.
* main.c: Ditto.
1999-06-16 David Taylor <taylor@louisiana.cygnus.com>
* alpha-tdep.c (alpha_pop_frame): if frame->proc_desc
is NULL, call find_proc_desc so we know how to restore
the registers.
1999-06-15 Michael Snyder <msnyder@cleaver.cygnus.com>
* event-top.c (start_event_loop): call get_prompt.
(display_gdb_prompt): call get_prompt.
(async_stop_sig): call get_prompt.
1999-06-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-loop.c (delete_file_handler): When positioning prev_ptr,
keep looping while the one after is not equal to file_ptr, instead
of equal.
1999-06-14 Stan Shebs <shebs@andros.cygnus.com> 1999-06-14 Stan Shebs <shebs@andros.cygnus.com>
* MAINTAINERS: Add Jimmy Guo and Jim Blandy as HP testsuite and * MAINTAINERS: Add Jimmy Guo and Jim Blandy as HP testsuite and
@ -12,7 +70,6 @@
(read_command_lines): rename "prompt" to prompt_arg for clarity. (read_command_lines): rename "prompt" to prompt_arg for clarity.
(stop_sig): call get_prompt instead of reading prompt string directly. (stop_sig): call get_prompt instead of reading prompt string directly.
(command_loop): ditto. (command_loop): ditto.
(simplified_command_loop): ditto.
(gdb_prompt_escape): New variable. Esc char for prompt parameters. (gdb_prompt_escape): New variable. Esc char for prompt parameters.
(get_prompt_1): New function, workhorse for get_prompt. (get_prompt_1): New function, workhorse for get_prompt.
(get_prompt): Completely rewrite. Add functionality for a (get_prompt): Completely rewrite. Add functionality for a

View File

@ -219,7 +219,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
VERSION = 19990614 VERSION = 19990621
DIST=gdb DIST=gdb
LINT=/usr/5bin/lint LINT=/usr/5bin/lint
@ -436,6 +436,7 @@ gdbcmd_h = gdbcmd.h $(command_h)
defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h
top_h = top.h
inferior_h = inferior.h $(breakpoint_h) inferior_h = inferior.h $(breakpoint_h)
tracepoint_h = tracepoint.h tracepoint_h = tracepoint.h
ax_h = ax.h ax_h = ax.h
@ -1108,10 +1109,10 @@ eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \ $(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \
gdb_string.h gdb_string.h
event-loop.o: event-loop.c $(event_loop_h) event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h)
event-top.o: event-top.c top.h $(readline_headers) \ event-top.o: event-top.c top.h $(readline_headers) \
$(defs_h) $(inferior_h) $(event_loop_h) $(defs_h) $(inferior_h) $(event_loop_h) terminal.h
exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
target.h language.h gdb_string.h target.h language.h gdb_string.h

View File

@ -1114,6 +1114,15 @@ alpha_pop_frame()
alpha_extra_func_info_t proc_desc = frame->proc_desc; alpha_extra_func_info_t proc_desc = frame->proc_desc;
/* we need proc_desc to know how to restore the registers;
if it is NULL, construct (a temporary) one */
if (proc_desc == NULL)
proc_desc = find_proc_desc(frame->pc, frame->next);
/* Question: should we copy this proc_desc and save it in
frame->proc_desc? If we do, who will free it?
For now, we don't save a copy... */
write_register (PC_REGNUM, FRAME_SAVED_PC(frame)); write_register (PC_REGNUM, FRAME_SAVED_PC(frame));
if (frame->saved_regs == NULL) if (frame->saved_regs == NULL)
alpha_find_saved_regs (frame); alpha_find_saved_regs (frame);

View File

@ -1,3 +1,8 @@
Thu Jun 17 17:23:25 1999 Stan Shebs <shebs@andros.cygnus.com>
* gdbint.texinfo: Add an anti-printf exhortation, and update the
info about patch submission.
Mon Jun 7 15:49:40 1999 Stan Shebs <shebs@andros.cygnus.com> Mon Jun 7 15:49:40 1999 Stan Shebs <shebs@andros.cygnus.com>
From Per Bothner <bothner@cygnus.com>: From Per Bothner <bothner@cygnus.com>:

View File

@ -2474,6 +2474,7 @@ any system-independent file would (hooks, #if defined, etc.), and
machines which are radically different don't need to use infptrace.c at machines which are radically different don't need to use infptrace.c at
all. all.
Don't put debugging printfs in the code.
@node Porting GDB @node Porting GDB
@ -2682,9 +2683,8 @@ GDB users. In general we like to get well designed enhancements.
Thanks also for checking in advance about the best way to transfer the Thanks also for checking in advance about the best way to transfer the
changes. changes.
The GDB maintainers will only install ``cleanly designed'' patches. You The GDB maintainers will only install ``cleanly designed'' patches.
may not always agree on what is clean design. This manual summarizes what we believe to be clean design for GDB.
@c @pxref{Coding Style}, @pxref{Clean Design}.
If the maintainers don't have time to put the patch in when it arrives, If the maintainers don't have time to put the patch in when it arrives,
or if there is any question about a patch, it goes into a large queue or if there is any question about a patch, it goes into a large queue
@ -2693,55 +2693,51 @@ with everyone else's patches and bug reports.
The legal issue is that to incorporate substantial changes requires a The legal issue is that to incorporate substantial changes requires a
copyright assignment from you and/or your employer, granting ownership copyright assignment from you and/or your employer, granting ownership
of the changes to the Free Software Foundation. You can get the of the changes to the Free Software Foundation. You can get the
standard document for doing this by sending mail to standard documents for doing this by sending mail to @code{gnu@@gnu.org}
@code{gnu@@prep.ai.mit.edu} and asking for it. I recommend that people and asking for it. We recommend that people write in "All programs
write in "All programs owned by the Free Software Foundation" as "NAME owned by the Free Software Foundation" as "NAME OF PROGRAM", so that
OF PROGRAM", so that changes in many programs (not just GDB, but GAS, changes in many programs (not just GDB, but GAS, Emacs, GCC, etc) can be
Emacs, GCC, etc) can be contributed with only one piece of legalese contributed with only one piece of legalese pushed through the
pushed through the bureacracy and filed with the FSF. I can't start bureacracy and filed with the FSF. We can't start merging changes until
merging changes until this paperwork is received by the FSF (their this paperwork is received by the FSF (their rules, which we follow
rules, which I follow since I maintain it for them). since we maintain it for them).
Technically, the easiest way to receive changes is to receive each Technically, the easiest way to receive changes is to receive each
feature as a small context diff or unidiff, suitable for "patch". feature as a small context diff or unidiff, suitable for "patch". Each
Each message sent to me should include the changes to C code and message sent to me should include the changes to C code and header files
header files for a single feature, plus ChangeLog entries for each for a single feature, plus ChangeLog entries for each directory where
directory where files were modified, and diffs for any changes needed files were modified, and diffs for any changes needed to the manuals
to the manuals (gdb/doc/gdb.texi or gdb/doc/gdbint.texi). If there (gdb/doc/gdb.texinfo or gdb/doc/gdbint.texinfo). If there are a lot of
are a lot of changes for a single feature, they can be split down changes for a single feature, they can be split down into multiple
into multiple messages. messages.
In this way, if I read and like the feature, I can add it to the In this way, if we read and like the feature, we can add it to the
sources with a single patch command, do some testing, and check it in. sources with a single patch command, do some testing, and check it in.
If you leave out the ChangeLog, I have to write one. If you leave If you leave out the ChangeLog, we have to write one. If you leave
out the doc, I have to puzzle out what needs documenting. Etc. out the doc, we have to puzzle out what needs documenting. Etc.
The reason to send each change in a separate message is that I will The reason to send each change in a separate message is that we will not
not install some of the changes. They'll be returned to you with install some of the changes. They'll be returned to you with questions
questions or comments. If I'm doing my job, my message back to you or comments. If we're doing our job correctly, the message back to you
will say what you have to fix in order to make the change acceptable. will say what you have to fix in order to make the change acceptable.
The reason to have separate messages for separate features is so The reason to have separate messages for separate features is so that
that other changes (which I @emph{am} willing to accept) can be installed the acceptable changes can be installed while one or more changes are
while one or more changes are being reworked. If multiple features being reworked. If multiple features are sent in a single message, we
are sent in a single message, I tend to not put in the effort to sort tend to not put in the effort to sort out the acceptable changes from
out the acceptable changes from the unacceptable, so none of the the unacceptable, so none of the features get installed until all are
features get installed until all are acceptable. acceptable.
If this sounds painful or authoritarian, well, it is. But I get a lot If this sounds painful or authoritarian, well, it is. But we get a lot
of bug reports and a lot of patches, and most of them don't get of bug reports and a lot of patches, and many of them don't get
installed because I don't have the time to finish the job that the bug installed because we don't have the time to finish the job that the bug
reporter or the contributor could have done. Patches that arrive reporter or the contributor could have done. Patches that arrive
complete, working, and well designed, tend to get installed on the day complete, working, and well designed, tend to get installed on the day
they arrive. The others go into a queue and get installed if and when they arrive. The others go into a queue and get installed as time
I scan back over the queue -- which can literally take months permits, which, since the maintainers have many demands to meet, may not
sometimes. It's in both our interests to make patch installation easy be for quite some time.
-- you get your changes installed, and I make some forward progress on
GDB in a normal 12-hour day (instead of them having to wait until I
have a 14-hour or 16-hour day to spend cleaning up patches before I
can install them).
Please send patches directly to the GDB maintainers at Please send patches directly to the GDB maintainers at
@code{gdb-patches@@cygnus.com}. @code{gdb-patches@@sourceware.cygnus.com}.
@section Obsolete Conditionals @section Obsolete Conditionals

View File

@ -18,18 +18,16 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "event-loop.h"
#include <readline/readline.h>
#include <setjmp.h>
#include "top.h"
/* For config.h which may define HAVE_POLL */
#include "defs.h" #include "defs.h"
#include "top.h"
#include "event-loop.h"
#ifdef HAVE_POLL #ifdef HAVE_POLL
#include <sys/poll.h> #include <poll.h>
#else
#include <sys/types.h>
#endif #endif
#include <errno.h> #include <errno.h>
#include <setjmp.h>
/* Event queue: /* Event queue:
- the first event in the queue is the head of the queue. - the first event in the queue is the head of the queue.
@ -337,9 +335,13 @@ create_file_handler (fd, mask, proc, client_data)
#ifdef HAVE_POLL #ifdef HAVE_POLL
gdb_notifier.num_fds++; gdb_notifier.num_fds++;
gdb_notifier.poll_fds = if (gdb_notifier.poll_fds)
(struct pollfd *) realloc (gdb_notifier.poll_fds, gdb_notifier.poll_fds =
(gdb_notifier.num_fds) * sizeof (struct pollfd)); (struct pollfd *) realloc (gdb_notifier.poll_fds,
(gdb_notifier.num_fds) * sizeof (struct pollfd));
else
gdb_notifier.poll_fds =
(struct pollfd *) xmalloc (sizeof (struct pollfd));
(gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd; (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd;
(gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask; (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask;
(gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0; (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0;
@ -463,7 +465,7 @@ delete_file_handler (fd)
else else
{ {
for (prev_ptr = gdb_notifier.first_file_handler; for (prev_ptr = gdb_notifier.first_file_handler;
prev_ptr->next_file == file_ptr; prev_ptr->next_file != file_ptr;
prev_ptr = prev_ptr->next_file) prev_ptr = prev_ptr->next_file)
; ;
prev_ptr->next_file = file_ptr->next_file; prev_ptr->next_file = file_ptr->next_file;

View File

@ -18,17 +18,6 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include "defs.h"
/* An event loop listens for events from multiple event sources. When /* An event loop listens for events from multiple event sources. When
an event arrives, it is queued and processed by calling the an event arrives, it is queued and processed by calling the
appropriate event handler. The event loop then continues to listen appropriate event handler. The event loop then continues to listen

View File

@ -19,13 +19,14 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h" #include "defs.h"
#include "event-loop.h"
#include "top.h" #include "top.h"
#ifdef HAVE_POLL #ifdef HAVE_POLL
#include <sys/poll.h> #include <poll.h>
#endif #endif
#include "inferior.h" #include "inferior.h"
#include "terminal.h" /* for job_control*/ #include "terminal.h" /* for job_control*/
#include <signal.h>
#include "event-loop.h"
/* readline include files */ /* readline include files */
#include <readline/readline.h> #include <readline/readline.h>
@ -34,7 +35,7 @@
/* readline defines this. */ /* readline defines this. */
#undef savestring #undef savestring
extern void _initialize_event_loop (void); extern void _initialize_event_loop PARAMS ((void));
static void command_line_handler PARAMS ((char *)); static void command_line_handler PARAMS ((char *));
static void gdb_readline2 PARAMS ((void)); static void gdb_readline2 PARAMS ((void));
@ -165,6 +166,7 @@ start_event_loop ()
{ {
int length; int length;
char *a_prompt; char *a_prompt;
char *gdb_prompt = get_prompt ();
/* If we are using readline, set things up and display the first /* If we are using readline, set things up and display the first
prompt, otherwise just print the prompt. */ prompt, otherwise just print the prompt. */
@ -173,10 +175,10 @@ start_event_loop ()
/* Tell readline what the prompt to display is and what function it /* Tell readline what the prompt to display is and what function it
will need to call after a whole line is read. This also displays will need to call after a whole line is read. This also displays
the first prompt.*/ the first prompt.*/
length = strlen (PREFIX (0)) + strlen (PROMPT (0)) + strlen (SUFFIX (0)) + 1; length = strlen (PREFIX (0)) + strlen (gdb_prompt) + strlen (SUFFIX (0)) + 1;
a_prompt = (char *) xmalloc (length); a_prompt = (char *) xmalloc (length);
strcpy (a_prompt, PREFIX (0)); strcpy (a_prompt, PREFIX (0));
strcat (a_prompt, PROMPT (0)); strcat (a_prompt, gdb_prompt);
strcat (a_prompt, SUFFIX (0)); strcat (a_prompt, SUFFIX (0));
rl_callback_handler_install (a_prompt, input_handler); rl_callback_handler_install (a_prompt, input_handler);
} }
@ -251,19 +253,20 @@ display_gdb_prompt (new_prompt)
char *new_prompt; char *new_prompt;
{ {
int prompt_length = 0; int prompt_length = 0;
char *gdb_prompt = get_prompt ();
if (!new_prompt) if (!new_prompt)
{ {
/* Just use the top of the prompt stack. */ /* Just use the top of the prompt stack. */
prompt_length = strlen (PREFIX (0)) + prompt_length = strlen (PREFIX (0)) +
strlen (SUFFIX (0)) + strlen (SUFFIX (0)) +
strlen (PROMPT (0)) + 1; strlen (gdb_prompt) + 1;
new_prompt = (char *) alloca (prompt_length); new_prompt = (char *) alloca (prompt_length);
/* Prefix needs to have new line at end. */ /* Prefix needs to have new line at end. */
strcpy (new_prompt, PREFIX (0)); strcpy (new_prompt, PREFIX (0));
strcat (new_prompt, PROMPT (0)); strcat (new_prompt, gdb_prompt);
/* Suffix needs to have a new line at end and \032 \032 at /* Suffix needs to have a new line at end and \032 \032 at
beginning. */ beginning. */
strcat (new_prompt, SUFFIX (0)); strcat (new_prompt, SUFFIX (0));
@ -894,7 +897,7 @@ static void
async_stop_sig (arg) async_stop_sig (arg)
gdb_client_data arg; gdb_client_data arg;
{ {
char *prompt = PROMPT (0); char *prompt = get_prompt ();
#if STOP_SIGNAL == SIGTSTP #if STOP_SIGNAL == SIGTSTP
signal (SIGTSTP, SIG_DFL); signal (SIGTSTP, SIG_DFL);
sigsetmask (0); sigsetmask (0);
@ -983,34 +986,38 @@ set_async_prompt (args, from_tty, c)
void void
_initialize_event_loop () _initialize_event_loop ()
{ {
/* When a character is detected on instream by select or poll, readline if (async_p)
will be invoked via this callback function. */ {
call_readline = rl_callback_read_char; /* When a character is detected on instream by select or poll,
readline will be invoked via this callback function. */
call_readline = rl_callback_read_char;
/* When readline has read an end-of-line character, it passes the /* When readline has read an end-of-line character, it passes
complete line to gdb for processing. command_line_handler is the the complete line to gdb for processing. command_line_handler
function that does this. */ is the function that does this. */
input_handler = command_line_handler; input_handler = command_line_handler;
/* Tell readline to use the same input stream that gdb uses. */ /* Tell readline to use the same input stream that gdb uses. */
rl_instream = instream; rl_instream = instream;
/* Get a file descriptor for the input stream, so that we can /* Get a file descriptor for the input stream, so that we can
register it with the event loop. */ register it with the event loop. */
input_fd = fileno (instream); input_fd = fileno (instream);
/* Now we need to create the event sources for the input file descriptor. */ /* Now we need to create the event sources for the input file
/* At this point in time, this is the only event source that we descriptor. */
register with the even loop. Another source is going to be the /* At this point in time, this is the only event source that we
target program (inferior), but that must be registered only when register with the even loop. Another source is going to be
it actually exists (I.e. after we say 'run' or after we connect the target program (inferior), but that must be registered
to a remote target. */ only when it actually exists (I.e. after we say 'run' or
after we connect to a remote target. */
#ifdef HAVE_POLL #ifdef HAVE_POLL
create_file_handler (input_fd, POLLIN, create_file_handler (input_fd, POLLIN,
(file_handler_func *) call_readline, 0); (file_handler_func *) call_readline, 0);
#else #else
create_file_handler (input_fd, GDB_READABLE, create_file_handler (input_fd, GDB_READABLE,
(file_handler_func *) call_readline, 0); (file_handler_func *) call_readline, 0);
#endif #endif
}
} }

View File

@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
struct type *builtin_type_void; struct type *builtin_type_void;
struct type *builtin_type_char; struct type *builtin_type_char;
struct type *builtin_type_true_char;
struct type *builtin_type_short; struct type *builtin_type_short;
struct type *builtin_type_int; struct type *builtin_type_int;
struct type *builtin_type_long; struct type *builtin_type_long;
@ -2777,7 +2778,10 @@ build_gdbtypes ()
0, 0,
"char", (struct objfile *) NULL); "char", (struct objfile *) NULL);
TYPE_FLAGS (builtin_type_char) |= TYPE_FLAG_NOSIGN; TYPE_FLAGS (builtin_type_char) |= TYPE_FLAG_NOSIGN;
builtin_type_true_char =
init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0,
"true character", (struct objfile *) NULL);
builtin_type_signed_char = builtin_type_signed_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, 0,

View File

@ -844,6 +844,11 @@ extern struct type *builtin_type_uint32;
extern struct type *builtin_type_int64; extern struct type *builtin_type_int64;
extern struct type *builtin_type_uint64; extern struct type *builtin_type_uint64;
/* We use this for the '/c' print format, because builtin_type_char is
just a one-byte integral type, which languages less laid back than
C will print as ... well, a one-byte integral type. */
extern struct type *builtin_type_true_char;
/* This type represents a type that was unrecognized in symbol /* This type represents a type that was unrecognized in symbol
read-in. */ read-in. */

View File

@ -899,7 +899,7 @@ yylex ()
error ("Empty character constant."); error ("Empty character constant.");
yylval.typed_val_int.val = c; yylval.typed_val_int.val = c;
yylval.typed_val_int.type = builtin_type_char; yylval.typed_val_int.type = java_char_type;
c = *lexptr++; c = *lexptr++;
if (c != '\'') if (c != '\'')

View File

@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h" #include "defs.h"
#include "top.h" #include "top.h"
#include "event-loop.h"
#include "target.h" #include "target.h"
#include "inferior.h" #include "inferior.h"
#include "call-cmds.h" #include "call-cmds.h"
@ -35,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <ctype.h> #include <ctype.h>
#include "gdb_string.h" #include "gdb_string.h"
#include "event-loop.h"
/* If nonzero, display time usage both at startup and for each command. */ /* If nonzero, display time usage both at startup and for each command. */

View File

@ -442,8 +442,8 @@ print_scalar_formatted (valaddr, type, format, size, stream)
break; break;
case 'c': case 'c':
value_print (value_from_longest (builtin_type_char, val_long), stream, 0, value_print (value_from_longest (builtin_type_true_char, val_long),
Val_pretty_default); stream, 0, Val_pretty_default);
break; break;
case 'f': case 'f':

View File

@ -994,7 +994,6 @@ print_source_lines_base (s, line, stopline, noerror)
current_source_line = line; current_source_line = line;
first_line_listed = line; first_line_listed = line;
/* Only prints "No such file or directory" once */ /* Only prints "No such file or directory" once */
if ((s != last_source_visited) || (! last_source_error)) if ((s != last_source_visited) || (! last_source_error))
{ {

View File

@ -1,3 +1,24 @@
1999-06-18 Stan Shebs <shebs@andros.cygnus.com>
* gdb.c++/overload.exp: XFAIL everything if using G++, add a
simpler match case for the ptype of the big class.
1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.exp: Fix test for gdb_prompt existence.
1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.exp (gdb_test): Add fail after calls to perror.
1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.exp (gdb_test): Accept variations of Undefined command messages.
1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.exp (gdb_test): Fix anchors on gdb_expect statement.
Fri Jun 11 12:56:50 1999 Andrew Cagney <cagney@b1.cygnus.com> Fri Jun 11 12:56:50 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdb.base/call-strs.c (link_malloc): New function. Ensure that * gdb.base/call-strs.c (link_malloc): New function. Ensure that

View File

@ -43,6 +43,12 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
} }
# Create and source the file that provides information about the compiler
# used to compile the test case.
if [get_compiler_info ${binfile} "c++"] {
return -1
}
gdb_exit gdb_exit
gdb_start gdb_start
@ -87,6 +93,9 @@ gdb_expect {
-re "type = class foo \{.*public:.*int ifoo;.*const char \\*ccpfoo;.*foo\\(int\\);.*foo\\(int, (const char|char const) \\*\\);.*foo\\(foo &\\);.*~foo\\(void\\);.*void foofunc\\(int\\);.*void foofunc\\(int, signed char \\*\\);.*int overload1arg\\(void\\);.*int overload1arg\\(char\\);.*int overload1arg\\(signed char\\);.*int overload1arg\\(unsigned char\\);.*int overload1arg\\(short\\);.*int overload1arg\\(unsigned short\\);.*int overload1arg\\(int\\);.*int overload1arg\\(unsigned int\\);.*int overload1arg\\(long\\);.*int overload1arg\\(unsigned long\\);.*int overload1arg\\(float\\);.*int overload1arg\\(double\\);.*int overloadargs\\(int\\);.*int overloadargs\\(int, int\\);.*int overloadargs\\(int, int, int\\);.*int overloadargs\\(int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" { -re "type = class foo \{.*public:.*int ifoo;.*const char \\*ccpfoo;.*foo\\(int\\);.*foo\\(int, (const char|char const) \\*\\);.*foo\\(foo &\\);.*~foo\\(void\\);.*void foofunc\\(int\\);.*void foofunc\\(int, signed char \\*\\);.*int overload1arg\\(void\\);.*int overload1arg\\(char\\);.*int overload1arg\\(signed char\\);.*int overload1arg\\(unsigned char\\);.*int overload1arg\\(short\\);.*int overload1arg\\(unsigned short\\);.*int overload1arg\\(int\\);.*int overload1arg\\(unsigned int\\);.*int overload1arg\\(long\\);.*int overload1arg\\(unsigned long\\);.*int overload1arg\\(float\\);.*int overload1arg\\(double\\);.*int overloadargs\\(int\\);.*int overloadargs\\(int, int\\);.*int overloadargs\\(int, int, int\\);.*int overloadargs\\(int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" {
pass "ptype foo_instance1 (HP aCC -- known quirk with ~foo parameter list)" pass "ptype foo_instance1 (HP aCC -- known quirk with ~foo parameter list)"
} }
-re "type = class foo .*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" {
pass "ptype foo_instance1 (shorter match)"
}
-re ".*$gdb_prompt $" { fail "ptype foo_instance1" } -re ".*$gdb_prompt $" { fail "ptype foo_instance1" }
timeout { fail "(timeout) ptype foo_instance1" } timeout { fail "(timeout) ptype foo_instance1" }
} }
@ -110,6 +119,11 @@ gdb_expect {
} }
# The overload resolver added by HP (valops.c:find_overload_match) doesn't
# work right for G++ output, since the list of parameters seems not to
# be filled in correctly. Until this gets fixed, don't expect to pass
# these tests.
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1)\n" send_gdb "print foo_instance1.overloadargs(1)\n"
gdb_expect { gdb_expect {
@ -120,6 +134,9 @@ gdb_expect {
timeout { fail "(timeout) print call overloaded func 1 arg" } timeout { fail "(timeout) print call overloaded func 1 arg" }
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2)\n" send_gdb "print foo_instance1.overloadargs(1, 2)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 2\r\n$gdb_prompt $" { -re ".\[0-9\]* = 2\r\n$gdb_prompt $" {
@ -130,6 +147,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 3\r\n$gdb_prompt $" { -re ".\[0-9\]* = 3\r\n$gdb_prompt $" {
@ -140,6 +159,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 4\r\n$gdb_prompt $" { -re ".\[0-9\]* = 4\r\n$gdb_prompt $" {
@ -150,6 +171,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 5\r\n$gdb_prompt $" { -re ".\[0-9\]* = 5\r\n$gdb_prompt $" {
@ -160,6 +183,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 6\r\n$gdb_prompt $" { -re ".\[0-9\]* = 6\r\n$gdb_prompt $" {
@ -170,6 +195,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 7\r\n$gdb_prompt $" { -re ".\[0-9\]* = 7\r\n$gdb_prompt $" {
@ -180,6 +207,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 8\r\n$gdb_prompt $" { -re ".\[0-9\]* = 8\r\n$gdb_prompt $" {
@ -190,6 +219,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 9\r\n$gdb_prompt $" { -re ".\[0-9\]* = 9\r\n$gdb_prompt $" {
@ -200,6 +231,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 10\r\n$gdb_prompt $" { -re ".\[0-9\]* = 10\r\n$gdb_prompt $" {
@ -210,6 +243,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n" send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 11\r\n$gdb_prompt $" { -re ".\[0-9\]* = 11\r\n$gdb_prompt $" {
@ -220,6 +255,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg()\n" send_gdb "print foo_instance1.overload1arg()\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 1\r\n$gdb_prompt $" { -re ".\[0-9\]* = 1\r\n$gdb_prompt $" {
@ -229,6 +266,9 @@ gdb_expect {
timeout { fail "(timeout) print call overloaded func void arg" } timeout { fail "(timeout) print call overloaded func void arg" }
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((char)arg2)\n" send_gdb "print foo_instance1.overload1arg((char)arg2)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 2\r\n$gdb_prompt $" { -re ".\[0-9\]* = 2\r\n$gdb_prompt $" {
@ -238,6 +278,9 @@ gdb_expect {
timeout { fail "(timeout) print call overloaded func char arg" } timeout { fail "(timeout) print call overloaded func char arg" }
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((signed char)arg3)\n" send_gdb "print foo_instance1.overload1arg((signed char)arg3)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 3\r\n$gdb_prompt $" { -re ".\[0-9\]* = 3\r\n$gdb_prompt $" {
@ -248,6 +291,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((unsigned char)arg4)\n" send_gdb "print foo_instance1.overload1arg((unsigned char)arg4)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 4\r\n$gdb_prompt $" { -re ".\[0-9\]* = 4\r\n$gdb_prompt $" {
@ -258,6 +303,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((short)arg5)\n" send_gdb "print foo_instance1.overload1arg((short)arg5)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 5\r\n$gdb_prompt $" { -re ".\[0-9\]* = 5\r\n$gdb_prompt $" {
@ -268,6 +315,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((unsigned short)arg6)\n" send_gdb "print foo_instance1.overload1arg((unsigned short)arg6)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 6\r\n$gdb_prompt $" { -re ".\[0-9\]* = 6\r\n$gdb_prompt $" {
@ -278,6 +327,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((int)arg7)\n" send_gdb "print foo_instance1.overload1arg((int)arg7)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 7\r\n$gdb_prompt $" { -re ".\[0-9\]* = 7\r\n$gdb_prompt $" {
@ -288,6 +339,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((unsigned int)arg8)\n" send_gdb "print foo_instance1.overload1arg((unsigned int)arg8)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 8\r\n$gdb_prompt $" { -re ".\[0-9\]* = 8\r\n$gdb_prompt $" {
@ -298,6 +351,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((long)arg9)\n" send_gdb "print foo_instance1.overload1arg((long)arg9)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 9\r\n$gdb_prompt $" { -re ".\[0-9\]* = 9\r\n$gdb_prompt $" {
@ -308,6 +363,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((unsigned long)arg10)\n" send_gdb "print foo_instance1.overload1arg((unsigned long)arg10)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 10\r\n$gdb_prompt $" { -re ".\[0-9\]* = 10\r\n$gdb_prompt $" {
@ -318,6 +375,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((float)arg11)\n" send_gdb "print foo_instance1.overload1arg((float)arg11)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 11\r\n$gdb_prompt $" { -re ".\[0-9\]* = 11\r\n$gdb_prompt $" {
@ -328,6 +387,8 @@ gdb_expect {
} }
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print foo_instance1.overload1arg((double)arg12)\n" send_gdb "print foo_instance1.overload1arg((double)arg12)\n"
gdb_expect { gdb_expect {
-re ".\[0-9\]* = 12\r\n$gdb_prompt $" { -re ".\[0-9\]* = 12\r\n$gdb_prompt $" {

View File

@ -56,10 +56,10 @@ if ![info exists GDBFLAGS] {
} }
verbose "using GDBFLAGS = $GDBFLAGS" 2 verbose "using GDBFLAGS = $GDBFLAGS" 2
# The variable prompt is a regexp which matches the gdb prompt. Set it if it # The variable gdb_prompt is a regexp which matches the gdb prompt.
# is not already set. # Set it if it is not already set.
global gdb_prompt global gdb_prompt
if ![info exists prompt] then { if ![info exists gdb_prompt] then {
set gdb_prompt "\[(\]gdb\[)\]" set gdb_prompt "\[(\]gdb\[)\]"
} }
@ -414,7 +414,7 @@ proc gdb_test { args } {
gdb_suppress_entire_file "GDB died"; gdb_suppress_entire_file "GDB died";
return -1; return -1;
} }
-re "Ending remote debugging.*$gdb_prompt$" { -re "Ending remote debugging.*$gdb_prompt $" {
if ![isnative] then { if ![isnative] then {
warning "Can`t communicate to remote target." warning "Can`t communicate to remote target."
} }
@ -432,12 +432,14 @@ proc gdb_test { args } {
send_gdb "$response_string\n"; send_gdb "$response_string\n";
exp_continue; exp_continue;
} }
-re "Undefined command:.*$gdb_prompt" { -re "Undefined\[a-z\]* command:.*$gdb_prompt $" {
perror "Undefined command \"$command\"." perror "Undefined command \"$command\"."
fail "$message"
set result 1 set result 1
} }
-re "Ambiguous command.*$gdb_prompt $" { -re "Ambiguous command.*$gdb_prompt $" {
perror "\"$command\" is not a unique command name." perror "\"$command\" is not a unique command name."
fail "$message"
set result 1 set result 1
} }
-re "Program exited with code \[0-9\]+.*$gdb_prompt $" { -re "Program exited with code \[0-9\]+.*$gdb_prompt $" {
@ -467,10 +469,12 @@ proc gdb_test { args } {
"<return>" { "<return>" {
send_gdb "\n" send_gdb "\n"
perror "Window too small." perror "Window too small."
fail "$message"
} }
-re "\\(y or n\\) " { -re "\\(y or n\\) " {
send_gdb "n\n" send_gdb "n\n"
perror "Got interactive prompt." perror "Got interactive prompt."
fail "$message"
} }
eof { eof {
perror "Process no longer exists" perror "Process no longer exists"
@ -481,6 +485,7 @@ proc gdb_test { args } {
} }
full_buffer { full_buffer {
perror "internal buffer is full." perror "internal buffer is full."
fail "$message"
} }
timeout { timeout {
if ![string match "" $message] then { if ![string match "" $message] then {

2622
gdb/top.c

File diff suppressed because it is too large Load Diff