mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 10:03:47 +08:00
import gdb-1999-06-28 snapshot
This commit is contained in:
parent
303f629d61
commit
085dd6e638
106
gdb/ChangeLog
106
gdb/ChangeLog
@ -1,3 +1,109 @@
|
||||
1999-06-28 Jim Blandy <jimb@zwingli.cygnus.com>
|
||||
|
||||
* solib.c (clear_solib): Don't disable breakpoints if we're
|
||||
running an a.out executable (Solaris's SunOS emulation).
|
||||
|
||||
1999-06-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* main.c (main): Remove intialization of command_loop_hook, it
|
||||
is now done in _initialize_event_loop().
|
||||
* event-loop.c (gdb_do_one_event): Make static.
|
||||
(start_event_loop): New function. Just start the event loop.
|
||||
* event-top.c (cli_command_loop): New name for start_event_loop().
|
||||
(gdb_readline2): Make non static.
|
||||
(_initialize_event_loop): Set command_loop_hook to cli_command_loop.
|
||||
* event-loop.h: Adjust exported functions accordingly.
|
||||
|
||||
* top.c (init_main): Move setting of async_command_editing_p from
|
||||
here.
|
||||
* event-top.c (_initialize_event_loop): To here.
|
||||
(change_line_handler): Revert previous change. Add comment.
|
||||
(_initialize_event_loop): Revert previous change.
|
||||
(cli_command_loop): New name for start_event_loop().
|
||||
(start_event_loop): New function. This just starts up the event loop.
|
||||
(gdb_readline2): Make non static.
|
||||
(_initialize_event_loop): Set command_loop_hook to cli_command_loop.
|
||||
|
||||
1999-06-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* event-top.c (change_line_handler): Get rid of the global
|
||||
variable input_fd, use `fileno (instream)' instead.
|
||||
(_initialize_event_loop): Ditto
|
||||
|
||||
* event-loop.c (add_file_handler): New function. Wrapper for
|
||||
create_file_handler.
|
||||
(create_file_handler): Make static.
|
||||
* event-top.c (_initialize_event_loop): Call add_file_handler,
|
||||
instead of create_file_handler.
|
||||
(change_line_handler): Ditto.
|
||||
Remove poll.h include.
|
||||
* event-loop.h: Export add_file_handler instead of
|
||||
create_file_handler.
|
||||
|
||||
1999-06-24 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
Declare Altos configuration obsolete.
|
||||
* configure.host, configure.tgt: Comment out Altos config.
|
||||
* Makefile.in: Comment out Altos-related actions.
|
||||
* altos-xdep.c, config/m68k/altos.mh, altos.mt, tm-altos.h,
|
||||
xm-altos.h: Comment out.
|
||||
* NEWS: Mention obsolete status.
|
||||
|
||||
1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||
|
||||
* Makefile.in: Add MAKEHTML and MAKEHTMLFLAGS; pass them down;
|
||||
recognize html and install-html targets.
|
||||
* gdbserver/Makefile.in: Add empty html and install-html targets.
|
||||
* nlm/Makefile.in: Ditto.
|
||||
* rdi-share/Makefile.in: Ditto.
|
||||
|
||||
1999-06-24 Jim Blandy <jimb@zwingli.cygnus.com>
|
||||
|
||||
* ax-gdb.c (agent_command): Remove vestigial call to ax_reqs.
|
||||
|
||||
1999-06-24 James Ingham <jingham@leda.cygnus.com>
|
||||
|
||||
* arm-tdep.c (arm_othernames): Change both gdb's register display
|
||||
AND the opcode disassembly register naming if the othernames
|
||||
command. Fixes the gdb part of CR 101177.
|
||||
|
||||
1999-06-23 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
Declare Convex configuration obsolete.
|
||||
* configure.host, configure.tgt: Comment out Convex configs.
|
||||
* Makefile.in: Comment out Convex-related actions.
|
||||
* convex-xdep.c, convex-tdep.c, config/convex/*: Comment out.
|
||||
* NEWS: Mention obsolete status.
|
||||
|
||||
1999-06-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* main.c: Turn on async by default by setting async_p to 1.
|
||||
|
||||
Wed Jun 23 15:44:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
From Jimmy Guo <guo@cup.hp.com>:
|
||||
* frame.h (enum lval_type): Delcare when an __STDC__ compiler.
|
||||
Reverts Mon Aug 11 16:08:52 1997 Fred Fish <fnf@cygnus.com>
|
||||
change.
|
||||
* utils.c (gdb_file_rewind, gdb_file_put): Fix. A void function
|
||||
does not return a result.
|
||||
|
||||
Wed Jun 23 15:30:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* remote.c (set_thread, remote_get_threadinfo,
|
||||
remote_threads_info, remote_current_thread, remote_get_threadlist,
|
||||
extended_remote_restart, get_offsets, remote_open_1,
|
||||
remote_detach, remote_resume, remote_wait, remote_fetch_registers,
|
||||
remote_store_registers, check_binary_download, remote_write_bytes,
|
||||
remote_read_bytes, remote_search, putpkt_binary, putpkt_binary,
|
||||
read_frame, compare_sections_command, remote_query,
|
||||
packet_command, remote_info_process): Use alloca to create space
|
||||
for arrays of size PBUFSIZ.
|
||||
|
||||
1999-06-22 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||
|
||||
* top.c: Update copyright years to include 1999.
|
||||
|
||||
1999-06-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* top.c: Move include of event-loop.h, to avoid redefinition of
|
||||
|
@ -39,6 +39,7 @@ man7dir = $(mandir)/man7
|
||||
man8dir = $(mandir)/man8
|
||||
man9dir = $(mandir)/man9
|
||||
infodir = @infodir@
|
||||
htmldir = $(prefix)/html
|
||||
includedir = @includedir@
|
||||
|
||||
# This can be referenced by `INTLDEPS' as computed by CY_GNU_GETTEXT.
|
||||
@ -89,6 +90,10 @@ YLWRAP = $(srcdir)/../ylwrap
|
||||
# where to find makeinfo, preferably one designed for texinfo-2
|
||||
MAKEINFO=makeinfo
|
||||
|
||||
MAKEHTML = texi2html
|
||||
|
||||
MAKEHTMLFLAGS = -glossary -menu -split_chapter
|
||||
|
||||
# Set this up with gcc if you have gnu ld and the loader will print out
|
||||
# line numbers for undefined references.
|
||||
#CC_LD=gcc -static
|
||||
@ -219,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 = 19990621
|
||||
VERSION = 19990628
|
||||
DIST=gdb
|
||||
|
||||
LINT=/usr/5bin/lint
|
||||
@ -276,6 +281,8 @@ FLAGS_TO_PASS = \
|
||||
"DLLTOOL=$(DLLTOOL)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"MAKEINFO=$(MAKEINFO)" \
|
||||
"MAKEHTML=$(MAKEHTML)" \
|
||||
"MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
@ -358,6 +365,7 @@ TARGET_FLAGS_TO_PASS = \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"MAKEINFO=$(MAKEINFO)" \
|
||||
"MAKEHTML=$(MAKEHTML)" \
|
||||
"RUNTEST=$(RUNTEST)" \
|
||||
"RUNTESTFLAGS=$(RUNTESTFLAGS)"
|
||||
|
||||
@ -557,7 +565,7 @@ check: force
|
||||
$(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
|
||||
else true; fi
|
||||
|
||||
info dvi install-info clean-info: force
|
||||
info dvi install-info clean-info html install-html: force
|
||||
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
|
||||
|
||||
gdb.z:gdb.1
|
||||
@ -986,7 +994,7 @@ alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h
|
||||
alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
|
||||
$(inferior_h) $(symtab_h) $(dis-asm.h) gdb_string.h
|
||||
|
||||
altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
|
||||
# OBSOLETE altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
|
||||
|
||||
annotate.o: annotate.c $(defs_h) annotate.h $(value_h) target.h $(gdbtypes_h)
|
||||
|
||||
@ -1048,11 +1056,11 @@ command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \
|
||||
|
||||
complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h)
|
||||
|
||||
convex-tdep.o: convex-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) \
|
||||
$(gdbcore_h) $(inferior_h)
|
||||
# OBSOLETE convex-tdep.o: convex-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) \
|
||||
# OBSOLETE $(gdbcore_h) $(inferior_h)
|
||||
|
||||
convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
|
||||
$(inferior_h)
|
||||
# OBSOLETE convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
|
||||
# OBSOLETE $(inferior_h)
|
||||
|
||||
copying.o: copying.c $(defs_h) $(gdbcmd_h)
|
||||
|
||||
|
4
gdb/NEWS
4
gdb/NEWS
@ -7,6 +7,10 @@
|
||||
|
||||
TI TMS320C80 tic80-*-*
|
||||
|
||||
* OBSOLETE configurations
|
||||
|
||||
Altos 3068 m68*-altos-*
|
||||
Convex c1-*-*, c2-*-*
|
||||
|
||||
*** Changes in GDB-4.18:
|
||||
|
||||
|
326
gdb/altos-xdep.c
326
gdb/altos-xdep.c
@ -1,163 +1,163 @@
|
||||
/* Low level interface to ptrace, for GDB when running under m68k SVR2 Unix
|
||||
on Altos 3068. Report bugs to Jyrki Kuoppala <jkp@cs.hut.fi>
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "frame.h"
|
||||
#include "inferior.h"
|
||||
|
||||
#ifdef USG
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/dir.h>
|
||||
#include <signal.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef USG
|
||||
#include <sys/page.h>
|
||||
#ifdef ALTOS
|
||||
#include <sys/net.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "gdbcore.h"
|
||||
#include <sys/user.h> /* After a.out.h */
|
||||
#include <sys/file.h>
|
||||
#include "gdb_stat.h"
|
||||
|
||||
|
||||
/* Work with core dump and executable files, for GDB.
|
||||
This code would be in corefile.c if it weren't machine-dependent. */
|
||||
|
||||
void
|
||||
core_file_command (filename, from_tty)
|
||||
char *filename;
|
||||
int from_tty;
|
||||
{
|
||||
int val;
|
||||
|
||||
/* Discard all vestiges of any previous core file
|
||||
and mark data and stack spaces as empty. */
|
||||
|
||||
if (corefile)
|
||||
free (corefile);
|
||||
corefile = 0;
|
||||
|
||||
if (corechan >= 0)
|
||||
close (corechan);
|
||||
corechan = -1;
|
||||
|
||||
data_start = 0;
|
||||
data_end = 0;
|
||||
stack_start = STACK_END_ADDR;
|
||||
stack_end = STACK_END_ADDR;
|
||||
|
||||
/* Now, if a new core file was specified, open it and digest it. */
|
||||
|
||||
if (filename)
|
||||
{
|
||||
filename = tilde_expand (filename);
|
||||
make_cleanup (free, filename);
|
||||
|
||||
if (have_inferior_p ())
|
||||
error ("To look at a core file, you must kill the program with \"kill\".");
|
||||
corechan = open (filename, O_RDONLY, 0);
|
||||
if (corechan < 0)
|
||||
perror_with_name (filename);
|
||||
/* 4.2-style (and perhaps also sysV-style) core dump file. */
|
||||
{
|
||||
struct user u;
|
||||
|
||||
unsigned int reg_offset;
|
||||
|
||||
val = myread (corechan, &u, sizeof u);
|
||||
if (val < 0)
|
||||
perror_with_name ("Not a core file: reading upage");
|
||||
if (val != sizeof u)
|
||||
error ("Not a core file: could only read %d bytes", val);
|
||||
data_start = exec_data_start;
|
||||
|
||||
#if !defined (NBPG)
|
||||
#define NBPG NBPP
|
||||
#endif
|
||||
#if !defined (UPAGES)
|
||||
#define UPAGES USIZE
|
||||
#endif
|
||||
|
||||
data_end = data_start + NBPG * u.u_dsize;
|
||||
stack_start = stack_end - NBPG * u.u_ssize;
|
||||
data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp */;
|
||||
stack_offset = NBPG * (UPAGES + u.u_dsize);
|
||||
|
||||
/* Some machines put an absolute address in here and some put
|
||||
the offset in the upage of the regs. */
|
||||
reg_offset = (int) u.u_state;
|
||||
if (reg_offset > NBPG * UPAGES)
|
||||
reg_offset -= KERNEL_U_ADDR;
|
||||
|
||||
memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR));
|
||||
printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm);
|
||||
|
||||
/* I don't know where to find this info.
|
||||
So, for now, mark it as not available. */
|
||||
N_SET_MAGIC (core_aouthdr, 0);
|
||||
|
||||
/* Read the register values out of the core file and store
|
||||
them where `read_register' will find them. */
|
||||
|
||||
{
|
||||
register int regno;
|
||||
|
||||
for (regno = 0; regno < NUM_REGS; regno++)
|
||||
{
|
||||
char buf[MAX_REGISTER_RAW_SIZE];
|
||||
|
||||
val = lseek (corechan, register_addr (regno, reg_offset), 0);
|
||||
if (val < 0
|
||||
|| (val = myread (corechan, buf, sizeof buf)) < 0)
|
||||
{
|
||||
char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno))
|
||||
+ 30);
|
||||
strcpy (buffer, "Reading register ");
|
||||
strcat (buffer, REGISTER_NAME (regno));
|
||||
|
||||
perror_with_name (buffer);
|
||||
}
|
||||
|
||||
supply_register (regno, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (filename[0] == '/')
|
||||
corefile = savestring (filename, strlen (filename));
|
||||
else
|
||||
{
|
||||
corefile = concat (current_directory, "/", filename, NULL);
|
||||
}
|
||||
|
||||
flush_cached_frames ();
|
||||
select_frame (get_current_frame (), 0);
|
||||
validate_files ();
|
||||
}
|
||||
else if (from_tty)
|
||||
printf_unfiltered ("No core file now.\n");
|
||||
}
|
||||
/* OBSOLETE /* Low level interface to ptrace, for GDB when running under m68k SVR2 Unix */
|
||||
/* OBSOLETE on Altos 3068. Report bugs to Jyrki Kuoppala <jkp@cs.hut.fi> */
|
||||
/* OBSOLETE Copyright (C) 1989, 1991 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This file is part of GDB. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
||||
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
||||
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
||||
/* OBSOLETE (at your option) any later version. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
||||
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* OBSOLETE GNU General Public License for more details. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
||||
/* OBSOLETE along with this program; if not, write to the Free Software */
|
||||
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include "defs.h" */
|
||||
/* OBSOLETE #include "frame.h" */
|
||||
/* OBSOLETE #include "inferior.h" */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef USG */
|
||||
/* OBSOLETE #include <sys/types.h> */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include <sys/param.h> */
|
||||
/* OBSOLETE #include <sys/dir.h> */
|
||||
/* OBSOLETE #include <signal.h> */
|
||||
/* OBSOLETE #include <sys/ioctl.h> */
|
||||
/* OBSOLETE #include <fcntl.h> */
|
||||
/* OBSOLETE #ifdef USG */
|
||||
/* OBSOLETE #include <sys/page.h> */
|
||||
/* OBSOLETE #ifdef ALTOS */
|
||||
/* OBSOLETE #include <sys/net.h> */
|
||||
/* OBSOLETE #include <errno.h> */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include "gdbcore.h" */
|
||||
/* OBSOLETE #include <sys/user.h> /* After a.out.h *x/ */
|
||||
/* OBSOLETE #include <sys/file.h> */
|
||||
/* OBSOLETE #include "gdb_stat.h" */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Work with core dump and executable files, for GDB. */
|
||||
/* OBSOLETE This code would be in corefile.c if it weren't machine-dependent. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE void */
|
||||
/* OBSOLETE core_file_command (filename, from_tty) */
|
||||
/* OBSOLETE char *filename; */
|
||||
/* OBSOLETE int from_tty; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int val; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Discard all vestiges of any previous core file */
|
||||
/* OBSOLETE and mark data and stack spaces as empty. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (corefile) */
|
||||
/* OBSOLETE free (corefile); */
|
||||
/* OBSOLETE corefile = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (corechan >= 0) */
|
||||
/* OBSOLETE close (corechan); */
|
||||
/* OBSOLETE corechan = -1; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE data_start = 0; */
|
||||
/* OBSOLETE data_end = 0; */
|
||||
/* OBSOLETE stack_start = STACK_END_ADDR; */
|
||||
/* OBSOLETE stack_end = STACK_END_ADDR; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Now, if a new core file was specified, open it and digest it. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (filename) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE filename = tilde_expand (filename); */
|
||||
/* OBSOLETE make_cleanup (free, filename); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (have_inferior_p ()) */
|
||||
/* OBSOLETE error ("To look at a core file, you must kill the program with \"kill\"."); */
|
||||
/* OBSOLETE corechan = open (filename, O_RDONLY, 0); */
|
||||
/* OBSOLETE if (corechan < 0) */
|
||||
/* OBSOLETE perror_with_name (filename); */
|
||||
/* OBSOLETE /* 4.2-style (and perhaps also sysV-style) core dump file. *x/ */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE struct user u; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE unsigned int reg_offset; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE val = myread (corechan, &u, sizeof u); */
|
||||
/* OBSOLETE if (val < 0) */
|
||||
/* OBSOLETE perror_with_name ("Not a core file: reading upage"); */
|
||||
/* OBSOLETE if (val != sizeof u) */
|
||||
/* OBSOLETE error ("Not a core file: could only read %d bytes", val); */
|
||||
/* OBSOLETE data_start = exec_data_start; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #if !defined (NBPG) */
|
||||
/* OBSOLETE #define NBPG NBPP */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #if !defined (UPAGES) */
|
||||
/* OBSOLETE #define UPAGES USIZE */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE data_end = data_start + NBPG * u.u_dsize; */
|
||||
/* OBSOLETE stack_start = stack_end - NBPG * u.u_ssize; */
|
||||
/* OBSOLETE data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp *x/; */
|
||||
/* OBSOLETE stack_offset = NBPG * (UPAGES + u.u_dsize); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Some machines put an absolute address in here and some put */
|
||||
/* OBSOLETE the offset in the upage of the regs. *x/ */
|
||||
/* OBSOLETE reg_offset = (int) u.u_state; */
|
||||
/* OBSOLETE if (reg_offset > NBPG * UPAGES) */
|
||||
/* OBSOLETE reg_offset -= KERNEL_U_ADDR; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR)); */
|
||||
/* OBSOLETE printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* I don't know where to find this info. */
|
||||
/* OBSOLETE So, for now, mark it as not available. *x/ */
|
||||
/* OBSOLETE N_SET_MAGIC (core_aouthdr, 0); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Read the register values out of the core file and store */
|
||||
/* OBSOLETE them where `read_register' will find them. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE register int regno; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE val = lseek (corechan, register_addr (regno, reg_offset), 0); */
|
||||
/* OBSOLETE if (val < 0 */
|
||||
/* OBSOLETE || (val = myread (corechan, buf, sizeof buf)) < 0) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */
|
||||
/* OBSOLETE + 30); */
|
||||
/* OBSOLETE strcpy (buffer, "Reading register "); */
|
||||
/* OBSOLETE strcat (buffer, REGISTER_NAME (regno)); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE perror_with_name (buffer); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE supply_register (regno, buf); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (filename[0] == '/') */
|
||||
/* OBSOLETE corefile = savestring (filename, strlen (filename)); */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE corefile = concat (current_directory, "/", filename, NULL); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE flush_cached_frames (); */
|
||||
/* OBSOLETE select_frame (get_current_frame (), 0); */
|
||||
/* OBSOLETE validate_files (); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE else if (from_tty) */
|
||||
/* OBSOLETE printf_unfiltered ("No core file now.\n"); */
|
||||
/* OBSOLETE } */
|
||||
|
@ -45,7 +45,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
a power of two. */
|
||||
#define ROUND_DOWN(n,a) ((n) & ~((a) - 1))
|
||||
#define ROUND_UP(n,a) (((n) + (a) - 1) & ~((a) - 1))
|
||||
|
||||
|
||||
static char *APCS_register_names[] =
|
||||
{ "a1", "a2", "a3", "a4", /* 0 1 2 3 */
|
||||
"v1", "v2", "v3", "v4", /* 4 5 6 7 */
|
||||
"v5", "v6", "sl", "fp", /* 8 9 10 11 */
|
||||
"ip", "sp", "lr", "pc", /* 12 13 14 15 */
|
||||
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
|
||||
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
|
||||
"fps","ps" } /* 24 25 */;
|
||||
|
||||
/* These names are the ones which gcc emits, and
|
||||
I find them less confusing. Toggle between them
|
||||
using the `othernames' command. */
|
||||
static char *additional_register_names[] =
|
||||
{ "r0", "r1", "r2", "r3", /* 0 1 2 3 */
|
||||
"r4", "r5", "r6", "r7", /* 4 5 6 7 */
|
||||
"r8", "r9", "r10", "r11", /* 8 9 10 11 */
|
||||
"r12", "r13", "r14", "pc", /* 12 13 14 15 */
|
||||
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
|
||||
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
|
||||
"fps","ps" } /* 24 25 */;
|
||||
|
||||
/* By default use the APCS registers names */
|
||||
|
||||
char **arm_register_names = APCS_register_names;
|
||||
|
||||
/* Should call_function allocate stack space for a struct return? */
|
||||
/* The system C compiler uses a similar structure return convention to gcc */
|
||||
int
|
||||
@ -1029,38 +1054,18 @@ arm_float_info ()
|
||||
print_fpu_flags (status);
|
||||
}
|
||||
|
||||
static char *original_register_names[] =
|
||||
{ "a1", "a2", "a3", "a4", /* 0 1 2 3 */
|
||||
"v1", "v2", "v3", "v4", /* 4 5 6 7 */
|
||||
"v5", "v6", "sl", "fp", /* 8 9 10 11 */
|
||||
"ip", "sp", "lr", "pc", /* 12 13 14 15 */
|
||||
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
|
||||
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
|
||||
"fps","ps" } /* 24 25 */;
|
||||
|
||||
/* These names are the ones which gcc emits, and
|
||||
I find them less confusing. Toggle between them
|
||||
using the `othernames' command. */
|
||||
static char *additional_register_names[] =
|
||||
{ "r0", "r1", "r2", "r3", /* 0 1 2 3 */
|
||||
"r4", "r5", "r6", "r7", /* 4 5 6 7 */
|
||||
"r8", "r9", "sl", "fp", /* 8 9 10 11 */
|
||||
"ip", "sp", "lr", "pc", /* 12 13 14 15 */
|
||||
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
|
||||
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
|
||||
"fps","ps" } /* 24 25 */;
|
||||
|
||||
char **arm_register_names = original_register_names;
|
||||
|
||||
|
||||
static void
|
||||
arm_othernames ()
|
||||
{
|
||||
static int toggle;
|
||||
arm_register_names = (toggle
|
||||
? additional_register_names
|
||||
: original_register_names);
|
||||
toggle = !toggle;
|
||||
|
||||
if (arm_register_names == APCS_register_names) {
|
||||
arm_register_names = additional_register_names;
|
||||
arm_toggle_regnames ();
|
||||
} else {
|
||||
arm_register_names = APCS_register_names;
|
||||
arm_toggle_regnames ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* FIXME: Fill in with the 'right thing', see asm
|
||||
@ -1616,8 +1621,15 @@ arm_skip_stub (pc)
|
||||
void
|
||||
_initialize_arm_tdep ()
|
||||
{
|
||||
tm_print_insn = gdb_print_insn_arm;
|
||||
int regname_is_APCS = (arm_register_names == APCS_register_names);
|
||||
|
||||
tm_print_insn = gdb_print_insn_arm;
|
||||
|
||||
/* Sync the opcode insn printer with our register viewer: */
|
||||
|
||||
if (arm_toggle_regnames () != regname_is_APCS)
|
||||
arm_toggle_regnames ();
|
||||
|
||||
add_com ("othernames", class_obscure, arm_othernames,
|
||||
"Switch to the other set of register names.");
|
||||
|
||||
|
@ -1901,7 +1901,6 @@ agent_command (exp, from_tty)
|
||||
struct cleanup *old_chain = 0;
|
||||
struct expression *expr;
|
||||
struct agent_expr *agent;
|
||||
struct agent_reqs reqs;
|
||||
struct frame_info *fi = get_current_frame (); /* need current scope */
|
||||
|
||||
/* We don't deal with overlay debugging at the moment. We need to
|
||||
@ -1919,7 +1918,9 @@ agent_command (exp, from_tty)
|
||||
agent = gen_trace_for_expr (fi->pc, expr);
|
||||
make_cleanup ((make_cleanup_func) free_agent_expr, agent);
|
||||
ax_print (gdb_stdout, agent);
|
||||
ax_reqs (agent, &reqs);
|
||||
|
||||
/* It would be nice to call ax_reqs here to gather some general info
|
||||
about the expression, and then print out the result. */
|
||||
|
||||
do_cleanups (old_chain);
|
||||
dont_repeat ();
|
||||
|
@ -1,163 +1,164 @@
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @node Convex,,, Top
|
||||
@c OBSOLETE @appendix Convex-specific info
|
||||
@c OBSOLETE @cindex Convex notes
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE Scalar registers are 64 bits long, which is a pain since
|
||||
@c OBSOLETE left half of an S register frequently contains noise.
|
||||
@c OBSOLETE Therefore there are two ways to obtain the value of an S register.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @table @kbd
|
||||
@c OBSOLETE @item $s0
|
||||
@c OBSOLETE returns the low half of the register as an int
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @item $S0
|
||||
@c OBSOLETE returns the whole register as a long long
|
||||
@c OBSOLETE @end table
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE You can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}
|
||||
@c OBSOLETE to print a single or double precision value.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @cindex vector registers
|
||||
@c OBSOLETE Vector registers are handled similarly, with @samp{$V0} denoting the whole
|
||||
@c OBSOLETE 64-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}
|
||||
@c OBSOLETE or @samp{p/f $V0} can be used to examine the register in floating point.
|
||||
@c OBSOLETE The length of the vector registers is taken from @samp{$vl}.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE Individual elements of a vector register are denoted in the obvious way;
|
||||
@c OBSOLETE @samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and
|
||||
@c OBSOLETE @samp{set $v3[9] = 1234} alters it.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.
|
||||
@c OBSOLETE Elements of @kbd{$vm} can't be assigned to.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @cindex communication registers
|
||||
@c OBSOLETE @kindex info comm-registers
|
||||
@c OBSOLETE Communication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}
|
||||
@c OBSOLETE denoting the low-order halves. @samp{info comm-registers} will print them
|
||||
@c OBSOLETE all out, and tell which are locked. (A communication register is
|
||||
@c OBSOLETE locked when a value is sent to it, and unlocked when the value is
|
||||
@c OBSOLETE received.) Communication registers are, of course, global to all
|
||||
@c OBSOLETE threads, so it does not matter what the currently selected thread is.
|
||||
@c OBSOLETE @samp{info comm-reg @var{name}} prints just that one communication
|
||||
@c OBSOLETE register; @samp{name} may also be a communication register number
|
||||
@c OBSOLETE @samp{nn} or @samp{0xnn}.
|
||||
@c OBSOLETE @samp{info comm-reg @var{address}} prints the contents of the resource
|
||||
@c OBSOLETE structure at that address.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex info psw
|
||||
@c OBSOLETE The command @samp{info psw} prints the processor status word @kbd{$ps}
|
||||
@c OBSOLETE bit by bit.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex set base
|
||||
@c OBSOLETE GDB normally prints all integers in base 10, but the leading
|
||||
@c OBSOLETE @kbd{0x80000000} of pointers is intolerable in decimal, so the default
|
||||
@c OBSOLETE output radix has been changed to try to print addresses appropriately.
|
||||
@c OBSOLETE The @samp{set base} command can be used to change this.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @table @code
|
||||
@c OBSOLETE @item set base 10
|
||||
@c OBSOLETE Integer values always print in decimal.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @item set base 16
|
||||
@c OBSOLETE Integer values always print in hex.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @item set base
|
||||
@c OBSOLETE Go back to the initial state, which prints integer values in hex if they
|
||||
@c OBSOLETE look like pointers (specifically, if they start with 0x8 or 0xf in the
|
||||
@c OBSOLETE stack), otherwise in decimal.
|
||||
@c OBSOLETE @end table
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex set pipeline
|
||||
@c OBSOLETE When an exception such as a bus error or overflow happens, usually the PC
|
||||
@c OBSOLETE is several instructions ahead by the time the exception is detected.
|
||||
@c OBSOLETE The @samp{set pipe} command will disable this.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @table @code
|
||||
@c OBSOLETE @item set pipeline off
|
||||
@c OBSOLETE Forces serial execution of instructions; no vector chaining and no
|
||||
@c OBSOLETE scalar instruction overlap. With this, exceptions are detected with
|
||||
@c OBSOLETE the PC pointing to the instruction after the one in error.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @item set pipeline on
|
||||
@c OBSOLETE Returns to normal, fast, execution. This is the default.
|
||||
@c OBSOLETE @end table
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @cindex parallel
|
||||
@c OBSOLETE In a parallel program, multiple threads may be executing, each
|
||||
@c OBSOLETE with its own registers, stack, and local memory. When one of them
|
||||
@c OBSOLETE hits a breakpoint, that thread is selected. Other threads do
|
||||
@c OBSOLETE not run while the thread is in the breakpoint.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex 1cont
|
||||
@c OBSOLETE The selected thread can be single-stepped, given signals, and so
|
||||
@c OBSOLETE on. Any other threads remain stopped. When a @samp{cont} command is given,
|
||||
@c OBSOLETE all threads are resumed. To resume just the selected thread, use
|
||||
@c OBSOLETE the command @samp{1cont}.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex thread
|
||||
@c OBSOLETE The @samp{thread} command will show the active threads and the
|
||||
@c OBSOLETE instruction they are about to execute. The selected thread is marked
|
||||
@c OBSOLETE with an asterisk. The command @samp{thread @var{n}} will select thread @var{n},
|
||||
@c OBSOLETE shifting the debugger's attention to it for single-stepping,
|
||||
@c OBSOLETE registers, local memory, and so on.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex info threads
|
||||
@c OBSOLETE The @samp{info threads} command will show what threads, if any, have
|
||||
@c OBSOLETE invisibly hit breakpoints or signals and are waiting to be noticed.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @kindex set parallel
|
||||
@c OBSOLETE The @samp{set parallel} command controls how many threads can be active.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @table @code
|
||||
@c OBSOLETE @item set parallel off
|
||||
@c OBSOLETE One thread. Requests by the program that other threads join in
|
||||
@c OBSOLETE (spawn and pfork instructions) do not cause other threads to start up.
|
||||
@c OBSOLETE This does the same thing as the @samp{limit concurrency 1} command.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @item set parallel fixed
|
||||
@c OBSOLETE All CPUs are assigned to your program whenever it runs. When it
|
||||
@c OBSOLETE executes a pfork or spawn instruction, it begins parallel execution
|
||||
@c OBSOLETE immediately. This does the same thing as the @samp{mpa -f} command.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @item set parallel on
|
||||
@c OBSOLETE One or more threads. Spawn and pfork cause CPUs to join in when and if
|
||||
@c OBSOLETE they are free. This is the default. It is very good for system
|
||||
@c OBSOLETE throughput, but not very good for finding bugs in parallel code. If you
|
||||
@c OBSOLETE suspect a bug in parallel code, you probably want @samp{set parallel fixed.}
|
||||
@c OBSOLETE @end table
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE @subsection Limitations
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE WARNING: Convex GDB evaluates expressions in long long, because S
|
||||
@c OBSOLETE registers are 64 bits long. However, GDB expression semantics are not
|
||||
@c OBSOLETE exactly C semantics. This is a bug, strictly speaking, but it's not one I
|
||||
@c OBSOLETE know how to fix. If @samp{x} is a program variable of type int, then it
|
||||
@c OBSOLETE is also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}
|
||||
@c OBSOLETE or any other expression requiring computation. So is the expression
|
||||
@c OBSOLETE @samp{1}, or any other constant. You only really have to watch out for
|
||||
@c OBSOLETE calls. The innocuous expression @samp{list_node (0x80001234)} has an
|
||||
@c OBSOLETE argument of type long long. You must explicitly cast it to int.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE It is not possible to continue after an uncaught fatal signal by using
|
||||
@c OBSOLETE @samp{signal 0}, @samp{return}, @samp{jump}, or anything else. The difficulty is with
|
||||
@c OBSOLETE Unix, not GDB.
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE I have made no big effort to make such things as single-stepping a
|
||||
@c OBSOLETE @kbd{join} instruction do something reasonable. If the program seems to
|
||||
@c OBSOLETE hang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use
|
||||
@c OBSOLETE @samp{thread} to shift to a live thread. Single-stepping a @kbd{spawn}
|
||||
@c OBSOLETE instruction apparently causes new threads to be born with their T bit set;
|
||||
@c OBSOLETE this is not handled gracefully. When a thread has hit a breakpoint, other
|
||||
@c OBSOLETE threads may have invisibly hit the breakpoint in the background; if you
|
||||
@c OBSOLETE clear the breakpoint gdb will be surprised when threads seem to continue
|
||||
@c OBSOLETE to stop at it. All of these situations produce spurious signal 5 traps;
|
||||
@c OBSOLETE if this happens, just type @samp{cont}. If it becomes a nuisance, use
|
||||
@c OBSOLETE @samp{handle 5 nostop}. (It will ask if you are sure. You are.)
|
||||
@c OBSOLETE
|
||||
@c OBSOLETE There is no way in GDB to store a float in a register, as with
|
||||
@c OBSOLETE @kbd{set $s0 = 3.1416}. The identifier @kbd{$s0} denotes an integer,
|
||||
@c OBSOLETE and like any C expression which assigns to an integer variable, the
|
||||
@c OBSOLETE right-hand side is casted to type int. If you should need to do
|
||||
@c OBSOLETE something like this, you can assign the value to @kbd{@{float@} ($sp-4)}
|
||||
@c OBSOLETE and then do @kbd{set $s0 = $sp[-4]}. Same deal with @kbd{set $v0[69] = 6.9}.
|
||||
|
||||
@node Convex,,, Top
|
||||
@appendix Convex-specific info
|
||||
@cindex Convex notes
|
||||
|
||||
Scalar registers are 64 bits long, which is a pain since
|
||||
left half of an S register frequently contains noise.
|
||||
Therefore there are two ways to obtain the value of an S register.
|
||||
|
||||
@table @kbd
|
||||
@item $s0
|
||||
returns the low half of the register as an int
|
||||
|
||||
@item $S0
|
||||
returns the whole register as a long long
|
||||
@end table
|
||||
|
||||
You can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}
|
||||
to print a single or double precision value.
|
||||
|
||||
@cindex vector registers
|
||||
Vector registers are handled similarly, with @samp{$V0} denoting the whole
|
||||
64-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}
|
||||
or @samp{p/f $V0} can be used to examine the register in floating point.
|
||||
The length of the vector registers is taken from @samp{$vl}.
|
||||
|
||||
Individual elements of a vector register are denoted in the obvious way;
|
||||
@samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and
|
||||
@samp{set $v3[9] = 1234} alters it.
|
||||
|
||||
@kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.
|
||||
Elements of @kbd{$vm} can't be assigned to.
|
||||
|
||||
@cindex communication registers
|
||||
@kindex info comm-registers
|
||||
Communication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}
|
||||
denoting the low-order halves. @samp{info comm-registers} will print them
|
||||
all out, and tell which are locked. (A communication register is
|
||||
locked when a value is sent to it, and unlocked when the value is
|
||||
received.) Communication registers are, of course, global to all
|
||||
threads, so it does not matter what the currently selected thread is.
|
||||
@samp{info comm-reg @var{name}} prints just that one communication
|
||||
register; @samp{name} may also be a communication register number
|
||||
@samp{nn} or @samp{0xnn}.
|
||||
@samp{info comm-reg @var{address}} prints the contents of the resource
|
||||
structure at that address.
|
||||
|
||||
@kindex info psw
|
||||
The command @samp{info psw} prints the processor status word @kbd{$ps}
|
||||
bit by bit.
|
||||
|
||||
@kindex set base
|
||||
GDB normally prints all integers in base 10, but the leading
|
||||
@kbd{0x80000000} of pointers is intolerable in decimal, so the default
|
||||
output radix has been changed to try to print addresses appropriately.
|
||||
The @samp{set base} command can be used to change this.
|
||||
|
||||
@table @code
|
||||
@item set base 10
|
||||
Integer values always print in decimal.
|
||||
|
||||
@item set base 16
|
||||
Integer values always print in hex.
|
||||
|
||||
@item set base
|
||||
Go back to the initial state, which prints integer values in hex if they
|
||||
look like pointers (specifically, if they start with 0x8 or 0xf in the
|
||||
stack), otherwise in decimal.
|
||||
@end table
|
||||
|
||||
@kindex set pipeline
|
||||
When an exception such as a bus error or overflow happens, usually the PC
|
||||
is several instructions ahead by the time the exception is detected.
|
||||
The @samp{set pipe} command will disable this.
|
||||
|
||||
@table @code
|
||||
@item set pipeline off
|
||||
Forces serial execution of instructions; no vector chaining and no
|
||||
scalar instruction overlap. With this, exceptions are detected with
|
||||
the PC pointing to the instruction after the one in error.
|
||||
|
||||
@item set pipeline on
|
||||
Returns to normal, fast, execution. This is the default.
|
||||
@end table
|
||||
|
||||
@cindex parallel
|
||||
In a parallel program, multiple threads may be executing, each
|
||||
with its own registers, stack, and local memory. When one of them
|
||||
hits a breakpoint, that thread is selected. Other threads do
|
||||
not run while the thread is in the breakpoint.
|
||||
|
||||
@kindex 1cont
|
||||
The selected thread can be single-stepped, given signals, and so
|
||||
on. Any other threads remain stopped. When a @samp{cont} command is given,
|
||||
all threads are resumed. To resume just the selected thread, use
|
||||
the command @samp{1cont}.
|
||||
|
||||
@kindex thread
|
||||
The @samp{thread} command will show the active threads and the
|
||||
instruction they are about to execute. The selected thread is marked
|
||||
with an asterisk. The command @samp{thread @var{n}} will select thread @var{n},
|
||||
shifting the debugger's attention to it for single-stepping,
|
||||
registers, local memory, and so on.
|
||||
|
||||
@kindex info threads
|
||||
The @samp{info threads} command will show what threads, if any, have
|
||||
invisibly hit breakpoints or signals and are waiting to be noticed.
|
||||
|
||||
@kindex set parallel
|
||||
The @samp{set parallel} command controls how many threads can be active.
|
||||
|
||||
@table @code
|
||||
@item set parallel off
|
||||
One thread. Requests by the program that other threads join in
|
||||
(spawn and pfork instructions) do not cause other threads to start up.
|
||||
This does the same thing as the @samp{limit concurrency 1} command.
|
||||
|
||||
@item set parallel fixed
|
||||
All CPUs are assigned to your program whenever it runs. When it
|
||||
executes a pfork or spawn instruction, it begins parallel execution
|
||||
immediately. This does the same thing as the @samp{mpa -f} command.
|
||||
|
||||
@item set parallel on
|
||||
One or more threads. Spawn and pfork cause CPUs to join in when and if
|
||||
they are free. This is the default. It is very good for system
|
||||
throughput, but not very good for finding bugs in parallel code. If you
|
||||
suspect a bug in parallel code, you probably want @samp{set parallel fixed.}
|
||||
@end table
|
||||
|
||||
@subsection Limitations
|
||||
|
||||
WARNING: Convex GDB evaluates expressions in long long, because S
|
||||
registers are 64 bits long. However, GDB expression semantics are not
|
||||
exactly C semantics. This is a bug, strictly speaking, but it's not one I
|
||||
know how to fix. If @samp{x} is a program variable of type int, then it
|
||||
is also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}
|
||||
or any other expression requiring computation. So is the expression
|
||||
@samp{1}, or any other constant. You only really have to watch out for
|
||||
calls. The innocuous expression @samp{list_node (0x80001234)} has an
|
||||
argument of type long long. You must explicitly cast it to int.
|
||||
|
||||
It is not possible to continue after an uncaught fatal signal by using
|
||||
@samp{signal 0}, @samp{return}, @samp{jump}, or anything else. The difficulty is with
|
||||
Unix, not GDB.
|
||||
|
||||
I have made no big effort to make such things as single-stepping a
|
||||
@kbd{join} instruction do something reasonable. If the program seems to
|
||||
hang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use
|
||||
@samp{thread} to shift to a live thread. Single-stepping a @kbd{spawn}
|
||||
instruction apparently causes new threads to be born with their T bit set;
|
||||
this is not handled gracefully. When a thread has hit a breakpoint, other
|
||||
threads may have invisibly hit the breakpoint in the background; if you
|
||||
clear the breakpoint gdb will be surprised when threads seem to continue
|
||||
to stop at it. All of these situations produce spurious signal 5 traps;
|
||||
if this happens, just type @samp{cont}. If it becomes a nuisance, use
|
||||
@samp{handle 5 nostop}. (It will ask if you are sure. You are.)
|
||||
|
||||
There is no way in GDB to store a float in a register, as with
|
||||
@kbd{set $s0 = 3.1416}. The identifier @kbd{$s0} denotes an integer,
|
||||
and like any C expression which assigns to an integer variable, the
|
||||
right-hand side is casted to type int. If you should need to do
|
||||
something like this, you can assign the value to @kbd{@{float@} ($sp-4)}
|
||||
and then do @kbd{set $s0 = $sp[-4]}. Same deal with @kbd{set $v0[69] = 6.9}.
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Host: Convex Unix (4bsd)
|
||||
XDEPFILES= convex-xdep.o
|
||||
XM_FILE= xm-convex.h
|
||||
# OBSOLETE # Host: Convex Unix (4bsd)
|
||||
# OBSOLETE XDEPFILES= convex-xdep.o
|
||||
# OBSOLETE XM_FILE= xm-convex.h
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Target: Convex Unix (4bsd)
|
||||
TDEPFILES= convex-tdep.o
|
||||
TM_FILE= tm-convex.h
|
||||
# OBSOLETE # Target: Convex Unix (4bsd)
|
||||
# OBSOLETE TDEPFILES= convex-tdep.o
|
||||
# OBSOLETE TM_FILE= tm-convex.h
|
||||
|
@ -1,486 +1,486 @@
|
||||
/* Definitions to make GDB run on Convex Unix (4bsd)
|
||||
Copyright 1989, 1991, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define TARGET_BYTE_ORDER BIG_ENDIAN
|
||||
|
||||
/* There is come problem with the debugging symbols generated by the
|
||||
compiler such that the debugging symbol for the first line of a
|
||||
function overlap with the function prologue. */
|
||||
#define PROLOGUE_FIRSTLINE_OVERLAP
|
||||
|
||||
/* When convex pcc says CHAR or SHORT, it provides the correct address. */
|
||||
|
||||
#define BELIEVE_PCC_PROMOTION 1
|
||||
|
||||
/* Symbol types to ignore. */
|
||||
/* 0xc4 is N_MONPT. Use the numeric value for the benefit of people
|
||||
with (rather) old OS's. */
|
||||
#define IGNORE_SYMBOL(TYPE) \
|
||||
(((TYPE) & ~N_EXT) == N_TBSS \
|
||||
|| ((TYPE) & ~N_EXT) == N_TDATA \
|
||||
|| ((TYPE) & ~N_EXT) == 0xc4)
|
||||
|
||||
/* Offset from address of function to start of its code.
|
||||
Zero on most machines. */
|
||||
|
||||
#define FUNCTION_START_OFFSET 0
|
||||
|
||||
/* Advance PC across any function entry prologue instructions
|
||||
to reach some "real" code.
|
||||
Convex prolog is:
|
||||
[sub.w #-,sp] in one of 3 possible sizes
|
||||
[mov psw,- fc/vc main program prolog
|
||||
and #-,- (skip it because the "mov psw" saves the
|
||||
mov -,psw] T bit, so continue gets a surprise trap)
|
||||
[and #-,sp] fc/vc O2 main program prolog
|
||||
[ld.- -(ap),-] pcc/gcc register arg loads
|
||||
*/
|
||||
|
||||
extern CORE_ADDR convex_skip_prologue PARAMS ((CORE_ADDR pc));
|
||||
#define SKIP_PROLOGUE(pc) (convex_skip_prologue (pc))
|
||||
|
||||
/* Immediately after a function call, return the saved pc.
|
||||
(ignore frame and return *$sp so we can handle both calls and callq) */
|
||||
|
||||
#define SAVED_PC_AFTER_CALL(frame) \
|
||||
read_memory_integer (read_register (SP_REGNUM), 4)
|
||||
|
||||
/* Address of end of stack space.
|
||||
This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but
|
||||
that expression depends on the kernel version; instead, fetch a
|
||||
page-zero pointer and get it from that. This will be invalid if
|
||||
they ever change the way bkpt signals are delivered. */
|
||||
|
||||
#define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050)
|
||||
|
||||
/* User-mode traps push an extended rtn block,
|
||||
then fault with one of the following PCs */
|
||||
|
||||
#define is_trace_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4)
|
||||
#define is_arith_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4)
|
||||
#define is_break_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4)
|
||||
|
||||
/* We need to manipulate trap bits in the psw */
|
||||
|
||||
#define PSW_TRAP_FLAGS 0x69670000
|
||||
#define PSW_T_BIT 0x08000000
|
||||
#define PSW_S_BIT 0x01000000
|
||||
|
||||
/* Stack grows downward. */
|
||||
|
||||
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
||||
|
||||
/* Sequence of bytes for breakpoint instruction. (bkpt) */
|
||||
|
||||
#define BREAKPOINT {0x7d,0x50}
|
||||
|
||||
/* Amount PC must be decremented by after a breakpoint.
|
||||
This is often the number of bytes in BREAKPOINT but not always.
|
||||
(The break PC needs to be decremented by 2, but we do it when the
|
||||
break frame is recognized and popped. That way gdb can tell breaks
|
||||
from trace traps with certainty.) */
|
||||
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
|
||||
/* Say how long (ordinary) registers are. This is a piece of bogosity
|
||||
used in push_word and a few other places; REGISTER_RAW_SIZE is the
|
||||
real way to know how big a register is. */
|
||||
|
||||
#define REGISTER_SIZE 8
|
||||
|
||||
/* Number of machine registers */
|
||||
|
||||
#define NUM_REGS 26
|
||||
|
||||
/* Initializer for an array of names of registers.
|
||||
There should be NUM_REGS strings in this initializer. */
|
||||
|
||||
#define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\
|
||||
"s7","s6","s5","s4","s3","s2","s1","s0",\
|
||||
"S7","S6","S5","S4","S3","S2","S1","S0"}
|
||||
|
||||
/* Register numbers of various important registers.
|
||||
Note that some of these values are "real" register numbers,
|
||||
and correspond to the general registers of the machine,
|
||||
and some are "phony" register numbers which are too large
|
||||
to be actual register numbers as far as the user is concerned
|
||||
but do serve to get the desired values when passed to read_register. */
|
||||
|
||||
#define S0_REGNUM 25 /* the real S regs */
|
||||
#define S7_REGNUM 18
|
||||
#define s0_REGNUM 17 /* low-order halves of S regs */
|
||||
#define s7_REGNUM 10
|
||||
#define SP_REGNUM 9 /* A regs */
|
||||
#define A1_REGNUM 8
|
||||
#define A5_REGNUM 4
|
||||
#define AP_REGNUM 3
|
||||
#define FP_REGNUM 2 /* Contains address of executing stack frame */
|
||||
#define PS_REGNUM 1 /* Contains processor status */
|
||||
#define PC_REGNUM 0 /* Contains program counter */
|
||||
|
||||
/* convert dbx stab register number (from `r' declaration) to a gdb REGNUM */
|
||||
|
||||
#define STAB_REG_TO_REGNUM(value) \
|
||||
((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8))
|
||||
|
||||
/* Vector register numbers, not handled as ordinary regs.
|
||||
They are treated as convenience variables whose values are read
|
||||
from the inferior when needed. */
|
||||
|
||||
#define V0_REGNUM 0
|
||||
#define V7_REGNUM 7
|
||||
#define VM_REGNUM 8
|
||||
#define VS_REGNUM 9
|
||||
#define VL_REGNUM 10
|
||||
|
||||
/* Total amount of space needed to store our copies of the machine's
|
||||
register state, the array `registers'. */
|
||||
#define REGISTER_BYTES (4*10 + 8*8)
|
||||
|
||||
/* Index within `registers' of the first byte of the space for
|
||||
register N.
|
||||
NB: must match structure of struct syscall_context for correct operation */
|
||||
|
||||
#define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \
|
||||
(N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \
|
||||
40 + 8 * ((N)-S7_REGNUM))
|
||||
|
||||
/* Number of bytes of storage in the actual machine representation
|
||||
for register N. */
|
||||
|
||||
#define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8)
|
||||
|
||||
/* Number of bytes of storage in the program's representation
|
||||
for register N. */
|
||||
|
||||
#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
|
||||
|
||||
/* Largest value REGISTER_RAW_SIZE can have. */
|
||||
|
||||
#define MAX_REGISTER_RAW_SIZE 8
|
||||
|
||||
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
|
||||
|
||||
#define MAX_REGISTER_VIRTUAL_SIZE 8
|
||||
|
||||
/* Return the GDB type object for the "standard" data type
|
||||
of data in register N. */
|
||||
|
||||
#define REGISTER_VIRTUAL_TYPE(N) \
|
||||
((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long)
|
||||
|
||||
/* Store the address of the place in which to copy the structure the
|
||||
subroutine will return. This is called from call_function. */
|
||||
|
||||
#define STORE_STRUCT_RETURN(ADDR, SP) \
|
||||
{ write_register (A1_REGNUM, (ADDR)); }
|
||||
|
||||
/* Extract from an array REGBUF containing the (raw) register state
|
||||
a function return value of type TYPE, and copy that, in virtual format,
|
||||
into VALBUF. */
|
||||
|
||||
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
memcpy (VALBUF, &((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \
|
||||
8 - TYPE_LENGTH (TYPE)],\
|
||||
TYPE_LENGTH (TYPE))
|
||||
|
||||
/* Write into appropriate registers a function return value
|
||||
of type TYPE, given in virtual format. */
|
||||
|
||||
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8)
|
||||
|
||||
/* Extract from an array REGBUF containing the (raw) register state
|
||||
the address in which a function should return its structure value,
|
||||
as a CORE_ADDR (or an expression that can be used as one). */
|
||||
|
||||
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
||||
(*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)])
|
||||
|
||||
/* Define trapped internal variable hooks to read and write
|
||||
vector and communication registers. */
|
||||
|
||||
#define IS_TRAPPED_INTERNALVAR is_trapped_internalvar
|
||||
#define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar
|
||||
#define SET_TRAPPED_INTERNALVAR set_trapped_internalvar
|
||||
|
||||
extern struct value *value_of_trapped_internalvar ();
|
||||
|
||||
/* Hooks to read data from soff exec and core files,
|
||||
and to describe the files. */
|
||||
|
||||
#define FILES_INFO_HOOK print_maps
|
||||
|
||||
/* Hook to call to print a typeless integer value, normally printed in decimal.
|
||||
For convex, use hex instead if the number looks like an address. */
|
||||
|
||||
#define PRINT_TYPELESS_INTEGER decout
|
||||
|
||||
/* For the native compiler, variables for a particular lexical context
|
||||
are listed after the beginning LBRAC instead of before in the
|
||||
executables list of symbols. Using "gcc_compiled." to distinguish
|
||||
between GCC and native compiler doesn't work on Convex because the
|
||||
linker sorts the symbols to put "gcc_compiled." in the wrong place.
|
||||
desc is nonzero for native, zero for gcc. */
|
||||
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (desc != 0)
|
||||
|
||||
/* Pcc occaisionally puts an SO where there should be an SOL. */
|
||||
#define PCC_SOL_BROKEN
|
||||
|
||||
/* Describe the pointer in each stack frame to the previous stack frame
|
||||
(its caller). */
|
||||
|
||||
/* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame,
|
||||
and produces the frame's chain-pointer. */
|
||||
|
||||
/* (caller fp is saved at 8(fp)) */
|
||||
|
||||
#define FRAME_CHAIN(fi) (read_memory_integer ((fi)->frame + 8, 4))
|
||||
|
||||
/* Define other aspects of the stack frame. */
|
||||
|
||||
/* We need the boundaries of the text in the exec file, as a kludge,
|
||||
for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. */
|
||||
|
||||
#define NEED_TEXT_START_END 1
|
||||
|
||||
/* An expression that tells us whether the function invocation represented
|
||||
by FI does not have a frame on the stack associated with it.
|
||||
On convex, check at the return address for `callq' -- if so, frameless,
|
||||
otherwise, not. */
|
||||
|
||||
extern int convex_frameless_function_invocation PARAMS ((struct frame_info *fi));
|
||||
#define FRAMELESS_FUNCTION_INVOCATION(FI) (convex_frameless_function_invocatio (FI))
|
||||
|
||||
#define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4))
|
||||
|
||||
#define FRAME_ARGS_ADDRESS(fi) (read_memory_integer ((fi)->frame + 12, 4))
|
||||
|
||||
#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
|
||||
|
||||
/* Return number of args passed to a frame.
|
||||
Can return -1, meaning no way to tell. */
|
||||
|
||||
extern int convex_frame_num_args PARAMS ((struct frame_info *fi));
|
||||
#define FRAME_NUM_ARGS(fi) (convex_frame_num_args ((fi)))
|
||||
|
||||
/* Return number of bytes at start of arglist that are not really args. */
|
||||
|
||||
#define FRAME_ARGS_SKIP 0
|
||||
|
||||
/* Put here the code to store, into a struct frame_saved_regs,
|
||||
the addresses of the saved registers of frame described by FRAME_INFO.
|
||||
This includes special registers such as pc and fp saved in special
|
||||
ways in the stack frame. sp is even more special:
|
||||
the address we return for it IS the sp for the next frame. */
|
||||
|
||||
/* Normal (short) frames save only PC, FP, (callee's) AP. To reasonably
|
||||
handle gcc and pcc register variables, scan the code following the
|
||||
call for the instructions the compiler inserts to reload register
|
||||
variables from stack slots and record the stack slots as the saved
|
||||
locations of those registers. This will occasionally identify some
|
||||
random load as a saved register; this is harmless. vc does not
|
||||
declare its register allocation actions in the stabs. */
|
||||
|
||||
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
|
||||
{ register int regnum; \
|
||||
register int frame_length = /* 3 short, 2 long, 1 extended, 0 context */\
|
||||
(read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \
|
||||
register CORE_ADDR frame_fp = \
|
||||
read_memory_integer ((frame_info)->frame + 8, 4); \
|
||||
register CORE_ADDR next_addr; \
|
||||
memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \
|
||||
(frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0; \
|
||||
(frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \
|
||||
(frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8; \
|
||||
(frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12; \
|
||||
next_addr = (frame_info)->frame + 12; \
|
||||
if (frame_length < 3) \
|
||||
for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \
|
||||
(frame_saved_regs).regs[regnum] = (next_addr += 4); \
|
||||
if (frame_length < 2) \
|
||||
(frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4); \
|
||||
next_addr -= 4; \
|
||||
if (frame_length < 3) \
|
||||
for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) \
|
||||
(frame_saved_regs).regs[regnum] = (next_addr += 8); \
|
||||
if (frame_length < 2) \
|
||||
(frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8); \
|
||||
else \
|
||||
(frame_saved_regs).regs[SP_REGNUM] = next_addr + 8; \
|
||||
if (frame_length == 3) { \
|
||||
CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4); \
|
||||
int op, ix, disp; \
|
||||
op = read_memory_integer (pc, 2); \
|
||||
if ((op & 0xffc7) == 0x1480) pc += 4; /* add.w #-,sp */ \
|
||||
else if ((op & 0xffc7) == 0x58c0) pc += 2; /* add.w #-,sp */ \
|
||||
op = read_memory_integer (pc, 2); \
|
||||
if ((op & 0xffc7) == 0x2a06) pc += 4; /* ld.w -,ap */ \
|
||||
for (;;) { \
|
||||
op = read_memory_integer (pc, 2); \
|
||||
ix = (op >> 3) & 7; \
|
||||
if ((op & 0xfcc0) == 0x2800) { /* ld.- -,ak */ \
|
||||
regnum = SP_REGNUM - (op & 7); \
|
||||
disp = read_memory_integer (pc + 2, 2); \
|
||||
pc += 4;} \
|
||||
else if ((op & 0xfcc0) == 0x2840) { /* ld.- -,ak */ \
|
||||
regnum = SP_REGNUM - (op & 7); \
|
||||
disp = read_memory_integer (pc + 2, 4); \
|
||||
pc += 6;} \
|
||||
if ((op & 0xfcc0) == 0x3000) { /* ld.- -,sk */ \
|
||||
regnum = S0_REGNUM - (op & 7); \
|
||||
disp = read_memory_integer (pc + 2, 2); \
|
||||
pc += 4;} \
|
||||
else if ((op & 0xfcc0) == 0x3040) { /* ld.- -,sk */ \
|
||||
regnum = S0_REGNUM - (op & 7); \
|
||||
disp = read_memory_integer (pc + 2, 4); \
|
||||
pc += 6;} \
|
||||
else if ((op & 0xff00) == 0x7100) { /* br crossjump */ \
|
||||
pc += 2 * (char) op; \
|
||||
continue;} \
|
||||
else if (op == 0x0140) { /* jmp crossjump */ \
|
||||
pc = read_memory_integer (pc + 2, 4); \
|
||||
continue;} \
|
||||
else break; \
|
||||
if ((frame_saved_regs).regs[regnum]) \
|
||||
break; \
|
||||
if (ix == 7) disp += frame_fp; \
|
||||
else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4); \
|
||||
else if (ix != 0) break; \
|
||||
(frame_saved_regs).regs[regnum] = \
|
||||
disp - 8 + (1 << ((op >> 8) & 3)); \
|
||||
if (regnum >= S7_REGNUM) \
|
||||
(frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] = \
|
||||
disp - 4 + (1 << ((op >> 8) & 3)); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Things needed for making the inferior call functions. */
|
||||
|
||||
#define CALL_DUMMY_LOCATION BEFORE_TEXT_END
|
||||
|
||||
/* Push an empty stack frame, to record the current PC, etc. */
|
||||
|
||||
#define PUSH_DUMMY_FRAME \
|
||||
{ register CORE_ADDR sp = read_register (SP_REGNUM); \
|
||||
register int regnum; \
|
||||
char buf[8]; \
|
||||
long word; \
|
||||
for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) { \
|
||||
read_register_bytes (REGISTER_BYTE (regnum), buf, 8); \
|
||||
sp = push_bytes (sp, buf, 8);} \
|
||||
for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) { \
|
||||
word = read_register (regnum); \
|
||||
sp = push_bytes (sp, &word, 4);} \
|
||||
word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25); \
|
||||
sp = push_bytes (sp, &word, 4); \
|
||||
word = read_register (PC_REGNUM); \
|
||||
sp = push_bytes (sp, &word, 4); \
|
||||
write_register (SP_REGNUM, sp); \
|
||||
write_register (FP_REGNUM, sp); \
|
||||
write_register (AP_REGNUM, sp);}
|
||||
|
||||
/* Discard from the stack the innermost frame, restoring all registers. */
|
||||
|
||||
#define POP_FRAME do {\
|
||||
register CORE_ADDR fp = read_register (FP_REGNUM); \
|
||||
register int regnum; \
|
||||
register int frame_length = /* 3 short, 2 long, 1 extended, 0 context */ \
|
||||
(read_memory_integer (fp + 4, 4) >> 25) & 3; \
|
||||
char buf[8]; \
|
||||
write_register (PC_REGNUM, read_memory_integer (fp, 4)); \
|
||||
write_register (PS_REGNUM, read_memory_integer (fp += 4, 4)); \
|
||||
write_register (FP_REGNUM, read_memory_integer (fp += 4, 4)); \
|
||||
write_register (AP_REGNUM, read_memory_integer (fp += 4, 4)); \
|
||||
if (frame_length < 3) \
|
||||
for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \
|
||||
write_register (regnum, read_memory_integer (fp += 4, 4)); \
|
||||
if (frame_length < 2) \
|
||||
write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \
|
||||
fp -= 4; \
|
||||
if (frame_length < 3) \
|
||||
for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) { \
|
||||
read_memory (fp += 8, buf, 8); \
|
||||
write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \
|
||||
if (frame_length < 2) { \
|
||||
read_memory (fp += 8, buf, 8); \
|
||||
write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \
|
||||
else write_register (SP_REGNUM, fp + 8); \
|
||||
flush_cached_frames (); \
|
||||
} while (0)
|
||||
|
||||
/* This sequence of words is the instructions
|
||||
mov sp,ap
|
||||
pshea 69696969
|
||||
calls 32323232
|
||||
bkpt
|
||||
Note this is 16 bytes. */
|
||||
|
||||
#define CALL_DUMMY {0x50860d4069696969LL,0x2140323232327d50LL}
|
||||
|
||||
#define CALL_DUMMY_LENGTH 16
|
||||
|
||||
#define CALL_DUMMY_START_OFFSET 0
|
||||
|
||||
/* Insert the specified number of args and function address
|
||||
into a call sequence of the above form stored at DUMMYNAME. */
|
||||
|
||||
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
|
||||
{ *(int *)((char *) dummyname + 4) = nargs; \
|
||||
*(int *)((char *) dummyname + 10) = fun; }
|
||||
|
||||
/* Defs to read soff symbol tables, see dbxread.c */
|
||||
|
||||
#define NUMBER_OF_SYMBOLS ((long) opthdr.o_nsyms)
|
||||
#define STRING_TABLE_OFFSET ((long) filehdr.h_strptr)
|
||||
#define SYMBOL_TABLE_OFFSET ((long) opthdr.o_symptr)
|
||||
#define STRING_TABLE_SIZE ((long) filehdr.h_strsiz)
|
||||
#define SIZE_OF_TEXT_SEGMENT ((long) txthdr.s_size)
|
||||
#define ENTRY_POINT ((long) opthdr.o_entry)
|
||||
|
||||
#define READ_STRING_TABLE_SIZE(BUFFER) \
|
||||
(BUFFER = STRING_TABLE_SIZE)
|
||||
|
||||
#define DECLARE_FILE_HEADERS \
|
||||
FILEHDR filehdr; \
|
||||
OPTHDR opthdr; \
|
||||
SCNHDR txthdr
|
||||
|
||||
#define READ_FILE_HEADERS(DESC,NAME) \
|
||||
{ \
|
||||
int n; \
|
||||
val = myread (DESC, &filehdr, sizeof filehdr); \
|
||||
if (val < 0) \
|
||||
perror_with_name (NAME); \
|
||||
if (! IS_SOFF_MAGIC (filehdr.h_magic)) \
|
||||
error ("%s: not an executable file.", NAME); \
|
||||
lseek (DESC, 0L, 0); \
|
||||
if (myread (DESC, &filehdr, sizeof filehdr) < 0) \
|
||||
perror_with_name (NAME); \
|
||||
if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0) \
|
||||
perror_with_name (NAME); \
|
||||
for (n = 0; n < filehdr.h_nscns; n++) \
|
||||
{ \
|
||||
if (myread (DESC, &txthdr, sizeof txthdr) < 0) \
|
||||
perror_with_name (NAME); \
|
||||
if ((txthdr.s_flags & S_TYPMASK) == S_TEXT) \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
/* OBSOLETE /* Definitions to make GDB run on Convex Unix (4bsd) */
|
||||
/* OBSOLETE Copyright 1989, 1991, 1993 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This file is part of GDB. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
||||
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
||||
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
||||
/* OBSOLETE (at your option) any later version. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
||||
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* OBSOLETE GNU General Public License for more details. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
||||
/* OBSOLETE along with this program; if not, write to the Free Software */
|
||||
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* There is come problem with the debugging symbols generated by the */
|
||||
/* OBSOLETE compiler such that the debugging symbol for the first line of a */
|
||||
/* OBSOLETE function overlap with the function prologue. *x/ */
|
||||
/* OBSOLETE #define PROLOGUE_FIRSTLINE_OVERLAP */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* When convex pcc says CHAR or SHORT, it provides the correct address. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define BELIEVE_PCC_PROMOTION 1 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Symbol types to ignore. *x/ */
|
||||
/* OBSOLETE /* 0xc4 is N_MONPT. Use the numeric value for the benefit of people */
|
||||
/* OBSOLETE with (rather) old OS's. *x/ */
|
||||
/* OBSOLETE #define IGNORE_SYMBOL(TYPE) \ */
|
||||
/* OBSOLETE (((TYPE) & ~N_EXT) == N_TBSS \ */
|
||||
/* OBSOLETE || ((TYPE) & ~N_EXT) == N_TDATA \ */
|
||||
/* OBSOLETE || ((TYPE) & ~N_EXT) == 0xc4) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Offset from address of function to start of its code. */
|
||||
/* OBSOLETE Zero on most machines. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FUNCTION_START_OFFSET 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
|
||||
/* OBSOLETE to reach some "real" code. */
|
||||
/* OBSOLETE Convex prolog is: */
|
||||
/* OBSOLETE [sub.w #-,sp] in one of 3 possible sizes */
|
||||
/* OBSOLETE [mov psw,- fc/vc main program prolog */
|
||||
/* OBSOLETE and #-,- (skip it because the "mov psw" saves the */
|
||||
/* OBSOLETE mov -,psw] T bit, so continue gets a surprise trap) */
|
||||
/* OBSOLETE [and #-,sp] fc/vc O2 main program prolog */
|
||||
/* OBSOLETE [ld.- -(ap),-] pcc/gcc register arg loads */
|
||||
/* OBSOLETE *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE extern CORE_ADDR convex_skip_prologue PARAMS ((CORE_ADDR pc)); */
|
||||
/* OBSOLETE #define SKIP_PROLOGUE(pc) (convex_skip_prologue (pc)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Immediately after a function call, return the saved pc. */
|
||||
/* OBSOLETE (ignore frame and return *$sp so we can handle both calls and callq) *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
|
||||
/* OBSOLETE read_memory_integer (read_register (SP_REGNUM), 4) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Address of end of stack space. */
|
||||
/* OBSOLETE This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but */
|
||||
/* OBSOLETE that expression depends on the kernel version; instead, fetch a */
|
||||
/* OBSOLETE page-zero pointer and get it from that. This will be invalid if */
|
||||
/* OBSOLETE they ever change the way bkpt signals are delivered. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* User-mode traps push an extended rtn block, */
|
||||
/* OBSOLETE then fault with one of the following PCs *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define is_trace_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4) */
|
||||
/* OBSOLETE #define is_arith_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4) */
|
||||
/* OBSOLETE #define is_break_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* We need to manipulate trap bits in the psw *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define PSW_TRAP_FLAGS 0x69670000 */
|
||||
/* OBSOLETE #define PSW_T_BIT 0x08000000 */
|
||||
/* OBSOLETE #define PSW_S_BIT 0x01000000 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Stack grows downward. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Sequence of bytes for breakpoint instruction. (bkpt) *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define BREAKPOINT {0x7d,0x50} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */
|
||||
/* OBSOLETE This is often the number of bytes in BREAKPOINT but not always. */
|
||||
/* OBSOLETE (The break PC needs to be decremented by 2, but we do it when the */
|
||||
/* OBSOLETE break frame is recognized and popped. That way gdb can tell breaks */
|
||||
/* OBSOLETE from trace traps with certainty.) *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */
|
||||
/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */
|
||||
/* OBSOLETE real way to know how big a register is. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_SIZE 8 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Number of machine registers *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define NUM_REGS 26 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Initializer for an array of names of registers. */
|
||||
/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\ */
|
||||
/* OBSOLETE "s7","s6","s5","s4","s3","s2","s1","s0",\ */
|
||||
/* OBSOLETE "S7","S6","S5","S4","S3","S2","S1","S0"} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Register numbers of various important registers. */
|
||||
/* OBSOLETE Note that some of these values are "real" register numbers, */
|
||||
/* OBSOLETE and correspond to the general registers of the machine, */
|
||||
/* OBSOLETE and some are "phony" register numbers which are too large */
|
||||
/* OBSOLETE to be actual register numbers as far as the user is concerned */
|
||||
/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define S0_REGNUM 25 /* the real S regs *x/ */
|
||||
/* OBSOLETE #define S7_REGNUM 18 */
|
||||
/* OBSOLETE #define s0_REGNUM 17 /* low-order halves of S regs *x/ */
|
||||
/* OBSOLETE #define s7_REGNUM 10 */
|
||||
/* OBSOLETE #define SP_REGNUM 9 /* A regs *x/ */
|
||||
/* OBSOLETE #define A1_REGNUM 8 */
|
||||
/* OBSOLETE #define A5_REGNUM 4 */
|
||||
/* OBSOLETE #define AP_REGNUM 3 */
|
||||
/* OBSOLETE #define FP_REGNUM 2 /* Contains address of executing stack frame *x/ */
|
||||
/* OBSOLETE #define PS_REGNUM 1 /* Contains processor status *x/ */
|
||||
/* OBSOLETE #define PC_REGNUM 0 /* Contains program counter *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* convert dbx stab register number (from `r' declaration) to a gdb REGNUM *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STAB_REG_TO_REGNUM(value) \ */
|
||||
/* OBSOLETE ((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Vector register numbers, not handled as ordinary regs. */
|
||||
/* OBSOLETE They are treated as convenience variables whose values are read */
|
||||
/* OBSOLETE from the inferior when needed. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define V0_REGNUM 0 */
|
||||
/* OBSOLETE #define V7_REGNUM 7 */
|
||||
/* OBSOLETE #define VM_REGNUM 8 */
|
||||
/* OBSOLETE #define VS_REGNUM 9 */
|
||||
/* OBSOLETE #define VL_REGNUM 10 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
|
||||
/* OBSOLETE register state, the array `registers'. *x/ */
|
||||
/* OBSOLETE #define REGISTER_BYTES (4*10 + 8*8) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
|
||||
/* OBSOLETE register N. */
|
||||
/* OBSOLETE NB: must match structure of struct syscall_context for correct operation *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \ */
|
||||
/* OBSOLETE (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \ */
|
||||
/* OBSOLETE 40 + 8 * ((N)-S7_REGNUM)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
|
||||
/* OBSOLETE for register N. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Number of bytes of storage in the program's representation */
|
||||
/* OBSOLETE for register N. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE 8 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Return the GDB type object for the "standard" data type */
|
||||
/* OBSOLETE of data in register N. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
|
||||
/* OBSOLETE ((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Store the address of the place in which to copy the structure the */
|
||||
/* OBSOLETE subroutine will return. This is called from call_function. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */
|
||||
/* OBSOLETE { write_register (A1_REGNUM, (ADDR)); } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
|
||||
/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */
|
||||
/* OBSOLETE into VALBUF. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
|
||||
/* OBSOLETE memcpy (VALBUF, &((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \ */
|
||||
/* OBSOLETE 8 - TYPE_LENGTH (TYPE)],\ */
|
||||
/* OBSOLETE TYPE_LENGTH (TYPE)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Write into appropriate registers a function return value */
|
||||
/* OBSOLETE of type TYPE, given in virtual format. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
|
||||
/* OBSOLETE write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
|
||||
/* OBSOLETE the address in which a function should return its structure value, */
|
||||
/* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ */
|
||||
/* OBSOLETE (*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)]) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Define trapped internal variable hooks to read and write */
|
||||
/* OBSOLETE vector and communication registers. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define IS_TRAPPED_INTERNALVAR is_trapped_internalvar */
|
||||
/* OBSOLETE #define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar */
|
||||
/* OBSOLETE #define SET_TRAPPED_INTERNALVAR set_trapped_internalvar */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE extern struct value *value_of_trapped_internalvar (); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Hooks to read data from soff exec and core files, */
|
||||
/* OBSOLETE and to describe the files. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FILES_INFO_HOOK print_maps */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Hook to call to print a typeless integer value, normally printed in decimal. */
|
||||
/* OBSOLETE For convex, use hex instead if the number looks like an address. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define PRINT_TYPELESS_INTEGER decout */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* For the native compiler, variables for a particular lexical context */
|
||||
/* OBSOLETE are listed after the beginning LBRAC instead of before in the */
|
||||
/* OBSOLETE executables list of symbols. Using "gcc_compiled." to distinguish */
|
||||
/* OBSOLETE between GCC and native compiler doesn't work on Convex because the */
|
||||
/* OBSOLETE linker sorts the symbols to put "gcc_compiled." in the wrong place. */
|
||||
/* OBSOLETE desc is nonzero for native, zero for gcc. *x/ */
|
||||
/* OBSOLETE #define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (desc != 0) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Pcc occaisionally puts an SO where there should be an SOL. *x/ */
|
||||
/* OBSOLETE #define PCC_SOL_BROKEN */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */
|
||||
/* OBSOLETE (its caller). *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame, */
|
||||
/* OBSOLETE and produces the frame's chain-pointer. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* (caller fp is saved at 8(fp)) *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_CHAIN(fi) (read_memory_integer ((fi)->frame + 8, 4)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Define other aspects of the stack frame. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* We need the boundaries of the text in the exec file, as a kludge, */
|
||||
/* OBSOLETE for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define NEED_TEXT_START_END 1 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* An expression that tells us whether the function invocation represented */
|
||||
/* OBSOLETE by FI does not have a frame on the stack associated with it. */
|
||||
/* OBSOLETE On convex, check at the return address for `callq' -- if so, frameless, */
|
||||
/* OBSOLETE otherwise, not. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE extern int convex_frameless_function_invocation PARAMS ((struct frame_info *fi)); */
|
||||
/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) (convex_frameless_function_invocatio (FI)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) (read_memory_integer ((fi)->frame + 12, 4)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Return number of args passed to a frame. */
|
||||
/* OBSOLETE Can return -1, meaning no way to tell. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE extern int convex_frame_num_args PARAMS ((struct frame_info *fi)); */
|
||||
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (convex_frame_num_args ((fi))) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_ARGS_SKIP 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */
|
||||
/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */
|
||||
/* OBSOLETE This includes special registers such as pc and fp saved in special */
|
||||
/* OBSOLETE ways in the stack frame. sp is even more special: */
|
||||
/* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Normal (short) frames save only PC, FP, (callee's) AP. To reasonably */
|
||||
/* OBSOLETE handle gcc and pcc register variables, scan the code following the */
|
||||
/* OBSOLETE call for the instructions the compiler inserts to reload register */
|
||||
/* OBSOLETE variables from stack slots and record the stack slots as the saved */
|
||||
/* OBSOLETE locations of those registers. This will occasionally identify some */
|
||||
/* OBSOLETE random load as a saved register; this is harmless. vc does not */
|
||||
/* OBSOLETE declare its register allocation actions in the stabs. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
|
||||
/* OBSOLETE { register int regnum; \ */
|
||||
/* OBSOLETE register int frame_length = /* 3 short, 2 long, 1 extended, 0 context *x/\ */
|
||||
/* OBSOLETE (read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \ */
|
||||
/* OBSOLETE register CORE_ADDR frame_fp = \ */
|
||||
/* OBSOLETE read_memory_integer ((frame_info)->frame + 8, 4); \ */
|
||||
/* OBSOLETE register CORE_ADDR next_addr; \ */
|
||||
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0; \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8; \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12; \ */
|
||||
/* OBSOLETE next_addr = (frame_info)->frame + 12; \ */
|
||||
/* OBSOLETE if (frame_length < 3) \ */
|
||||
/* OBSOLETE for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[regnum] = (next_addr += 4); \ */
|
||||
/* OBSOLETE if (frame_length < 2) \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4); \ */
|
||||
/* OBSOLETE next_addr -= 4; \ */
|
||||
/* OBSOLETE if (frame_length < 3) \ */
|
||||
/* OBSOLETE for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[regnum] = (next_addr += 8); \ */
|
||||
/* OBSOLETE if (frame_length < 2) \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8); \ */
|
||||
/* OBSOLETE else \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = next_addr + 8; \ */
|
||||
/* OBSOLETE if (frame_length == 3) { \ */
|
||||
/* OBSOLETE CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4); \ */
|
||||
/* OBSOLETE int op, ix, disp; \ */
|
||||
/* OBSOLETE op = read_memory_integer (pc, 2); \ */
|
||||
/* OBSOLETE if ((op & 0xffc7) == 0x1480) pc += 4; /* add.w #-,sp *x/ \ */
|
||||
/* OBSOLETE else if ((op & 0xffc7) == 0x58c0) pc += 2; /* add.w #-,sp *x/ \ */
|
||||
/* OBSOLETE op = read_memory_integer (pc, 2); \ */
|
||||
/* OBSOLETE if ((op & 0xffc7) == 0x2a06) pc += 4; /* ld.w -,ap *x/ \ */
|
||||
/* OBSOLETE for (;;) { \ */
|
||||
/* OBSOLETE op = read_memory_integer (pc, 2); \ */
|
||||
/* OBSOLETE ix = (op >> 3) & 7; \ */
|
||||
/* OBSOLETE if ((op & 0xfcc0) == 0x2800) { /* ld.- -,ak *x/ \ */
|
||||
/* OBSOLETE regnum = SP_REGNUM - (op & 7); \ */
|
||||
/* OBSOLETE disp = read_memory_integer (pc + 2, 2); \ */
|
||||
/* OBSOLETE pc += 4;} \ */
|
||||
/* OBSOLETE else if ((op & 0xfcc0) == 0x2840) { /* ld.- -,ak *x/ \ */
|
||||
/* OBSOLETE regnum = SP_REGNUM - (op & 7); \ */
|
||||
/* OBSOLETE disp = read_memory_integer (pc + 2, 4); \ */
|
||||
/* OBSOLETE pc += 6;} \ */
|
||||
/* OBSOLETE if ((op & 0xfcc0) == 0x3000) { /* ld.- -,sk *x/ \ */
|
||||
/* OBSOLETE regnum = S0_REGNUM - (op & 7); \ */
|
||||
/* OBSOLETE disp = read_memory_integer (pc + 2, 2); \ */
|
||||
/* OBSOLETE pc += 4;} \ */
|
||||
/* OBSOLETE else if ((op & 0xfcc0) == 0x3040) { /* ld.- -,sk *x/ \ */
|
||||
/* OBSOLETE regnum = S0_REGNUM - (op & 7); \ */
|
||||
/* OBSOLETE disp = read_memory_integer (pc + 2, 4); \ */
|
||||
/* OBSOLETE pc += 6;} \ */
|
||||
/* OBSOLETE else if ((op & 0xff00) == 0x7100) { /* br crossjump *x/ \ */
|
||||
/* OBSOLETE pc += 2 * (char) op; \ */
|
||||
/* OBSOLETE continue;} \ */
|
||||
/* OBSOLETE else if (op == 0x0140) { /* jmp crossjump *x/ \ */
|
||||
/* OBSOLETE pc = read_memory_integer (pc + 2, 4); \ */
|
||||
/* OBSOLETE continue;} \ */
|
||||
/* OBSOLETE else break; \ */
|
||||
/* OBSOLETE if ((frame_saved_regs).regs[regnum]) \ */
|
||||
/* OBSOLETE break; \ */
|
||||
/* OBSOLETE if (ix == 7) disp += frame_fp; \ */
|
||||
/* OBSOLETE else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4); \ */
|
||||
/* OBSOLETE else if (ix != 0) break; \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[regnum] = \ */
|
||||
/* OBSOLETE disp - 8 + (1 << ((op >> 8) & 3)); \ */
|
||||
/* OBSOLETE if (regnum >= S7_REGNUM) \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] = \ */
|
||||
/* OBSOLETE disp - 4 + (1 << ((op >> 8) & 3)); \ */
|
||||
/* OBSOLETE } \ */
|
||||
/* OBSOLETE } \ */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CALL_DUMMY_LOCATION BEFORE_TEXT_END */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define PUSH_DUMMY_FRAME \ */
|
||||
/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */
|
||||
/* OBSOLETE register int regnum; \ */
|
||||
/* OBSOLETE char buf[8]; \ */
|
||||
/* OBSOLETE long word; \ */
|
||||
/* OBSOLETE for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) { \ */
|
||||
/* OBSOLETE read_register_bytes (REGISTER_BYTE (regnum), buf, 8); \ */
|
||||
/* OBSOLETE sp = push_bytes (sp, buf, 8);} \ */
|
||||
/* OBSOLETE for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) { \ */
|
||||
/* OBSOLETE word = read_register (regnum); \ */
|
||||
/* OBSOLETE sp = push_bytes (sp, &word, 4);} \ */
|
||||
/* OBSOLETE word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25); \ */
|
||||
/* OBSOLETE sp = push_bytes (sp, &word, 4); \ */
|
||||
/* OBSOLETE word = read_register (PC_REGNUM); \ */
|
||||
/* OBSOLETE sp = push_bytes (sp, &word, 4); \ */
|
||||
/* OBSOLETE write_register (SP_REGNUM, sp); \ */
|
||||
/* OBSOLETE write_register (FP_REGNUM, sp); \ */
|
||||
/* OBSOLETE write_register (AP_REGNUM, sp);} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define POP_FRAME do {\ */
|
||||
/* OBSOLETE register CORE_ADDR fp = read_register (FP_REGNUM); \ */
|
||||
/* OBSOLETE register int regnum; \ */
|
||||
/* OBSOLETE register int frame_length = /* 3 short, 2 long, 1 extended, 0 context *x/ \ */
|
||||
/* OBSOLETE (read_memory_integer (fp + 4, 4) >> 25) & 3; \ */
|
||||
/* OBSOLETE char buf[8]; \ */
|
||||
/* OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp, 4)); \ */
|
||||
/* OBSOLETE write_register (PS_REGNUM, read_memory_integer (fp += 4, 4)); \ */
|
||||
/* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
|
||||
/* OBSOLETE write_register (AP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
|
||||
/* OBSOLETE if (frame_length < 3) \ */
|
||||
/* OBSOLETE for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \ */
|
||||
/* OBSOLETE write_register (regnum, read_memory_integer (fp += 4, 4)); \ */
|
||||
/* OBSOLETE if (frame_length < 2) \ */
|
||||
/* OBSOLETE write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
|
||||
/* OBSOLETE fp -= 4; \ */
|
||||
/* OBSOLETE if (frame_length < 3) \ */
|
||||
/* OBSOLETE for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) { \ */
|
||||
/* OBSOLETE read_memory (fp += 8, buf, 8); \ */
|
||||
/* OBSOLETE write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \ */
|
||||
/* OBSOLETE if (frame_length < 2) { \ */
|
||||
/* OBSOLETE read_memory (fp += 8, buf, 8); \ */
|
||||
/* OBSOLETE write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \ */
|
||||
/* OBSOLETE else write_register (SP_REGNUM, fp + 8); \ */
|
||||
/* OBSOLETE flush_cached_frames (); \ */
|
||||
/* OBSOLETE } while (0) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* This sequence of words is the instructions */
|
||||
/* OBSOLETE mov sp,ap */
|
||||
/* OBSOLETE pshea 69696969 */
|
||||
/* OBSOLETE calls 32323232 */
|
||||
/* OBSOLETE bkpt */
|
||||
/* OBSOLETE Note this is 16 bytes. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CALL_DUMMY {0x50860d4069696969LL,0x2140323232327d50LL} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CALL_DUMMY_LENGTH 16 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Insert the specified number of args and function address */
|
||||
/* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */
|
||||
/* OBSOLETE { *(int *)((char *) dummyname + 4) = nargs; \ */
|
||||
/* OBSOLETE *(int *)((char *) dummyname + 10) = fun; } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Defs to read soff symbol tables, see dbxread.c *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define NUMBER_OF_SYMBOLS ((long) opthdr.o_nsyms) */
|
||||
/* OBSOLETE #define STRING_TABLE_OFFSET ((long) filehdr.h_strptr) */
|
||||
/* OBSOLETE #define SYMBOL_TABLE_OFFSET ((long) opthdr.o_symptr) */
|
||||
/* OBSOLETE #define STRING_TABLE_SIZE ((long) filehdr.h_strsiz) */
|
||||
/* OBSOLETE #define SIZE_OF_TEXT_SEGMENT ((long) txthdr.s_size) */
|
||||
/* OBSOLETE #define ENTRY_POINT ((long) opthdr.o_entry) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define READ_STRING_TABLE_SIZE(BUFFER) \ */
|
||||
/* OBSOLETE (BUFFER = STRING_TABLE_SIZE) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define DECLARE_FILE_HEADERS \ */
|
||||
/* OBSOLETE FILEHDR filehdr; \ */
|
||||
/* OBSOLETE OPTHDR opthdr; \ */
|
||||
/* OBSOLETE SCNHDR txthdr */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define READ_FILE_HEADERS(DESC,NAME) \ */
|
||||
/* OBSOLETE { \ */
|
||||
/* OBSOLETE int n; \ */
|
||||
/* OBSOLETE val = myread (DESC, &filehdr, sizeof filehdr); \ */
|
||||
/* OBSOLETE if (val < 0) \ */
|
||||
/* OBSOLETE perror_with_name (NAME); \ */
|
||||
/* OBSOLETE if (! IS_SOFF_MAGIC (filehdr.h_magic)) \ */
|
||||
/* OBSOLETE error ("%s: not an executable file.", NAME); \ */
|
||||
/* OBSOLETE lseek (DESC, 0L, 0); \ */
|
||||
/* OBSOLETE if (myread (DESC, &filehdr, sizeof filehdr) < 0) \ */
|
||||
/* OBSOLETE perror_with_name (NAME); \ */
|
||||
/* OBSOLETE if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0) \ */
|
||||
/* OBSOLETE perror_with_name (NAME); \ */
|
||||
/* OBSOLETE for (n = 0; n < filehdr.h_nscns; n++) \ */
|
||||
/* OBSOLETE { \ */
|
||||
/* OBSOLETE if (myread (DESC, &txthdr, sizeof txthdr) < 0) \ */
|
||||
/* OBSOLETE perror_with_name (NAME); \ */
|
||||
/* OBSOLETE if ((txthdr.s_flags & S_TYPMASK) == S_TEXT) \ */
|
||||
/* OBSOLETE break; \ */
|
||||
/* OBSOLETE } \ */
|
||||
/* OBSOLETE } */
|
||||
|
@ -1,35 +1,35 @@
|
||||
/* Definitions to make GDB run on Convex Unix (4bsd)
|
||||
Copyright 1989, 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define HOST_BYTE_ORDER BIG_ENDIAN
|
||||
|
||||
#define ATTACH_DETACH
|
||||
#define HAVE_WAIT_STRUCT
|
||||
#define NO_SIGINTERRUPT
|
||||
|
||||
/* Use SIGCONT rather than SIGTSTP because convex Unix occasionally
|
||||
turkeys SIGTSTP. I think. */
|
||||
|
||||
#define STOP_SIGNAL SIGCONT
|
||||
|
||||
/* Hook to call after creating inferior process. Now init_trace_fun
|
||||
is in the same place. So re-write this to use the init_trace_fun
|
||||
(making convex a debugging target). FIXME. */
|
||||
|
||||
#define CREATE_INFERIOR_HOOK create_inferior_hook
|
||||
/* OBSOLETE /* Definitions to make GDB run on Convex Unix (4bsd) */
|
||||
/* OBSOLETE Copyright 1989, 1991, 1992, 1996 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This file is part of GDB. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
||||
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
||||
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
||||
/* OBSOLETE (at your option) any later version. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
||||
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* OBSOLETE GNU General Public License for more details. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
||||
/* OBSOLETE along with this program; if not, write to the Free Software */
|
||||
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define ATTACH_DETACH */
|
||||
/* OBSOLETE #define HAVE_WAIT_STRUCT */
|
||||
/* OBSOLETE #define NO_SIGINTERRUPT */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Use SIGCONT rather than SIGTSTP because convex Unix occasionally */
|
||||
/* OBSOLETE turkeys SIGTSTP. I think. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STOP_SIGNAL SIGCONT */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Hook to call after creating inferior process. Now init_trace_fun */
|
||||
/* OBSOLETE is in the same place. So re-write this to use the init_trace_fun */
|
||||
/* OBSOLETE (making convex a debugging target). FIXME. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CREATE_INFERIOR_HOOK create_inferior_hook */
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Host: Altos 3068 (m68k, System V release 2)
|
||||
|
||||
XM_FILE= xm-altos.h
|
||||
XDEPFILES= infptrace.o inftarg.o fork-child.o altos-xdep.o
|
||||
# OBSOLETE # Host: Altos 3068 (m68k, System V release 2)
|
||||
# OBSOLETE
|
||||
# OBSOLETE XM_FILE= xm-altos.h
|
||||
# OBSOLETE XDEPFILES= infptrace.o inftarg.o fork-child.o altos-xdep.o
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Target: Altos 3068 (m68k, System V release 2)
|
||||
TDEPFILES= m68k-tdep.o
|
||||
TM_FILE= tm-altos.h
|
||||
# OBSOLETE # Target: Altos 3068 (m68k, System V release 2)
|
||||
# OBSOLETE TDEPFILES= m68k-tdep.o
|
||||
# OBSOLETE TM_FILE= tm-altos.h
|
||||
|
@ -1,44 +1,44 @@
|
||||
/* Target definitions for GDB on an Altos 3068 (m68k running SVR2)
|
||||
Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* The child target can't deal with floating registers. */
|
||||
#define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM)
|
||||
|
||||
/* Define BPT_VECTOR if it is different than the default.
|
||||
This is the vector number used by traps to indicate a breakpoint. */
|
||||
|
||||
#define BPT_VECTOR 0xe
|
||||
|
||||
/* Address of end of stack space. */
|
||||
|
||||
/*#define STACK_END_ADDR (0xffffff)*/
|
||||
#define STACK_END_ADDR (0x1000000)
|
||||
|
||||
/* Amount PC must be decremented by after a breakpoint.
|
||||
On the Altos, the kernel resets the pc to the trap instr */
|
||||
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
|
||||
/* The only reason this is here is the tm-altos.h reference below. It
|
||||
was moved back here from tm-m68k.h. FIXME? */
|
||||
|
||||
extern CORE_ADDR altos_skip_prologue PARAMS ((CORE_ADDR));
|
||||
#define SKIP_PROLOGUE(pc) (altos_skip_prologue (pc))
|
||||
|
||||
#include "m68k/tm-m68k.h"
|
||||
/* OBSOLETE /* Target definitions for GDB on an Altos 3068 (m68k running SVR2) */
|
||||
/* OBSOLETE Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This file is part of GDB. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
||||
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
||||
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
||||
/* OBSOLETE (at your option) any later version. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
||||
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* OBSOLETE GNU General Public License for more details. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
||||
/* OBSOLETE along with this program; if not, write to the Free Software */
|
||||
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* The child target can't deal with floating registers. *x/ */
|
||||
/* OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Define BPT_VECTOR if it is different than the default. */
|
||||
/* OBSOLETE This is the vector number used by traps to indicate a breakpoint. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define BPT_VECTOR 0xe */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Address of end of stack space. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /*#define STACK_END_ADDR (0xffffff)*x/ */
|
||||
/* OBSOLETE #define STACK_END_ADDR (0x1000000) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */
|
||||
/* OBSOLETE On the Altos, the kernel resets the pc to the trap instr *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* The only reason this is here is the tm-altos.h reference below. It */
|
||||
/* OBSOLETE was moved back here from tm-m68k.h. FIXME? *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE extern CORE_ADDR altos_skip_prologue PARAMS ((CORE_ADDR)); */
|
||||
/* OBSOLETE #define SKIP_PROLOGUE(pc) (altos_skip_prologue (pc)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include "m68k/tm-m68k.h" */
|
||||
|
@ -1,202 +1,202 @@
|
||||
/* Definitions to make GDB run on an Altos 3068 (m68k running SVR2)
|
||||
Copyright (C) 1987,1989 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define HOST_BYTE_ORDER BIG_ENDIAN
|
||||
|
||||
/* The altos support would make a good base for a port to other USGR2 systems
|
||||
(like the 3b1 and the Convergent miniframe). */
|
||||
|
||||
/* This is only needed in one file, but it's cleaner to put it here than
|
||||
putting in more #ifdef's. */
|
||||
#include <sys/page.h>
|
||||
#include <sys/net.h>
|
||||
|
||||
#define USG
|
||||
|
||||
#define HAVE_TERMIO
|
||||
|
||||
#define CBREAK XTABS /* It takes all kinds... */
|
||||
|
||||
#ifndef R_OK
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
#define F_OK 0
|
||||
#endif
|
||||
|
||||
/* Get sys/wait.h ie. from a Sun and edit it a little (mc68000 to m68k) */
|
||||
/* Why bother? */
|
||||
#if 0
|
||||
#define HAVE_WAIT_STRUCT
|
||||
#endif
|
||||
|
||||
/* This is the amount to subtract from u.u_ar0
|
||||
to get the offset in the core file of the register values. */
|
||||
|
||||
#define KERNEL_U_ADDR 0x1fbf000
|
||||
|
||||
#define REGISTER_U_ADDR(addr, blockend, regno) \
|
||||
{ if (regno <= SP_REGNUM) \
|
||||
addr = blockend + regno * 4; \
|
||||
else if (regno == PS_REGNUM) \
|
||||
addr = blockend + regno * 4 + 4; \
|
||||
else if (regno == PC_REGNUM) \
|
||||
addr = blockend + regno * 4 + 2; \
|
||||
}
|
||||
|
||||
#define REGISTER_ADDR(u_ar0, regno) \
|
||||
(((regno) < PS_REGNUM) \
|
||||
? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \
|
||||
: (((regno) == PS_REGNUM) \
|
||||
? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \
|
||||
: (&((struct exception_stack *) (u_ar0))->e_PC)))
|
||||
|
||||
#define FP_REGISTER_ADDR(u, regno) \
|
||||
(((char *) \
|
||||
(((regno) < FPC_REGNUM) \
|
||||
? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
|
||||
: (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
|
||||
- ((char *) (& u)))
|
||||
|
||||
|
||||
#ifndef __GNUC__
|
||||
#undef USE_GAS
|
||||
#define ALTOS_AS
|
||||
#else
|
||||
#define USE_GAS
|
||||
#endif
|
||||
|
||||
/* Motorola assembly format */
|
||||
#if !defined(USE_GAS) && !defined(ALTOS)
|
||||
#define MOTOROLA
|
||||
#endif
|
||||
|
||||
/* Interface definitions for kernel debugger KDB. */
|
||||
|
||||
/* Map machine fault codes into signal numbers.
|
||||
First subtract 0, divide by 4, then index in a table.
|
||||
Faults for which the entry in this table is 0
|
||||
are not handled by KDB; the program's own trap handler
|
||||
gets to handle then. */
|
||||
|
||||
#define FAULT_CODE_ORIGIN 0
|
||||
#define FAULT_CODE_UNITS 4
|
||||
#define FAULT_TABLE \
|
||||
{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
|
||||
0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
SIGILL }
|
||||
|
||||
/* Start running with a stack stretching from BEG to END.
|
||||
BEG and END should be symbols meaningful to the assembler.
|
||||
This is used only for kdb. */
|
||||
|
||||
#ifdef MOTOROLA
|
||||
#define INIT_STACK(beg, end) \
|
||||
{ asm (".globl end"); \
|
||||
asm ("move.l $ end, sp"); \
|
||||
asm ("clr.l fp"); }
|
||||
#else
|
||||
#ifdef ALTOS_AS
|
||||
#define INIT_STACK(beg, end) \
|
||||
{ asm ("global end"); \
|
||||
asm ("mov.l &end,%sp"); \
|
||||
asm ("clr.l %fp"); }
|
||||
#else
|
||||
#define INIT_STACK(beg, end) \
|
||||
{ asm (".globl end"); \
|
||||
asm ("movel $ end, sp"); \
|
||||
asm ("clrl fp"); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Push the frame pointer register on the stack. */
|
||||
#ifdef MOTOROLA
|
||||
#define PUSH_FRAME_PTR \
|
||||
asm ("move.l fp, -(sp)");
|
||||
#else
|
||||
#ifdef ALTOS_AS
|
||||
#define PUSH_FRAME_PTR \
|
||||
asm ("mov.l %fp, -(%sp)");
|
||||
#else
|
||||
#define PUSH_FRAME_PTR \
|
||||
asm ("movel fp, -(sp)");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Copy the top-of-stack to the frame pointer register. */
|
||||
#ifdef MOTOROLA
|
||||
#define POP_FRAME_PTR \
|
||||
asm ("move.l (sp), fp");
|
||||
#else
|
||||
#ifdef ALTOS_AS
|
||||
#define POP_FRAME_PTR \
|
||||
asm ("mov.l (%sp), %fp");
|
||||
#else
|
||||
#define POP_FRAME_PTR \
|
||||
asm ("movl (sp), fp");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* After KDB is entered by a fault, push all registers
|
||||
that GDB thinks about (all NUM_REGS of them),
|
||||
so that they appear in order of ascending GDB register number.
|
||||
The fault code will be on the stack beyond the last register. */
|
||||
|
||||
#ifdef MOTOROLA
|
||||
#define PUSH_REGISTERS \
|
||||
{ asm ("clr.w -(sp)"); \
|
||||
asm ("pea (10,sp)"); \
|
||||
asm ("movem $ 0xfffe,-(sp)"); }
|
||||
#else
|
||||
#ifdef ALTOS_AS
|
||||
#define PUSH_REGISTERS \
|
||||
{ asm ("clr.w -(%sp)"); \
|
||||
asm ("pea (10,%sp)"); \
|
||||
asm ("movm.l &0xfffe,-(%sp)"); }
|
||||
#else
|
||||
#define PUSH_REGISTERS \
|
||||
{ asm ("clrw -(sp)"); \
|
||||
asm ("pea 10(sp)"); \
|
||||
asm ("movem $ 0xfffe,-(sp)"); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Assuming the registers (including processor status) have been
|
||||
pushed on the stack in order of ascending GDB register number,
|
||||
restore them and return to the address in the saved PC register. */
|
||||
|
||||
#ifdef MOTOROLA
|
||||
#define POP_REGISTERS \
|
||||
{ asm ("subi.l $8,28(sp)"); \
|
||||
asm ("movem (sp),$ 0xffff"); \
|
||||
asm ("rte"); }
|
||||
#else
|
||||
#ifdef ALTOS_AS
|
||||
#define POP_REGISTERS \
|
||||
{ asm ("sub.l &8,28(%sp)"); \
|
||||
asm ("movem (%sp),&0xffff"); \
|
||||
asm ("rte"); }
|
||||
#else
|
||||
#define POP_REGISTERS \
|
||||
{ asm ("subil $8,28(sp)"); \
|
||||
asm ("movem (sp),$ 0xffff"); \
|
||||
asm ("rte"); }
|
||||
#endif
|
||||
#endif
|
||||
/* OBSOLETE /* Definitions to make GDB run on an Altos 3068 (m68k running SVR2) */
|
||||
/* OBSOLETE Copyright (C) 1987,1989 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This file is part of GDB. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
||||
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
||||
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
||||
/* OBSOLETE (at your option) any later version. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
||||
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* OBSOLETE GNU General Public License for more details. */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
||||
/* OBSOLETE along with this program; if not, write to the Free Software */
|
||||
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* The altos support would make a good base for a port to other USGR2 systems */
|
||||
/* OBSOLETE (like the 3b1 and the Convergent miniframe). *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* This is only needed in one file, but it's cleaner to put it here than */
|
||||
/* OBSOLETE putting in more #ifdef's. *x/ */
|
||||
/* OBSOLETE #include <sys/page.h> */
|
||||
/* OBSOLETE #include <sys/net.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define USG */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define HAVE_TERMIO */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CBREAK XTABS /* It takes all kinds... *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifndef R_OK */
|
||||
/* OBSOLETE #define R_OK 4 */
|
||||
/* OBSOLETE #define W_OK 2 */
|
||||
/* OBSOLETE #define X_OK 1 */
|
||||
/* OBSOLETE #define F_OK 0 */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Get sys/wait.h ie. from a Sun and edit it a little (mc68000 to m68k) *x/ */
|
||||
/* OBSOLETE /* Why bother? *x/ */
|
||||
/* OBSOLETE #if 0 */
|
||||
/* OBSOLETE #define HAVE_WAIT_STRUCT */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* This is the amount to subtract from u.u_ar0 */
|
||||
/* OBSOLETE to get the offset in the core file of the register values. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define KERNEL_U_ADDR 0x1fbf000 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ */
|
||||
/* OBSOLETE { if (regno <= SP_REGNUM) \ */
|
||||
/* OBSOLETE addr = blockend + regno * 4; \ */
|
||||
/* OBSOLETE else if (regno == PS_REGNUM) \ */
|
||||
/* OBSOLETE addr = blockend + regno * 4 + 4; \ */
|
||||
/* OBSOLETE else if (regno == PC_REGNUM) \ */
|
||||
/* OBSOLETE addr = blockend + regno * 4 + 2; \ */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_ADDR(u_ar0, regno) \ */
|
||||
/* OBSOLETE (((regno) < PS_REGNUM) \ */
|
||||
/* OBSOLETE ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \ */
|
||||
/* OBSOLETE : (((regno) == PS_REGNUM) \ */
|
||||
/* OBSOLETE ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \ */
|
||||
/* OBSOLETE : (&((struct exception_stack *) (u_ar0))->e_PC))) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FP_REGISTER_ADDR(u, regno) \ */
|
||||
/* OBSOLETE (((char *) \ */
|
||||
/* OBSOLETE (((regno) < FPC_REGNUM) \ */
|
||||
/* OBSOLETE ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \ */
|
||||
/* OBSOLETE : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \ */
|
||||
/* OBSOLETE - ((char *) (& u))) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifndef __GNUC__ */
|
||||
/* OBSOLETE #undef USE_GAS */
|
||||
/* OBSOLETE #define ALTOS_AS */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define USE_GAS */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Motorola assembly format *x/ */
|
||||
/* OBSOLETE #if !defined(USE_GAS) && !defined(ALTOS) */
|
||||
/* OBSOLETE #define MOTOROLA */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Interface definitions for kernel debugger KDB. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Map machine fault codes into signal numbers. */
|
||||
/* OBSOLETE First subtract 0, divide by 4, then index in a table. */
|
||||
/* OBSOLETE Faults for which the entry in this table is 0 */
|
||||
/* OBSOLETE are not handled by KDB; the program's own trap handler */
|
||||
/* OBSOLETE gets to handle then. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FAULT_CODE_ORIGIN 0 */
|
||||
/* OBSOLETE #define FAULT_CODE_UNITS 4 */
|
||||
/* OBSOLETE #define FAULT_TABLE \ */
|
||||
/* OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ */
|
||||
/* OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ */
|
||||
/* OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ */
|
||||
/* OBSOLETE SIGILL } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Start running with a stack stretching from BEG to END. */
|
||||
/* OBSOLETE BEG and END should be symbols meaningful to the assembler. */
|
||||
/* OBSOLETE This is used only for kdb. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef MOTOROLA */
|
||||
/* OBSOLETE #define INIT_STACK(beg, end) \ */
|
||||
/* OBSOLETE { asm (".globl end"); \ */
|
||||
/* OBSOLETE asm ("move.l $ end, sp"); \ */
|
||||
/* OBSOLETE asm ("clr.l fp"); } */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #ifdef ALTOS_AS */
|
||||
/* OBSOLETE #define INIT_STACK(beg, end) \ */
|
||||
/* OBSOLETE { asm ("global end"); \ */
|
||||
/* OBSOLETE asm ("mov.l &end,%sp"); \ */
|
||||
/* OBSOLETE asm ("clr.l %fp"); } */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define INIT_STACK(beg, end) \ */
|
||||
/* OBSOLETE { asm (".globl end"); \ */
|
||||
/* OBSOLETE asm ("movel $ end, sp"); \ */
|
||||
/* OBSOLETE asm ("clrl fp"); } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Push the frame pointer register on the stack. *x/ */
|
||||
/* OBSOLETE #ifdef MOTOROLA */
|
||||
/* OBSOLETE #define PUSH_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("move.l fp, -(sp)"); */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #ifdef ALTOS_AS */
|
||||
/* OBSOLETE #define PUSH_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("mov.l %fp, -(%sp)"); */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define PUSH_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("movel fp, -(sp)"); */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Copy the top-of-stack to the frame pointer register. *x/ */
|
||||
/* OBSOLETE #ifdef MOTOROLA */
|
||||
/* OBSOLETE #define POP_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("move.l (sp), fp"); */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #ifdef ALTOS_AS */
|
||||
/* OBSOLETE #define POP_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("mov.l (%sp), %fp"); */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define POP_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("movl (sp), fp"); */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* After KDB is entered by a fault, push all registers */
|
||||
/* OBSOLETE that GDB thinks about (all NUM_REGS of them), */
|
||||
/* OBSOLETE so that they appear in order of ascending GDB register number. */
|
||||
/* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef MOTOROLA */
|
||||
/* OBSOLETE #define PUSH_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("clr.w -(sp)"); \ */
|
||||
/* OBSOLETE asm ("pea (10,sp)"); \ */
|
||||
/* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #ifdef ALTOS_AS */
|
||||
/* OBSOLETE #define PUSH_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("clr.w -(%sp)"); \ */
|
||||
/* OBSOLETE asm ("pea (10,%sp)"); \ */
|
||||
/* OBSOLETE asm ("movm.l &0xfffe,-(%sp)"); } */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define PUSH_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("clrw -(sp)"); \ */
|
||||
/* OBSOLETE asm ("pea 10(sp)"); \ */
|
||||
/* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Assuming the registers (including processor status) have been */
|
||||
/* OBSOLETE pushed on the stack in order of ascending GDB register number, */
|
||||
/* OBSOLETE restore them and return to the address in the saved PC register. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef MOTOROLA */
|
||||
/* OBSOLETE #define POP_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("subi.l $8,28(sp)"); \ */
|
||||
/* OBSOLETE asm ("movem (sp),$ 0xffff"); \ */
|
||||
/* OBSOLETE asm ("rte"); } */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #ifdef ALTOS_AS */
|
||||
/* OBSOLETE #define POP_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("sub.l &8,28(%sp)"); \ */
|
||||
/* OBSOLETE asm ("movem (%sp),&0xffff"); \ */
|
||||
/* OBSOLETE asm ("rte"); } */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define POP_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("subil $8,28(sp)"); \ */
|
||||
/* OBSOLETE asm ("movem (sp),$ 0xffff"); \ */
|
||||
/* OBSOLETE asm ("rte"); } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE #endif */
|
||||
|
@ -11,7 +11,7 @@
|
||||
case "${host_cpu}" in
|
||||
|
||||
alpha*) gdb_host_cpu=alpha ;;
|
||||
c[12]) gdb_host_cpu=convex ;;
|
||||
# OBSOLETE c[12]) gdb_host_cpu=convex ;;
|
||||
hppa*) gdb_host_cpu=pa ;;
|
||||
i[3456]86*) gdb_host_cpu=i386 ;;
|
||||
m68*) gdb_host_cpu=m68k ;;
|
||||
@ -37,7 +37,7 @@ alpha*-*-linux*) gdb_host=alpha-linux ;;
|
||||
|
||||
arm-*-*) gdb_host=arm ;;
|
||||
|
||||
c[12]-*-*) gdb_host=convex ;;
|
||||
# OBSOLETE c[12]-*-*) gdb_host=convex ;;
|
||||
|
||||
hppa*-*-bsd*) gdb_host=hppabsd ;;
|
||||
hppa*-*-hiux*) gdb_host=hppahpux ;;
|
||||
@ -82,7 +82,7 @@ m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
|
||||
m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
|
||||
m68030-sony-*) gdb_host=news1000 ;;
|
||||
|
||||
m68*-altos-*) gdb_host=altos ;;
|
||||
# OBSOLETE m68*-altos-*) gdb_host=altos ;;
|
||||
m68*-apollo*-sysv*) gdb_host=apollo68v ;;
|
||||
m68*-apollo*-bsd*) gdb_host=apollo68b ;;
|
||||
m68*-att-*) gdb_host=3b1 ;;
|
||||
|
@ -13,7 +13,7 @@
|
||||
case "${target_cpu}" in
|
||||
|
||||
alpha*) gdb_target_cpu=alpha ;;
|
||||
c[12]) gdb_target_cpu=convex ;;
|
||||
# OBSOLETE c[12]) gdb_target_cpu=convex ;;
|
||||
hppa*) gdb_target_cpu=pa ;;
|
||||
i[3456]86*) gdb_target_cpu=i386 ;;
|
||||
m68*) gdb_target_cpu=m68k ;;
|
||||
@ -53,8 +53,8 @@ arc-*-*) gdb_target=arc ;;
|
||||
arm-*-* | thumb-*-* | strongarm-*-*)
|
||||
gdb_target=arm ;;
|
||||
|
||||
c1-*-*) gdb_target=convex ;;
|
||||
c2-*-*) gdb_target=convex ;;
|
||||
# OBSOLETE c1-*-*) gdb_target=convex ;;
|
||||
# OBSOLETE c2-*-*) gdb_target=convex ;;
|
||||
|
||||
d10v-*-*) gdb_target=d10v ;;
|
||||
d30v-*-*) gdb_target=d30v ;;
|
||||
@ -126,7 +126,7 @@ m68*-apollo*-bsd*) gdb_target=apollo68b ;;
|
||||
m68*-bull-sysv*) gdb_target=dpx2 ;;
|
||||
m68*-hp-bsd*) gdb_target=hp300bsd ;;
|
||||
m68*-hp-hpux*) gdb_target=hp300hpux ;;
|
||||
m68*-altos-*) gdb_target=altos ;;
|
||||
# OBSOLETE m68*-altos-*) gdb_target=altos ;;
|
||||
m68*-att-*) gdb_target=3b1 ;;
|
||||
m68*-cisco*-*) gdb_target=cisco ;;
|
||||
m68*-ericsson-*) gdb_target=es1800 ;;
|
||||
|
2554
gdb/convex-tdep.c
2554
gdb/convex-tdep.c
File diff suppressed because it is too large
Load Diff
1926
gdb/convex-xdep.c
1926
gdb/convex-xdep.c
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,29 @@
|
||||
Fri Jun 25 11:47:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* remote.texi (Communication Protocol): ``v'' is in use. Fix
|
||||
numerous formatting errors. Clarify ``i''. Mark ``i'', ``Z'',
|
||||
``z'' and ``qRcmd'' as draft instead of reserved. Identify
|
||||
packets that are not supported on all hosts. Expand examples.
|
||||
Spell check.
|
||||
|
||||
1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||
|
||||
* Makefile.in: Recognize html, install-html. Add targets
|
||||
to build HTML versions of documentation via texi2html.
|
||||
|
||||
Thu Jun 24 15:59:03 1999 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdbint.texinfo (Testsuite): New chapter, information about the
|
||||
testsuite.
|
||||
|
||||
Fri Jun 25 02:40:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* remote.texi (Communication Protocol): Rewrite.
|
||||
|
||||
Thu Jun 24 16:59:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* stabs.texinfo: Fix uses of xref.
|
||||
|
||||
Thu Jun 17 17:23:25 1999 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdbint.texinfo: Add an anti-printf exhortation, and update the
|
||||
|
@ -23,6 +23,7 @@ VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
|
||||
infodir = @infodir@
|
||||
htmldir = $(prefix)/html
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
@ -39,6 +40,9 @@ TEXIDIR=${gdbdir}/../texinfo
|
||||
# where to find makeinfo, preferably one designed for texinfo-2
|
||||
MAKEINFO=makeinfo
|
||||
|
||||
MAKEHTML = texi2html
|
||||
MAKEHTMLFLAGS = -glossary -menu -split_chapter
|
||||
|
||||
# where to find texi2roff, ditto
|
||||
TEXI2ROFF=texi2roff
|
||||
|
||||
@ -94,6 +98,7 @@ all install:
|
||||
info: gdb.info gdbint.info stabs.info
|
||||
dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi
|
||||
ps: gdb.ps gdbint.ps stabs.ps refcard.ps
|
||||
html: gdb_toc.html gdbint_toc.html stabs_toc.html
|
||||
all-doc: info dvi ps
|
||||
|
||||
install-info: info
|
||||
@ -101,6 +106,11 @@ install-info: info
|
||||
$(INSTALL_DATA) $$i $(infodir)/$$i ; \
|
||||
done
|
||||
|
||||
install-html: html
|
||||
for i in *.html ; do \
|
||||
$(INSTALL_DATA) $$i $(htmldir)/$$i ; \
|
||||
done
|
||||
|
||||
STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi
|
||||
|
||||
# Copy the object files from a particular stage into a subdirectory.
|
||||
@ -152,7 +162,7 @@ distclean: clean
|
||||
# "clean" or "distclean". Use maintainer-clean to remove them.
|
||||
|
||||
maintainer-clean realclean: distclean
|
||||
rm -f GDBvn.texi *.info* *.dvi *.ps
|
||||
rm -f GDBvn.texi *.info* *.dvi *.ps *.html
|
||||
|
||||
# GDB QUICK REFERENCE (dvi output)
|
||||
refcard.dvi : refcard.tex $(REFEDITS)
|
||||
@ -303,6 +313,11 @@ gdb.mm: $(SFILES_LOCAL) links2roff rluser.texinfo inc-hist.texi
|
||||
sed -e 's/---/\\(em/g' \
|
||||
>gdb.mm
|
||||
|
||||
# GDB MANUAL: HTML file
|
||||
|
||||
gdb_toc.html: ${SFILES_DOC}
|
||||
$(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
|
||||
|
||||
|
||||
# GDB INTERNALS MANUAL: TeX dvi file
|
||||
gdbint.dvi : gdbint.texinfo
|
||||
@ -320,9 +335,19 @@ gdbint.ps : gdbint.dvi
|
||||
gdbint.info: gdbint.texinfo
|
||||
$(MAKEINFO) -o gdbint.info $(srcdir)/gdbint.texinfo
|
||||
|
||||
# GDB INTERNALS MANUAL: HTML file
|
||||
|
||||
gdbint_toc.html: gdbint.texinfo
|
||||
$(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/gdbint.texinfo
|
||||
|
||||
stabs.info: stabs.texinfo
|
||||
$(MAKEINFO) -o stabs.info $(srcdir)/stabs.texinfo
|
||||
|
||||
# STABS DOCUMENTATION: HTML file
|
||||
|
||||
stabs_toc.html: stabs.texinfo
|
||||
$(MAKEHTML) $(MAKEHTMLFLAGS) $(srcdir)/stabs.texinfo
|
||||
|
||||
# STABS DOCUMENTATION: TeX dvi file
|
||||
stabs.dvi : stabs.texinfo
|
||||
$(SET_TEXINPUTS) $(TEX) stabs.texinfo
|
||||
|
@ -86,6 +86,7 @@ as the mechanisms that adapt GDB to specific hosts and targets.
|
||||
* Support Libraries::
|
||||
* Coding::
|
||||
* Porting GDB::
|
||||
* Testsuite::
|
||||
* Hints::
|
||||
@end menu
|
||||
|
||||
@ -2559,6 +2560,149 @@ files @file{gdb.info*} in the distribution. Note the plural;
|
||||
@code{makeinfo} will split the document into one overall file and five
|
||||
or so included files.
|
||||
|
||||
@node Testsuite
|
||||
|
||||
@chapter Testsuite
|
||||
|
||||
The testsuite is an important component of the GDB package. While it is
|
||||
always worthwhile to encourage user testing, in practice this is rarely
|
||||
sufficient; users typically use only a small subset of the available
|
||||
commands, and it has proven all too common for a change to cause a
|
||||
significant regression that went unnoticed for some time.
|
||||
|
||||
The GDB testsuite uses the DejaGNU testing framework. DejaGNU is built
|
||||
using tcl and expect. The tests themselves are calls to various tcl
|
||||
procs; the framework runs all the procs and summarizes the passes and
|
||||
fails.
|
||||
|
||||
@section Using the Testsuite
|
||||
|
||||
To run the testsuite, simply go to the GDB object directory (or to the
|
||||
testsuite's objdir) and type @code{make check}. This just sets up some
|
||||
environment variables and invokes DejaGNU's @code{runtest} script. While
|
||||
the testsuite is running, you'll get mentions of which test file is in use,
|
||||
and a mention of any unexpected passes or fails. When the testsuite is
|
||||
finished, you'll get a summary that looks like this:
|
||||
@example
|
||||
=== gdb Summary ===
|
||||
|
||||
# of expected passes 6016
|
||||
# of unexpected failures 58
|
||||
# of unexpected successes 5
|
||||
# of expected failures 183
|
||||
# of unresolved testcases 3
|
||||
# of untested testcases 5
|
||||
@end example
|
||||
The ideal test run consists of expected passes only; however, reality
|
||||
conspires to keep us from this ideal. Unexpected failures indicate
|
||||
real problems, whether in GDB or in the testsuite. Expected failures
|
||||
are still failures, but ones which have been decided are too hard to
|
||||
deal with at the time; for instance, a test case might work everywhere
|
||||
except on AIX, and there is no prospect of the AIX case being fixed in
|
||||
the near future. Expected failures should not be added lightly, since
|
||||
you may be masking serious bugs in GDB. Unexpected successes are expected
|
||||
fails that are passing for some reason, while unresolved and untested
|
||||
cases often indicate some minor catastrophe, such as the compiler being
|
||||
unable to deal with a test program.
|
||||
|
||||
When making any significant change to GDB, you should run the testsuite
|
||||
before and after the change, to confirm that there are no regressions.
|
||||
Note that truly complete testing would require that you run the
|
||||
testsuite with all supported configurations and a variety of compilers;
|
||||
however this is more than really necessary. In many cases testing with
|
||||
a single configuration is sufficient. Other useful options are to test
|
||||
one big-endian (Sparc) and one little-endian (x86) host, a cross config
|
||||
with a builtin simulator (powerpc-eabi, mips-elf), or a 64-bit host
|
||||
(Alpha).
|
||||
|
||||
If you add new functionality to GDB, please consider adding tests for it
|
||||
as well; this way future GDB hackers can detect and fix their changes
|
||||
that break the functionality you added. Similarly, if you fix a bug
|
||||
that was not previously reported as a test failure, please add a test
|
||||
case for it. Some cases are extremely difficult to test, such as code
|
||||
that handles host OS failures or bugs in particular versions of
|
||||
compilers, and it's OK not to try to write tests for all of those.
|
||||
|
||||
@section Testsuite Organization
|
||||
|
||||
The testsuite is entirely contained in @file{gdb/testsuite}. While the
|
||||
testsuite includes some makefiles and configury, these are very minimal,
|
||||
and used for little besides cleaning up, since the tests themselves
|
||||
handle the compilation of the programs that GDB will run. The file
|
||||
@file{testsuite/lib/gdb.exp} contains common utility procs useful for
|
||||
all GDB tests, while the directory @file{testsuite/config} contains
|
||||
configuration-specific files, typically used for special-purpose
|
||||
definitions of procs like @code{gdb_load} and @code{gdb_start}.
|
||||
|
||||
The tests themselves are to be found in @file{testsuite/gdb.*} and
|
||||
subdirectories of those. The names of the test files must always end
|
||||
with @file{.exp}. DejaGNU collects the test files by wildcarding
|
||||
in the test directories, so both subdirectories and individual files
|
||||
get chosen and run in alphabetical order.
|
||||
|
||||
The following table lists the main types of subdirectories and what they
|
||||
are for. Since DejaGNU finds test files no matter where they are
|
||||
located, and since each test file sets up its own compilation and
|
||||
execution environment, this organization is simply for convenience and
|
||||
intelligibility.
|
||||
|
||||
@table @code
|
||||
|
||||
@item gdb.base
|
||||
|
||||
This is the base testsuite. The tests in it should apply to all
|
||||
configurations of GDB (but generic native-only tests may live here).
|
||||
The test programs should be in the subset of C that is valid K&R,
|
||||
ANSI/ISO, and C++ (ifdefs are allowed if necessary, for instance
|
||||
for prototypes).
|
||||
|
||||
@item gdb.@var{lang}
|
||||
|
||||
Language-specific tests for all languages besides C. Examples are
|
||||
@file{gdb.c++} and @file{gdb.java}.
|
||||
|
||||
@item gdb.@var{platform}
|
||||
|
||||
Non-portable tests. The tests are specific to a specific configuration
|
||||
(host or target), such as HP-UX or eCos. Example is @file{gdb.hp}, for
|
||||
HP-UX.
|
||||
|
||||
@item gdb.@var{compiler}
|
||||
|
||||
Tests specific to a particular compiler. As of this writing (June
|
||||
1999), there aren't currently any groups of tests in this category that
|
||||
couldn't just as sensibly be made platform-specific, but one could
|
||||
imagine a gdb.gcc, for tests of GDB's handling of GCC extensions.
|
||||
|
||||
@item gdb.@var{subsystem}
|
||||
|
||||
Tests that exercise a specific GDB subsystem in more depth. For
|
||||
instance, @file{gdb.disasm} exercises various disassemblers, while
|
||||
@file{gdb.stabs} tests pathways through the stabs symbol reader.
|
||||
|
||||
@end table
|
||||
|
||||
@section Writing Tests
|
||||
|
||||
In many areas, the GDB tests are already quite comprehensive; you
|
||||
should be able to copy existing tests to handle new cases.
|
||||
|
||||
You should try to use @code{gdb_test} whenever possible, since it
|
||||
includes cases to handle all the unexpected errors that might happen.
|
||||
However, it doesn't cost anything to add new test procedures; for
|
||||
instance, @file{gdb.base/exprs.exp} defines a @code{test_expr} that
|
||||
calls @code{gdb_test} multiple times.
|
||||
|
||||
Only use @code{send_gdb} and @code{gdb_expect} when absolutely
|
||||
necessary, such as when GDB has several valid responses to a command.
|
||||
|
||||
The source language programs do @emph{not} need to be in a consistent
|
||||
style. Since GDB is used to debug programs written in many different
|
||||
styles, it's worth having a mix of styles in the testsuite; for
|
||||
instance, some GDB bugs involving the display of source lines would
|
||||
never manifest themselves if the programs used GNU coding style
|
||||
uniformly.
|
||||
|
||||
@node Hints
|
||||
|
||||
@chapter Hints
|
||||
|
@ -95,7 +95,7 @@ recently added stubs.
|
||||
* Stub Contents:: What the stub can do for you
|
||||
* Bootstrapping:: What you must do for the stub
|
||||
* Debug Session:: Putting it all together
|
||||
* Protocol:: Outline of the communication protocol
|
||||
* Protocol:: Definition of the communication protocol
|
||||
* Server:: Using the `gdbserver' program
|
||||
* NetWare:: Using the `gdbserve.nlm' program
|
||||
@end menu
|
||||
@ -365,79 +365,620 @@ the protocol---for example, if there is only one serial port to your
|
||||
target machine, you might want your program to do something special if
|
||||
it recognizes a packet meant for @value{GDBN}.
|
||||
|
||||
In the examples below, @samp{<-} and @samp{->} are used to indicate
|
||||
transmitted and received data respectfully.
|
||||
|
||||
@cindex protocol, @value{GDBN} remote serial
|
||||
@cindex serial protocol, @value{GDBN} remote
|
||||
@cindex remote serial protocol
|
||||
All @value{GDBN} commands and responses (other than acknowledgements, which
|
||||
are single characters) are sent as a packet which includes a
|
||||
checksum. A packet is introduced with the character @samp{$}, and ends
|
||||
with the character @samp{#} followed by a two-digit checksum:
|
||||
All @value{GDBN} commands and responses (other than acknowledgments)
|
||||
are sent as a @var{packet}. A @var{packet} is introduced with the
|
||||
character @samp{$}, this is followed by an optional two-digit
|
||||
@var{sequence-id} and the character @samp{:}, the actual
|
||||
@var{packet-data}, and the terminating character @samp{#} followed by a
|
||||
two-digit @var{checksum}:
|
||||
|
||||
@example
|
||||
$@var{packet info}#@var{checksum}
|
||||
@code{$}@var{packet-data}@code{#}@var{checksum}
|
||||
@end example
|
||||
@noindent
|
||||
or, with the optional @var{sequence-id}:
|
||||
@example
|
||||
@code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum}
|
||||
@end example
|
||||
|
||||
@cindex checksum, for @value{GDBN} remote
|
||||
@noindent
|
||||
@var{checksum} is computed as the modulo 256 sum of the @var{packet
|
||||
info} characters.
|
||||
The two-digit @var{checksum} is computed as the modulo 256 sum of all
|
||||
characters between the leading @samp{$} and the trailing @samp{#} (that
|
||||
consisting of both the optional @var{sequence-id}@code{:} and the actual
|
||||
@var{packet-data}).
|
||||
|
||||
@cindex sequence-id, for @value{GDBN} remote
|
||||
@noindent
|
||||
The two-digit @var{sequence-id}, when present, is returned with the
|
||||
acknowledgment. Beyond that its meaning is poorly defined.
|
||||
@value{GDBN} is not known to output @var{sequence-id}s.
|
||||
|
||||
When either the host or the target machine receives a packet, the first
|
||||
response expected is an acknowledgement: a single character, either
|
||||
@samp{+} (to indicate the package was received correctly) or @samp{-}
|
||||
(to request retransmission).
|
||||
response expected is an acknowledgment: either @samp{+} (to indicate
|
||||
the package was received correctly) or @samp{-} (to request
|
||||
retransmission):
|
||||
|
||||
The host (@value{GDBN}) sends commands, and the target (the debugging stub
|
||||
incorporated in your program) sends data in response. The target also
|
||||
sends data when your program stops.
|
||||
@example
|
||||
<- @code{$}@var{packet-data}@code{#}@var{checksum}
|
||||
-> @code{+}
|
||||
@end example
|
||||
@noindent
|
||||
If the received packet included a @var{sequence-id} than that is
|
||||
appended to a positive acknowledgment:
|
||||
|
||||
Command packets are distinguished by their first character, which
|
||||
identifies the kind of command.
|
||||
@example
|
||||
<- @code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum}
|
||||
-> @code{+}@var{sequence-id}
|
||||
@end example
|
||||
|
||||
These are some of the commands currently supported (for a complete list of
|
||||
commands, look in @file{gdb/remote.c.}):
|
||||
The host (@value{GDBN}) sends @var{command}s, and the target (the
|
||||
debugging stub incorporated in your program) sends a @var{response}. In
|
||||
the case of step and continue @var{command}s, the response is only sent
|
||||
when the operation has completed (the target has again stopped).
|
||||
|
||||
@table @code
|
||||
@item g
|
||||
Requests the values of CPU registers.
|
||||
@var{packet-data} consists of a sequence of characters with the
|
||||
exception of @samp{#} and @samp{$} (see @samp{X} packet for an
|
||||
exception). @samp{:} can not appear as the third character in a packet.
|
||||
Fields within the packet should be separated using @samp{,} and @samp{;}
|
||||
(unfortunately some packets chose to use @samp{:}). Except where
|
||||
otherwise noted all numbers are represented in HEX with leading zeros
|
||||
suppressed.
|
||||
|
||||
@item G
|
||||
Sets the values of CPU registers.
|
||||
Response @var{data} can be run-length encoded to save space. A @samp{*}
|
||||
means that the next character is an ASCII encoding giving a repeat count
|
||||
which stands for that many repetitions of the character preceding the
|
||||
@samp{*}. The encoding is @code{n+29}, yielding a printable character
|
||||
where @code{n >=3} (which is where rle starts to win). Don't use an
|
||||
@code{n > 126}.
|
||||
|
||||
@item m@var{addr},@var{count}
|
||||
Read @var{count} bytes at location @var{addr}.
|
||||
So:
|
||||
@example
|
||||
"@code{0* }"
|
||||
@end example
|
||||
@noindent
|
||||
means the same as "0000".
|
||||
|
||||
@item M@var{addr},@var{count}:@dots{}
|
||||
Write @var{count} bytes at location @var{addr}.
|
||||
The error response, returned for some packets includes a two character
|
||||
error number. That number is not well defined.
|
||||
|
||||
@need 500
|
||||
@item c
|
||||
@itemx c@var{addr}
|
||||
Resume execution at the current address (or at @var{addr} if supplied).
|
||||
For any @var{command} not supported by the stub, an empty response
|
||||
(@samp{$#00}) should be returned. That way it is possible to extend the
|
||||
protocol. A newer @value{GDBN} can tell if a packet is supported based
|
||||
on the response.
|
||||
|
||||
@need 500
|
||||
@item s
|
||||
@itemx s@var{addr}
|
||||
Step the target program for one instruction, from either the current
|
||||
program counter or from @var{addr} if supplied.
|
||||
Below is a complete list of all currently defined @var{command}s and
|
||||
their corresponding response @var{data}:
|
||||
|
||||
@item k
|
||||
Kill the target program.
|
||||
@multitable @columnfractions .30 .30 .40
|
||||
@item Packet
|
||||
@tab Request
|
||||
@tab Description
|
||||
|
||||
@item ?
|
||||
Report the most recent signal. To allow you to take advantage of the
|
||||
@value{GDBN} signal handling commands, one of the functions of the debugging
|
||||
stub is to report CPU traps as the corresponding POSIX signal values.
|
||||
@item extended ops @emph{(optional)}
|
||||
@tab @code{!}
|
||||
@tab
|
||||
Use the extended remote protocol. Sticky -- only needs to be set once.
|
||||
The extended remote protocol support the @samp{R} packet.
|
||||
@item
|
||||
@tab reply @samp{}
|
||||
@tab
|
||||
Stubs that support the extended remote protocol return @samp{} which,
|
||||
unfortunately, is identical to the response returned by stubs that do not
|
||||
support protocol extensions.
|
||||
|
||||
@item T
|
||||
Allows the remote stub to send only the registers that @value{GDBN} needs
|
||||
to make a quick decision about single-stepping or conditional breakpoints.
|
||||
This eliminates the need to fetch the entire register set for each instruction
|
||||
being stepped through.
|
||||
@item last signal
|
||||
@tab @code{?}
|
||||
@tab
|
||||
Reply the current reason for stopping. This is the same reply as is
|
||||
generated for step or cont : @code{S}@var{AA} where @var{AA} is the
|
||||
signal number.
|
||||
|
||||
@value{GDBN} now implements a write-through cache for registers and only
|
||||
re-reads the registers if the target has run.
|
||||
@end table
|
||||
@item reserved
|
||||
@tab @code{a}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item set program arguments @strong{(reserved)} @emph{(optional)}
|
||||
@tab @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,...}
|
||||
@tab
|
||||
Initialized @samp{argv[]} array passed into program. @var{arglen}
|
||||
specifies the number of bytes in the hex encoded byte stream @var{arg}.
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
|
||||
@item set baud @strong{(deprecated)}
|
||||
@tab @code{b}@var{baud}
|
||||
@tab
|
||||
Change the serial line speed to @var{baud}. JTC: @emph{When does the
|
||||
transport layer state change? When it's received, or after the ACK is
|
||||
transmitted. In either case, there are problems if the command or the
|
||||
acknowledgment packet is dropped.} Stan: @emph{If people really wanted
|
||||
to add something like this, and get it working for the first time, they
|
||||
ought to modify ser-unix.c to send some kind of out-of-band message to a
|
||||
specially-setup stub and have the switch happen "in between" packets, so
|
||||
that from remote protocol's point of view, nothing actually
|
||||
happened.}
|
||||
|
||||
@item set breakpoint @strong{(deprecated)}
|
||||
@tab @code{B}@var{addr},@var{mode}
|
||||
@tab
|
||||
Set (@var{mode} is @samp{S}) or clear (@var{mode} is @samp{C}) a
|
||||
breakpoint at @var{addr}. @emph{This has been replaced by the @samp{Z} and
|
||||
@samp{z} packets.}
|
||||
|
||||
@item continue
|
||||
@tab @code{c}@var{addr}
|
||||
@tab
|
||||
@var{addr} is address to resume. If @var{addr} is omitted, resume at
|
||||
current address.
|
||||
@item
|
||||
@tab reply
|
||||
@tab see below
|
||||
|
||||
@item continue with signal @emph{(optional)}
|
||||
@tab @code{C}@var{sig}@code{;}@var{addr}
|
||||
@tab
|
||||
Continue with signal @var{sig} (hex signal number). If
|
||||
@code{;}@var{addr} is omitted, resume at same address.
|
||||
@item
|
||||
@tab reply
|
||||
@tab see below
|
||||
|
||||
@item toggle debug @emph{(optional)}
|
||||
@tab @code{d}
|
||||
@tab
|
||||
toggle debug flag (see 386 & 68k stubs)
|
||||
|
||||
@item detach @emph{(optional)}
|
||||
@tab @code{D}
|
||||
@tab Reply OK.
|
||||
|
||||
@item reserved
|
||||
@tab @code{e}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{E}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{f}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{F}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item read registers
|
||||
@tab @code{g}
|
||||
@tab Read general registers.
|
||||
@item
|
||||
@tab reply @var{XX...}
|
||||
@tab
|
||||
Each byte of register data is described by two hex digits. The bytes
|
||||
with the register are transmitted in target byte order. The size of
|
||||
each register and their position within the @samp{g} @var{packet} is
|
||||
determined by the @var{REGISTER_RAW_SIZE} and @var{REGISTER_NAME}
|
||||
macros.
|
||||
@item
|
||||
@tab @code{E}@var{NN}
|
||||
@tab for an error.
|
||||
|
||||
@item write regs
|
||||
@tab @code{G}@var{XX...}
|
||||
@tab
|
||||
See @samp{g} for a description of the @var{XX...} data.
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab for success
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab for an error
|
||||
|
||||
@item reserved
|
||||
@tab @code{h}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item set thread @emph{(optional)}
|
||||
@tab @code{H}@var{c}@var{t...}
|
||||
@tab
|
||||
Set thread for subsequent operations. @var{c} = @samp{c} for thread
|
||||
used in step and continue; @var{t...} can be -1 for all threads.
|
||||
@var{c} = @samp{g} for thread used in other operations. If zero, pick a
|
||||
thread, any thread.
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab for success
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab for an error
|
||||
|
||||
@item cycle step @strong{(draft)} @emph{(optional)}
|
||||
@tab @code{i}@var{addr}@code{,}@var{nnn}
|
||||
@tab
|
||||
Step the remote target by a single clock cycle. If @code{,}@var{nnn} is
|
||||
present, cycle step @var{nnn} cycles. If @var{addr} is present, cycle
|
||||
step starting at that address.
|
||||
|
||||
@item signal then cycle step @strong{(reserved)} @emph{(optional)}
|
||||
@tab @code{I}
|
||||
@tab
|
||||
See @samp{i} and @samp{S} for likely syntax and semantics.
|
||||
|
||||
@item reserved
|
||||
@tab @code{j}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{J}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item kill request @emph{(optional)}
|
||||
@tab @code{k}
|
||||
@tab
|
||||
|
||||
@item reserved
|
||||
@tab @code{l}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{L}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item read memory
|
||||
@tab @code{m}@var{addr}@code{,}@var{length}
|
||||
@tab
|
||||
Read @var{length} bytes of memory starting at address @var{addr}.
|
||||
@item
|
||||
@tab reply @var{XX...}
|
||||
@tab
|
||||
@var{XX...} is mem contents. Can be fewer bytes than requested if able to
|
||||
read only part of the data.
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab @var{NN} is errno
|
||||
|
||||
@item write mem
|
||||
@tab @code{M}@var{addr},@var{length}@code{:}@var{XX...}
|
||||
@tab
|
||||
Write @var{length} bytes of memory starting at address @var{addr}.
|
||||
@var{XX...} is the data.
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab for success
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab
|
||||
for an error (this includes the case where only part of the data was
|
||||
written).
|
||||
|
||||
@item reserved
|
||||
@tab @code{n}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{N}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{o}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{O}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item read reg @strong{(reserved)}
|
||||
@tab @code{p}@var{n...}
|
||||
@tab
|
||||
See write register.
|
||||
@item
|
||||
@tab return @var{r....}
|
||||
@tab The hex encoded value of the register in target byte order.
|
||||
|
||||
@item write reg @emph{(optional)}
|
||||
@tab @code{P}@var{n...}@code{=}@var{r...}
|
||||
@tab
|
||||
Write register @var{n...} with value @var{r...}, which contains two hex
|
||||
digits for each byte in the register (target byte order).
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab for success
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab for an error
|
||||
|
||||
@item general query @emph{(optional)}
|
||||
@tab @code{q}@var{query}
|
||||
@tab
|
||||
Request info about @var{query}. In general @value{GDBN} @var{query}'s
|
||||
have a leading upper case letter. Custom vendor queries should use a
|
||||
leading lower case letter and a company prefix, ex: @samp{qfsf.var}.
|
||||
@var{query} may optionally be followed by a @samp{,} or @samp{;}
|
||||
separated list. Stubs should ensure that they fully match any
|
||||
@var{query} name.
|
||||
@item
|
||||
@tab reply @code{XX...}
|
||||
@tab Hex encoded data from query. The reply can not be empty.
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab error reply
|
||||
@item
|
||||
@tab reply @samp{}
|
||||
@tab Indicating an unrecognized @var{query}.
|
||||
|
||||
@item current thread
|
||||
@tab @code{q}@code{C}
|
||||
@tab Return the current thread id.
|
||||
@item
|
||||
@tab reply @code{QC}@var{pid}
|
||||
@tab
|
||||
Where @var{pid} is a HEX encoded 16 bit process id.
|
||||
@item
|
||||
@tab reply *
|
||||
@tab Any other reply implies the old pid.
|
||||
|
||||
@item compute CRC of memory block
|
||||
@tab @code{q}@code{CRC:}@var{addr}@code{,}@var{length}
|
||||
@tab
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab An error (such as memory fault)
|
||||
@item
|
||||
@tab reply @code{C}@var{CRC32}
|
||||
@tab A 32 bit cyclic redundancy check of the specified memory region.
|
||||
|
||||
@item query @var{LIST} or @var{threadLIST}
|
||||
@tab @code{q}@code{L}@var{startflag}@var{threadcount}@var{nextthread}
|
||||
@tab
|
||||
Obtain thread information from RTOS. @var{startflag} is one hex digit;
|
||||
@var{threadcount} is two hex digits; and @var{nextthread} is 16 hex
|
||||
digits.
|
||||
@item
|
||||
@tab reply *
|
||||
@tab
|
||||
See @code{remote.c:parse_threadlist_response()}.
|
||||
|
||||
@item query sect offs
|
||||
@tab @code{q}@code{Offsets}
|
||||
@tab Get section offsets.
|
||||
@item
|
||||
@tab reply @code{Text=}@var{xxx}@code{;Data=}@var{yyy}@code{;Bss=}@var{zzz}
|
||||
|
||||
@item thread info request
|
||||
@tab @code{q}@code{P}@var{mode}@var{threadid}
|
||||
@tab
|
||||
Returns information on @var{threadid}. Where: @var{mode} is a hex
|
||||
encoded 32 bit mode; @var{threadid} is a hex encoded 64 bit thread ID.
|
||||
@item
|
||||
@tab reply *
|
||||
@tab
|
||||
See @code{remote.c:remote_unpack_thread_info_response()}.
|
||||
|
||||
@item remote command @strong{(reserved)}
|
||||
@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
|
||||
stubs's interpreter may have security implications}.
|
||||
@item
|
||||
@tab reply @var{OUTPUT}
|
||||
@tab
|
||||
The @var{OUTPUT} (hex encoded). Must be non-empty.
|
||||
@item
|
||||
@tab reply @samp{}
|
||||
@tab
|
||||
When @samp{q}@samp{Rcmd} is not recognized.
|
||||
|
||||
@item general set @emph{(optional)}
|
||||
@tab @code{Q}@var{var}@code{=}@var{val}
|
||||
@tab
|
||||
Set value of @var{var} to @var{val}. See @samp{q} for a discussing of
|
||||
naming conventions.
|
||||
|
||||
@item reset @emph{(optional)}
|
||||
@tab r
|
||||
@tab reset -- see sparc stub.
|
||||
|
||||
@item remote restart @emph{(optional)}
|
||||
@tab @code{R}@var{XX}
|
||||
@tab
|
||||
Restart the remote server. @var{XX} while needed has no clear
|
||||
definition.
|
||||
|
||||
@item step @emph{(optional)}
|
||||
@tab @code{s}@var{addr}
|
||||
@tab
|
||||
@var{addr} is address to resume. If @var{addr} is omitted, resume at
|
||||
same address.
|
||||
@item
|
||||
@tab reply
|
||||
@tab see below
|
||||
|
||||
@item step with signal @emph{(optional)}
|
||||
@tab @code{S}@var{sig}@code{;}@var{addr}
|
||||
@tab
|
||||
Like @samp{C} but step not continue.
|
||||
@item
|
||||
@tab reply
|
||||
@tab see below
|
||||
|
||||
@item search @emph{(optional)}
|
||||
@tab @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM}
|
||||
@tab
|
||||
Search backwards starting at address @var{addr} for a match with pattern
|
||||
@var{PP} and mask @var{MM}. @var{PP} and @var{MM} are 4
|
||||
bytes. @var{addr} must be at least 3 digits.
|
||||
|
||||
@item thread alive @emph{(optional)}
|
||||
@tab @code{T}@var{XX}
|
||||
@tab Find out if the thread XX is alive.
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab thread is still alive
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab thread is dead
|
||||
|
||||
@item reserved
|
||||
@tab @code{u}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{U}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{v}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{V}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{w}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{W}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{x}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item write mem (binary) @emph{(optional)}
|
||||
@tab @code{X}@var{addr}@code{,}@var{length}@var{:}@var{XX...}
|
||||
@tab
|
||||
@var{addr} is address, @var{length} is number of bytes, @var{XX...} is
|
||||
binary data.
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab for success
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab for an error
|
||||
|
||||
@item reserved
|
||||
@tab @code{y}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item reserved
|
||||
@tab @code{Y}
|
||||
@tab Reserved for future use
|
||||
|
||||
@item remove break or watchpoint @strong{(draft)} @emph{(optional)}
|
||||
@tab @code{z}@var{t}@code{,}@var{addr}@code{,}@var{length}
|
||||
@tab
|
||||
See @samp{Z}.
|
||||
|
||||
@item insert break or watchpoint @strong{(draft)} @emph{(optional)}
|
||||
@tab @code{Z}@var{t}@code{,}@var{addr}@code{,}@var{length}
|
||||
@tab
|
||||
@var{t} is type: @samp{0} - software breakpoint, @samp{1} - hardware
|
||||
breakpoint, @samp{2} - write watchpoint, @samp{3} - read watchpoint,
|
||||
@samp{4} - access watchpoint; @var{addr} is address; @var{length} is in
|
||||
bytes. For a software breakpoint, @var{length} specifies the size of
|
||||
the instruction to be patched. For hardware breakpoints and watchpoints
|
||||
@var{length} specifies the memory region to be monitored.
|
||||
@item
|
||||
@tab reply @code{E}@var{NN}
|
||||
@tab for an error
|
||||
@item
|
||||
@tab reply @code{OK}
|
||||
@tab for success
|
||||
@item
|
||||
@tab @samp{}
|
||||
@tab If not supported.
|
||||
|
||||
@item reserved
|
||||
@tab <other>
|
||||
@tab Reserved for future use
|
||||
|
||||
@end multitable
|
||||
|
||||
In the case of the @samp{C}, @samp{c}, @samp{S} and @samp{s} packets,
|
||||
there is no immediate response. The reply, described below, comes when
|
||||
the machine stops:
|
||||
|
||||
@multitable @columnfractions .4 .6
|
||||
|
||||
@item @code{S}@var{AA}
|
||||
@tab @var{AA} is the signal number
|
||||
|
||||
@item @code{T}@var{AA}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;}
|
||||
@tab
|
||||
@var{AA} = two hex digit signal number; @var{n...} = register number
|
||||
(hex), @var{r...} = target byte ordered register contents, size defined
|
||||
by @code{REGISTER_RAW_SIZE}; @var{n...} = @samp{thread}, @var{r...} =
|
||||
thread process ID, this is a hex integer; @var{n...} = other string not
|
||||
starting with valid hex digit. @value{GDBN} should ignore this
|
||||
@var{n...}, @var{r...} pair and go on to the next. This way we can
|
||||
extend the protocol.
|
||||
|
||||
@item @code{W}@var{AA}
|
||||
@tab
|
||||
The process exited, and @var{AA} is the exit status. This is only
|
||||
applicable for certains sorts of targets.
|
||||
|
||||
@item @code{X}@var{AA}
|
||||
@tab
|
||||
The process terminated with signal @var{AA}.
|
||||
|
||||
@item @code{N}@var{AA}@code{;}@var{tttttttt}@code{;}@var{dddddddd}@code{;}@var{bbbbbbbb} @strong{(obsolete)}
|
||||
@tab
|
||||
@var{AA} = signal number; @var{tttttttt} = address of symbol "_start";
|
||||
@var{dddddddd} = base of data section; @var{bbbbbbbb} = base of bss
|
||||
section. @emph{Note: only used by Cisco Systems targets. The difference
|
||||
between this reply and the "qOffsets" query is that the 'N' packet may
|
||||
arrive spontaneously whereas the 'qOffsets' is a query initiated by the
|
||||
host debugger.}
|
||||
|
||||
@item @code{O}@var{XX...}
|
||||
@tab
|
||||
@var{XX...} is hex encoding of ASCII data. This can happen at any time
|
||||
while the program is running and the debugger should continue to wait
|
||||
for 'W', 'T', etc.
|
||||
|
||||
@end multitable
|
||||
|
||||
Example sequence of a target being re-started. Notice how the restart
|
||||
does not get any direct output:
|
||||
|
||||
@example
|
||||
<- @code{R00}
|
||||
-> @code{+}
|
||||
@emph{target restarts}
|
||||
<- @code{?}
|
||||
-> @code{+}
|
||||
-> @code{T001:1234123412341234}
|
||||
<- @code{+}
|
||||
@end example
|
||||
|
||||
Example sequence of a target being stepped by a single instruction:
|
||||
|
||||
@example
|
||||
<- @code{G1445...}
|
||||
-> @code{+}
|
||||
<- @code{s}
|
||||
-> @code{+}
|
||||
@emph{time passes}
|
||||
-> @code{T001:1234123412341234}
|
||||
<- @code{+}
|
||||
<- @code{g}
|
||||
-> @code{+}
|
||||
-> @code{1455...}
|
||||
<- @code{+}
|
||||
@end example
|
||||
|
||||
@kindex set remotedebug
|
||||
@kindex show remotedebug
|
||||
|
@ -872,7 +872,7 @@ produces the following stabs:
|
||||
.stabn 224,0,0,LBE2 # @r{224 is N_RBRAC}
|
||||
@end example
|
||||
|
||||
@xref{Procedures} for more information on the @code{N_FUN} stab, and
|
||||
See @ref{Procedures} for more information on the @code{N_FUN} stab, and
|
||||
@ref{Block Structure} for more information on the @code{N_LBRAC} and
|
||||
@code{N_RBRAC} stabs.
|
||||
|
||||
@ -3370,7 +3370,7 @@ for more information about their use.
|
||||
Variable on the stack; see @ref{Stack Variables}.
|
||||
|
||||
@item :
|
||||
C++ nested symbol; see @xref{Nested Symbols}
|
||||
C++ nested symbol; see @xref{Nested Symbols}.
|
||||
|
||||
@item a
|
||||
Parameter passed by reference in register; see @ref{Reference Parameters}.
|
||||
|
@ -119,8 +119,10 @@ 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 invoke_async_signal_handler PARAMS ((void));
|
||||
static int gdb_wait_for_event PARAMS ((void));
|
||||
static int gdb_do_one_event PARAMS ((void));
|
||||
static int check_async_ready PARAMS ((void));
|
||||
|
||||
|
||||
@ -236,7 +238,7 @@ process_event ()
|
||||
wait for something to happen (via gdb_wait_for_event), then process
|
||||
it. Returns 1 if something was done otherwise returns 0 (this can
|
||||
happen if there are no event sources to wait for). */
|
||||
int
|
||||
static int
|
||||
gdb_do_one_event ()
|
||||
{
|
||||
int result = 0;
|
||||
@ -278,6 +280,9 @@ gdb_do_one_event ()
|
||||
} /* end of if !set_top_level */
|
||||
else
|
||||
{
|
||||
/* FIXME: this should really be a call to a hook that is
|
||||
interface specific, because interfaces can display the
|
||||
prompt in their own way. */
|
||||
display_gdb_prompt (0);
|
||||
/* Maybe better to set a flag to be checked somewhere as to
|
||||
whether display the prompt or not. */
|
||||
@ -285,8 +290,42 @@ gdb_do_one_event ()
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Start up the event loop. This is the entry point to the event loop
|
||||
from the command loop. */
|
||||
void
|
||||
start_event_loop ()
|
||||
{
|
||||
/* Loop until there is something to do. This is the entry point to
|
||||
the event loop engine. gdb_do_one_event will process one event
|
||||
for each invocation. It always returns 1, unless there are no
|
||||
more event sources registered. In this case it returns 0. */
|
||||
while (gdb_do_one_event () != 0)
|
||||
;
|
||||
|
||||
/* We are done with the event loop. There are no more event sources
|
||||
to listen to. So we exit GDB. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Wrapper function for create_file_handler, so that the caller
|
||||
doesn't have to know implementation details about the use of poll
|
||||
vs. select. */
|
||||
void
|
||||
add_file_handler (fd, proc, client_data)
|
||||
int fd;
|
||||
file_handler_func *proc;
|
||||
gdb_client_data client_data;
|
||||
{
|
||||
#ifdef HAVE_POLL
|
||||
create_file_handler (fd, POLLIN, (file_handler_func *) proc, client_data);
|
||||
#else
|
||||
create_file_handler (fd, GDB_READABLE, (file_handler_func *) proc, client_data);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Add a file handler/descriptor to the list of descriptors we are
|
||||
interested in.
|
||||
FD is the file descriptor for the file/stream to be listened to.
|
||||
@ -297,7 +336,7 @@ gdb_do_one_event ()
|
||||
For the select case, MASK is a combination of READABLE, WRITABLE, EXCEPTION.
|
||||
PROC is the procedure that will be called when an event occurs for
|
||||
FD. CLIENT_DATA is the argument to pass to PROC. */
|
||||
void
|
||||
static void
|
||||
create_file_handler (fd, mask, proc, client_data)
|
||||
int fd;
|
||||
int mask;
|
||||
|
@ -222,28 +222,33 @@ struct prompts
|
||||
#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
|
||||
#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
|
||||
|
||||
/* Exported functions from event-top.c */
|
||||
/* Exported functions from event-loop.c */
|
||||
|
||||
extern void start_event_loop PARAMS ((void));
|
||||
extern void delete_file_handler PARAMS ((int));
|
||||
extern void
|
||||
create_file_handler PARAMS ((int, int, file_handler_func, gdb_client_data));
|
||||
extern int gdb_do_one_event PARAMS ((void));
|
||||
extern void add_file_handler PARAMS ((int, file_handler_func, 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));
|
||||
extern void delete_async_signal_handler PARAMS ((async_signal_handler *async_handler_ptr));
|
||||
|
||||
/* Exported functions from event-top.c.
|
||||
FIXME: these should really go into top.h. */
|
||||
|
||||
extern void display_gdb_prompt PARAMS ((char*));
|
||||
extern void start_event_loop PARAMS ((void));
|
||||
extern void async_init_signals PARAMS ((void));
|
||||
extern void set_async_editing_command PARAMS ((char *, int, struct cmd_list_element *));
|
||||
extern void set_async_annotation_level PARAMS ((char *, int, struct cmd_list_element *));
|
||||
extern void set_async_prompt PARAMS ((char *, int, struct cmd_list_element *));
|
||||
extern void handle_stop_sig PARAMS ((int));
|
||||
extern void gdb_readline2 PARAMS ((void));
|
||||
|
||||
/* Exported variables from event-top.c */
|
||||
/* Exported variables from event-top.c.
|
||||
FIXME: these should really go into top.h. */
|
||||
|
||||
extern int async_command_editing_p;
|
||||
extern char *async_annotation_suffix;
|
||||
extern char *new_async_prompt;
|
||||
extern struct prompts the_prompts;
|
||||
|
||||
extern void (*call_readline) PARAMS ((void));
|
||||
extern void (*input_handler) PARAMS ((char *));
|
||||
|
@ -20,9 +20,6 @@
|
||||
|
||||
#include "defs.h"
|
||||
#include "top.h"
|
||||
#ifdef HAVE_POLL
|
||||
#include <poll.h>
|
||||
#endif
|
||||
#include "inferior.h"
|
||||
#include "terminal.h" /* for job_control*/
|
||||
#include <signal.h>
|
||||
@ -38,7 +35,7 @@
|
||||
extern void _initialize_event_loop PARAMS ((void));
|
||||
|
||||
static void command_line_handler PARAMS ((char *));
|
||||
static void gdb_readline2 PARAMS ((void));
|
||||
void gdb_readline2 PARAMS ((void));
|
||||
static void pop_prompt PARAMS ((void));
|
||||
static void push_prompt PARAMS ((char *, char *, char *));
|
||||
static void change_line_handler PARAMS ((void));
|
||||
@ -160,9 +157,9 @@ readline_input_state;
|
||||
|
||||
|
||||
/* Initialize all the necessary variables, start the event loop,
|
||||
register readline, and stdin. */
|
||||
register readline, and stdin, start the loop. */
|
||||
void
|
||||
start_event_loop ()
|
||||
cli_command_loop ()
|
||||
{
|
||||
int length;
|
||||
char *a_prompt;
|
||||
@ -185,16 +182,8 @@ start_event_loop ()
|
||||
else
|
||||
display_gdb_prompt (0);
|
||||
|
||||
/* Loop until there is something to do. This is the entry point to
|
||||
the event loop engine. gdb_do_one_event will process one event
|
||||
for each invocation. It always returns 1, unless there are no
|
||||
more event sources registered. In this case it returns 0. */
|
||||
while (gdb_do_one_event () != 0)
|
||||
;
|
||||
|
||||
/* We are done with the event loop. There are no more event sources
|
||||
to listen to. So we exit GDB. */
|
||||
return;
|
||||
/* Now it's time to start the event loop. */
|
||||
start_event_loop ();
|
||||
}
|
||||
|
||||
/* Change the function to be invoked every time there is a character
|
||||
@ -227,14 +216,13 @@ change_line_handler ()
|
||||
input file descriptor, we need to create a new event source,
|
||||
corresponding to the same fd, but with a new event handler
|
||||
function. */
|
||||
/* NOTE: this operates on input_fd, not instream. If we are reading
|
||||
commands from a file, instream will point to the file. However in
|
||||
async mode, we always read commands from a file with editing
|
||||
off. This means that the 'set editing on/off' will have effect
|
||||
only on the interactive session. */
|
||||
delete_file_handler (input_fd);
|
||||
#ifdef HAVE_POLL
|
||||
create_file_handler (input_fd, POLLIN,
|
||||
(file_handler_func *) call_readline, 0);
|
||||
#else
|
||||
create_file_handler (input_fd, GDB_READABLE,
|
||||
(file_handler_func *) call_readline, 0);
|
||||
#endif
|
||||
add_file_handler (input_fd, (file_handler_func *) call_readline, 0);
|
||||
}
|
||||
|
||||
/* Displays the prompt. The prompt that is displayed is the current
|
||||
@ -682,7 +670,7 @@ command_line_handler (rl)
|
||||
/* NOTE: 1999-04-30 Asynchronous version of gdb_readline. gdb_readline
|
||||
will become obsolete when the event loop is made the default
|
||||
execution for gdb. */
|
||||
static void
|
||||
void
|
||||
gdb_readline2 ()
|
||||
{
|
||||
int c;
|
||||
@ -1001,9 +989,12 @@ _initialize_event_loop ()
|
||||
rl_instream = instream;
|
||||
|
||||
/* 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);
|
||||
|
||||
/* Tell gdb to use the cli_command_loop as the main loop. */
|
||||
command_loop_hook = cli_command_loop;
|
||||
|
||||
/* Now we need to create the event sources for the input file
|
||||
descriptor. */
|
||||
/* At this point in time, this is the only event source that we
|
||||
@ -1011,13 +1002,12 @@ _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. */
|
||||
#ifdef HAVE_POLL
|
||||
create_file_handler (input_fd, POLLIN,
|
||||
(file_handler_func *) call_readline, 0);
|
||||
#else
|
||||
create_file_handler (input_fd, GDB_READABLE,
|
||||
(file_handler_func *) call_readline, 0);
|
||||
#endif
|
||||
add_file_handler (input_fd, (file_handler_func *) call_readline, 0);
|
||||
|
||||
/* Tell gdb that we will be using the readline library. This
|
||||
could be overwritten by a command in .gdbinit like 'set
|
||||
editing on' or 'off'. */
|
||||
async_command_editing_p = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ extern void generic_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR
|
||||
int nargs, struct value **args,
|
||||
struct type *type, int gcc_p));
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef __STDC__
|
||||
/* Some native compilers, even ones that are supposed to be ANSI and for which __STDC__
|
||||
is true, complain about forward decls of enums. */
|
||||
enum lval_type;
|
||||
|
@ -37,6 +37,7 @@ man7dir = $(mandir)/man7
|
||||
man8dir = $(mandir)/man8
|
||||
man9dir = $(mandir)/man9
|
||||
infodir = $(prefix)/info
|
||||
htmldir = $(prefix)/html
|
||||
includedir = $(prefix)/include
|
||||
|
||||
SHELL = /bin/sh
|
||||
@ -159,6 +160,8 @@ installcheck:
|
||||
check:
|
||||
info dvi:
|
||||
install-info:
|
||||
html:
|
||||
install-html:
|
||||
clean-info:
|
||||
|
||||
gdbserver: $(OBS) ${ADD_DEPS} ${CDEPS}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Top level stuff for GDB, the GNU debugger.
|
||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995
|
||||
Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 1999
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
@ -48,7 +48,7 @@ int display_space;
|
||||
invoked on the command line with the -nw --async options. In this
|
||||
version, the usual command_loop is substituted by and event loop which
|
||||
processes UI events asynchronously. */
|
||||
int async_p = 0;
|
||||
int async_p = 1;
|
||||
|
||||
/* Whether this is the command line version or not */
|
||||
int tui_version = 0;
|
||||
@ -390,10 +390,6 @@ main (argc, argv)
|
||||
quiet = 1;
|
||||
}
|
||||
|
||||
/* Get ready to invoke the event loop instead of the
|
||||
command_loop. See event-loop.h for more details.*/
|
||||
if (async_p)
|
||||
command_loop_hook = start_event_loop;
|
||||
#if defined(TUI)
|
||||
/* Should this be moved to tui-top.c:_initialize_tui()? */
|
||||
if (tui_version)
|
||||
|
@ -41,6 +41,7 @@ man7dir = $(mandir)/man7
|
||||
man8dir = $(mandir)/man8
|
||||
man9dir = $(mandir)/man9
|
||||
infodir = @infodir@
|
||||
htmldir = $(prefix)/html
|
||||
includedir = @includedir@
|
||||
|
||||
SHELL = @SHELL@
|
||||
@ -115,6 +116,8 @@ check:
|
||||
info dvi:
|
||||
install-info:
|
||||
clean-info:
|
||||
html:
|
||||
install-html:
|
||||
|
||||
gdbserve.nlm: gdbserve.O $(srcdir)/gdbserve.def
|
||||
${NLMCONV_FOR_TARGET} -T $(srcdir)/gdbserve.def
|
||||
|
@ -28,6 +28,7 @@ sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
htmldir = $(prefix)/html
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
@ -234,6 +235,8 @@ distdir: $(DISTFILES)
|
||||
info:
|
||||
dvi:
|
||||
check:
|
||||
html:
|
||||
install-html:
|
||||
installcheck:
|
||||
install-info:
|
||||
install-exec:
|
||||
|
60
gdb/remote.c
60
gdb/remote.c
@ -485,7 +485,7 @@ set_thread (th, gen)
|
||||
int th;
|
||||
int gen;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
int state = gen ? general_thread : continue_thread;
|
||||
|
||||
if (state == th)
|
||||
@ -1059,7 +1059,7 @@ remote_get_threadinfo (threadid, fieldset, info)
|
||||
struct gdb_ext_thread_info *info;
|
||||
{
|
||||
int result;
|
||||
char threadinfo_pkt[PBUFSIZ];
|
||||
char *threadinfo_pkt = alloca (PBUFSIZ);
|
||||
|
||||
pack_threadinfo_request (threadinfo_pkt, fieldset, threadid);
|
||||
putpkt (threadinfo_pkt);
|
||||
@ -1146,8 +1146,8 @@ remote_get_threadlist (startflag, nextthread, result_limit,
|
||||
|
||||
{
|
||||
static threadref echo_nextthread;
|
||||
char threadlist_packet[PBUFSIZ];
|
||||
char t_response[PBUFSIZ];
|
||||
char *threadlist_packet = alloca (PBUFSIZ);
|
||||
char *t_response = alloca (PBUFSIZ);
|
||||
int result = 1;
|
||||
|
||||
/* Trancate result limit to be smaller than the packet size */
|
||||
@ -1267,7 +1267,7 @@ static int
|
||||
remote_current_thread (oldpid)
|
||||
int oldpid;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
|
||||
putpkt ("qC");
|
||||
getpkt (buf, 0);
|
||||
@ -1291,7 +1291,8 @@ remote_find_new_threads ()
|
||||
static void
|
||||
remote_threads_info (void)
|
||||
{
|
||||
char buf[PBUFSIZ], *bufp;
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
char *bufp;
|
||||
int tid;
|
||||
|
||||
if (remote_desc == 0) /* paranoia */
|
||||
@ -1323,7 +1324,7 @@ remote_threads_info (void)
|
||||
static void
|
||||
extended_remote_restart ()
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
|
||||
/* Send the restart command; for reasons I don't understand the
|
||||
remote side really expects a number after the "R". */
|
||||
@ -1354,7 +1355,8 @@ remote_close (quitting)
|
||||
static void
|
||||
get_offsets ()
|
||||
{
|
||||
char buf[PBUFSIZ], *ptr;
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
char *ptr;
|
||||
int lose;
|
||||
CORE_ADDR text_addr, data_addr, bss_addr;
|
||||
struct section_offsets *offs;
|
||||
@ -1414,7 +1416,7 @@ get_offsets ()
|
||||
if (symfile_objfile == NULL)
|
||||
return;
|
||||
|
||||
offs = (struct section_offsets *) alloca (sizeof (struct section_offsets)
|
||||
offs = alloca (sizeof (struct section_offsets)
|
||||
+ symfile_objfile->num_sections
|
||||
* sizeof (offs->offsets));
|
||||
memcpy (offs, symfile_objfile->section_offsets,
|
||||
@ -1697,7 +1699,7 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
|
||||
if (extended_p)
|
||||
{
|
||||
/* tell the remote that we're using the extended protocol. */
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
putpkt ("!");
|
||||
getpkt (buf, 0);
|
||||
}
|
||||
@ -1713,7 +1715,7 @@ remote_detach (args, from_tty)
|
||||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
|
||||
if (args)
|
||||
error ("Argument given to \"detach\" when remotely debugging.");
|
||||
@ -1766,7 +1768,7 @@ remote_resume (pid, step, siggnal)
|
||||
int pid, step;
|
||||
enum target_signal siggnal;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
|
||||
if (pid == -1)
|
||||
set_thread (0, 0); /* run any thread */
|
||||
@ -1896,7 +1898,7 @@ remote_wait (pid, status)
|
||||
int pid;
|
||||
struct target_waitstatus *status;
|
||||
{
|
||||
unsigned char buf[PBUFSIZ];
|
||||
unsigned char *buf = alloca (PBUFSIZ);
|
||||
int thread_num = -1;
|
||||
|
||||
status->kind = TARGET_WAITKIND_EXITED;
|
||||
@ -2119,7 +2121,7 @@ static void
|
||||
remote_fetch_registers (regno)
|
||||
int regno;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
int i;
|
||||
char *p;
|
||||
char regs[REGISTER_BYTES];
|
||||
@ -2207,7 +2209,7 @@ static void
|
||||
remote_store_registers (regno)
|
||||
int regno;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
int i;
|
||||
char *p;
|
||||
|
||||
@ -2360,7 +2362,8 @@ check_binary_download (addr)
|
||||
{
|
||||
if (remote_binary_download && !remote_binary_checked)
|
||||
{
|
||||
char buf[PBUFSIZ], *p;
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
char *p;
|
||||
remote_binary_checked = 1;
|
||||
|
||||
p = buf;
|
||||
@ -2403,6 +2406,7 @@ remote_write_bytes (memaddr, myaddr, len)
|
||||
char *myaddr;
|
||||
int len;
|
||||
{
|
||||
unsigned char *buf = alloca (PBUFSIZ);
|
||||
int max_buf_size; /* Max size of packet output buffer */
|
||||
int origlen;
|
||||
|
||||
@ -2421,7 +2425,6 @@ remote_write_bytes (memaddr, myaddr, len)
|
||||
origlen = len;
|
||||
while (len > 0)
|
||||
{
|
||||
unsigned char buf[PBUFSIZ];
|
||||
unsigned char *p, *plen;
|
||||
int todo;
|
||||
int i;
|
||||
@ -2534,6 +2537,7 @@ remote_read_bytes (memaddr, myaddr, len)
|
||||
char *myaddr;
|
||||
int len;
|
||||
{
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
int max_buf_size; /* Max size of packet output buffer */
|
||||
int origlen;
|
||||
|
||||
@ -2546,7 +2550,6 @@ remote_read_bytes (memaddr, myaddr, len)
|
||||
origlen = len;
|
||||
while (len > 0)
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *p;
|
||||
int todo;
|
||||
int i;
|
||||
@ -2647,7 +2650,7 @@ remote_search (len, data, mask, startaddr, increment, lorange, hirange
|
||||
long mask_long, data_long;
|
||||
long data_found_long;
|
||||
CORE_ADDR addr_we_found;
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
long returned_long[2];
|
||||
char *p;
|
||||
|
||||
@ -2779,7 +2782,9 @@ putpkt_binary (buf, cnt)
|
||||
{
|
||||
int i;
|
||||
unsigned char csum = 0;
|
||||
char buf2[PBUFSIZ];
|
||||
char *buf2 = alloca (PBUFSIZ);
|
||||
char *junkbuf = alloca (PBUFSIZ);
|
||||
|
||||
int ch;
|
||||
int tcount = 0;
|
||||
char *p;
|
||||
@ -2850,8 +2855,6 @@ putpkt_binary (buf, cnt)
|
||||
break; /* Retransmit buffer */
|
||||
case '$':
|
||||
{
|
||||
char junkbuf[PBUFSIZ];
|
||||
|
||||
/* It's probably an old response, and we're out of sync.
|
||||
Just gobble up the packet and ignore it. */
|
||||
getpkt (junkbuf, 0);
|
||||
@ -2956,7 +2959,7 @@ read_frame (buf)
|
||||
{
|
||||
if (remote_cisco_mode) /* variant run-length-encoding */
|
||||
{
|
||||
char tmp_buf[PBUFSIZ];
|
||||
char *tmp_buf = alloca (PBUFSIZ);
|
||||
|
||||
remote_cisco_expand (buf, tmp_buf);
|
||||
strcpy (buf, tmp_buf);
|
||||
@ -3329,7 +3332,10 @@ compare_sections_command (args, from_tty)
|
||||
unsigned long host_crc, target_crc;
|
||||
extern bfd *exec_bfd;
|
||||
struct cleanup *old_chain;
|
||||
char *tmp, *sectdata, *sectname, buf[PBUFSIZ];
|
||||
char *tmp;
|
||||
char *sectdata;
|
||||
char *sectname;
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
bfd_size_type size;
|
||||
bfd_vma lma;
|
||||
int matched = 0;
|
||||
@ -3403,7 +3409,7 @@ remote_query (query_type, buf, outbuf, bufsiz)
|
||||
int *bufsiz;
|
||||
{
|
||||
int i;
|
||||
char buf2[PBUFSIZ];
|
||||
char *buf2 = alloca (PBUFSIZ);
|
||||
char *p2 = &buf2[0];
|
||||
char *p = buf;
|
||||
|
||||
@ -3470,7 +3476,7 @@ packet_command (args, from_tty)
|
||||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
|
||||
if (! remote_desc)
|
||||
error ("command can only be used with remote target");
|
||||
@ -3726,7 +3732,7 @@ remote_info_process (args, from_tty)
|
||||
char *args;
|
||||
int from_tty;
|
||||
{
|
||||
char buf[PBUFSIZ];
|
||||
char *buf = alloca (PBUFSIZ);
|
||||
|
||||
if (remote_desc == 0)
|
||||
error ("Command can only be used when connected to the remote target.");
|
||||
|
26
gdb/solib.c
26
gdb/solib.c
@ -1306,11 +1306,35 @@ solib_address (address)
|
||||
/* Called by free_all_symtabs */
|
||||
|
||||
void
|
||||
clear_solib()
|
||||
clear_solib ()
|
||||
{
|
||||
struct so_list *next;
|
||||
char *bfd_filename;
|
||||
|
||||
/* This function is expected to handle ELF shared libraries. It is
|
||||
also used on Solaris, which can run either ELF or a.out binaries
|
||||
(for compatibility with SunOS 4), both of which can use shared
|
||||
libraries. So we don't know whether we have an ELF executable or
|
||||
an a.out executable until the user chooses an executable file.
|
||||
|
||||
ELF shared libraries don't get mapped into the address space
|
||||
until after the program starts, so we'd better not try to insert
|
||||
breakpoints in them immediately. We have to wait until the
|
||||
dynamic linker has loaded them; we'll hit a bp_shlib_event
|
||||
breakpoint (look for calls to create_solib_event_breakpoint) when
|
||||
it's ready.
|
||||
|
||||
SunOS shared libraries seem to be different --- they're present
|
||||
as soon as the process begins execution, so there's no need to
|
||||
put off inserting breakpoints. There's also nowhere to put a
|
||||
bp_shlib_event breakpoint, so if we put it off, we'll never get
|
||||
around to it.
|
||||
|
||||
So: disable breakpoints only if we're using ELF shared libs. */
|
||||
if (exec_bfd != NULL
|
||||
&& bfd_get_flavour (exec_bfd) != bfd_target_aout_flavour)
|
||||
disable_breakpoints_in_shlibs (1);
|
||||
|
||||
while (so_list_head)
|
||||
{
|
||||
if (so_list_head -> sections)
|
||||
|
@ -2408,6 +2408,8 @@ build_canonical_line_spec (sal, symname, canonical)
|
||||
FILE:FUNCTION -- likewise, but prefer functions in that file.
|
||||
*EXPR -- line in which address EXPR appears.
|
||||
|
||||
This may all be followed by an "if EXPR", which we ignore.
|
||||
|
||||
FUNCTION may be an undebuggable function found in minimal symbol table.
|
||||
|
||||
If the argument FUNFIRSTLINE is nonzero, we want the first line
|
||||
|
@ -1,3 +1,105 @@
|
||||
1999-06-25 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
From Jimmy Guo <guo@cup.hp.com> and others at HP:
|
||||
* lib/gdb.exp (get_compiler_info): Add detection for assorted
|
||||
HP compilers, also set the globals $true and $false.
|
||||
|
||||
* gdb.base/annota1.c, bitfields.c, break.c, call-ar-st.c,
|
||||
call-rt-st.c, call-strs.c, callfuncs.c, callfuncs2.c, condbreak.c,
|
||||
coremaker.c, ending-run.c, exprs.c, funcargs.c, interrupt.c,
|
||||
jump.c, langs0.c, langs1.c, langs2.c, list0.c, list1.c,
|
||||
long_long.c, mips_pro.c, nodebug.c, opaque0.c, opaque1.c,
|
||||
printcmds.c, ptype.c, recurse.c, restore.c, return.c, run.c,
|
||||
scope0.c, scope1.c, setshow.c, setvar.c, shmain.c, shr1.c, shr2.c,
|
||||
sigall.c, signals.c, so-impl-ld.c, so-indr-cl.c, solib.c,
|
||||
solib1.c, solib2.c, step-test.c, twice.c, varargs.c, watchpoint.c,
|
||||
whatis.c} Add C++ compatible function definitions and return
|
||||
types, add includes for library functions.
|
||||
* gdb.base/ptype.c (my_false, my_true): Use instead of false/true.
|
||||
* gdb.base/step-test.c (myglob): Rename from glob.
|
||||
* gdb.base/attach.c, attach2.c, average.c, execd-prog.c,
|
||||
foll-exec.c, foll-fork.c, foll-vfork.c, sum.c, vforked-prog.c: New
|
||||
files, move here from gdb.hp.
|
||||
* gdb.base/annota1.exp, break.exp, call-ar-st.exp, call-rt-st.exp,
|
||||
commands.exp, condbreak.exp, define.exp, ena-dis-br.exp,
|
||||
ending-run.exp, jump.exp. list.exp, long_long.exp, so-impl-ld.exp:
|
||||
Adjust line numbers in regexps.
|
||||
|
||||
* gdb.base/all-bin.exp, eval-skip.exp, exprs.exp, logical.exp,
|
||||
miscexprs.exp, pointers.exp, relational.exp: Use $true and $false
|
||||
instead of 0/1.
|
||||
|
||||
* gdb.base/attach.exp, dbx.exp, foll-exec.exp, foll-fork.exp,
|
||||
foll-vfork.exp: New files, move here from gdb.hp.
|
||||
* gdb.base/page.exp: New file, test of pagination command.
|
||||
|
||||
* gdb.base/watchpoint.c (recurser): New function, for watchpoint
|
||||
recursion test.
|
||||
* gdb.base/watchpoint.exp: Add more test cases for watchpoints.
|
||||
|
||||
* gdb.base/so-impl-ld.exp, gdb.base/so-indr-cl.exp,
|
||||
gdb.base/solib.exp: Fix compiler invocation process.
|
||||
|
||||
* gdb.base/callfuncs.exp, gdb.base/callfuncs2.exp: Don't xfail for
|
||||
HP-UX 11, turn off overload resolution explicitly.
|
||||
* gdb.base/commands.exp: Set argument list explicitly, add
|
||||
watchpoint test.
|
||||
* gdb.base/completion.exp: Enable if HP-UX, tweak tests to make
|
||||
them work.
|
||||
* gdb.base/constvars.exp, gdb.base/volatile.exp: Escape the
|
||||
expressions properly.
|
||||
* gdb.base/corefile.exp: Loosen the match slightly.
|
||||
* gdb.base/default.exp: Allow "Error accessing memory" message
|
||||
also.
|
||||
* gdb.base/display.exp: Skip over x/0 j if PA64.
|
||||
* gdb.base/funcargs.exp: Add xfails for HP-UX.
|
||||
* gdb.base/interrupt.exp: Ditto.
|
||||
* gdb.base/langs.exp: Add symbolic matches governed by compiler
|
||||
in use.
|
||||
* gdb.base/list.exp: Add xfails for HP-UX.
|
||||
* gdb.base/long_long.exp: Refine some of the numeric matches.
|
||||
* gdb.base/mips_pro.exp: Xfail on HP-UX.
|
||||
* gdb.base/miscexprs.exp: Add PA2.0 case for array size test.
|
||||
* gdb.base/nodebug.exp: Succeed on more varieties of output.
|
||||
* gdb.base/opaque.exp: Remove some HP-UX xfails.
|
||||
* gdb.base/ptype.exp: Succeed on more varieties of output.
|
||||
* gdb.base/scope.exp: Add xfails for HP-UX.
|
||||
* gdb.base/sect-cmd.exp: Add more cases.
|
||||
* gdb.base/setvar.exp: Add xfails for HP-UX.
|
||||
* gdb.base/shlib-call.exp: Loosen some matches slightly.
|
||||
* gdb.base/signals.exp: Match on void symbolically.
|
||||
* gdb.base/step-test.exp: Add case for PA64.
|
||||
* gdb.base/term.exp: Add exit and restart.
|
||||
* gdb.base/twice.exp: Clean up after self.
|
||||
* gdb.base/varargs.exp: Disable overload resolution explicitly.
|
||||
* gdb.base/whatis.exp: Allow more ways to pass tests.
|
||||
|
||||
* gdb.base/smoke.exp, gdb.base/smoke.c, gdb.base/smoke.cc: Remove,
|
||||
no longer useful.
|
||||
|
||||
Fri Jun 25 19:27:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* lib/gdb.exp (proc gdb_expect_list): New procedure. Matches a
|
||||
list of patterns.
|
||||
* gdb.base/call-ar-st.exp: Use gdb_expect_list in "print
|
||||
print_double_array(double_array)", "continuing to breakpoint
|
||||
1018", "print print_double_array(array_d)" and "continuing to
|
||||
1034" tests.
|
||||
|
||||
1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||
|
||||
* Makefile.in: Add empty html and install-html targets.
|
||||
|
||||
1999-06-24 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* config/mt-*: Remove, these haven't been used since 1996.
|
||||
|
||||
1999-06-22 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdb.base/call-strs.c, gdb.base/ending-run.c,
|
||||
gdb.base/step-test.c: Include stdlib.h and string.h as needed.
|
||||
* gdb.c++/member-ptr.exp: Skip over these tests if using G++.
|
||||
|
||||
1999-06-18 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdb.c++/overload.exp: XFAIL everything if using G++, add a
|
||||
|
@ -89,6 +89,8 @@ INFODIRS=doc
|
||||
info:
|
||||
install-info:
|
||||
dvi:
|
||||
html:
|
||||
install-html:
|
||||
|
||||
install:
|
||||
|
||||
|
@ -45,6 +45,10 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
@ -206,7 +210,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_short\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_short" }
|
||||
@ -236,7 +240,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_signed_short\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_short" }
|
||||
@ -246,7 +250,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_short\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_short" }
|
||||
@ -256,7 +260,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_signed_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_int" }
|
||||
@ -266,7 +270,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_int" }
|
||||
@ -276,7 +280,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_long" }
|
||||
@ -286,7 +290,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_signed_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_long" }
|
||||
@ -296,7 +300,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_long" }
|
||||
@ -306,7 +310,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_float\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_float"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_float" }
|
||||
@ -316,7 +320,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int <= v_double\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_double"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_double" }
|
||||
@ -335,7 +339,7 @@ gdb_test "set variable v_unsigned_long=0" "" "set v_unsigned_long=0"
|
||||
|
||||
send_gdb "print v_int && v_char\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_char" }
|
||||
@ -344,7 +348,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_short\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_short" }
|
||||
@ -354,7 +358,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_signed_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_char" }
|
||||
@ -364,7 +368,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_unsigned_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_char" }
|
||||
@ -374,7 +378,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_signed_short\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_short" }
|
||||
@ -384,7 +388,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_unsigned_short\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_short" }
|
||||
@ -394,7 +398,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_signed_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_int" }
|
||||
@ -404,7 +408,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_unsigned_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_int" }
|
||||
@ -414,7 +418,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_long" }
|
||||
@ -424,7 +428,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_signed_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_long" }
|
||||
@ -434,7 +438,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_unsigned_long\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_long" }
|
||||
@ -444,7 +448,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_float\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_float"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_float" }
|
||||
@ -454,7 +458,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int && v_double\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_double"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_double" }
|
||||
|
@ -6,16 +6,28 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void
|
||||
handle_USR1 (int sig)
|
||||
{
|
||||
}
|
||||
#else
|
||||
void
|
||||
handle_USR1 (sig)
|
||||
int sig;
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
int value;
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
main (void)
|
||||
#else
|
||||
int
|
||||
main ()
|
||||
#endif
|
||||
{
|
||||
int my_array[3] = { 1, 2, 3 };
|
||||
|
||||
|
@ -62,7 +62,7 @@ if [target_info exists gdb_stub] {
|
||||
#
|
||||
# the line at which break main will put the breakpoint
|
||||
#
|
||||
set main_line 20
|
||||
set main_line 32
|
||||
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
@ -143,7 +143,7 @@ gdb_expect {
|
||||
#exp_internal 1
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
|
||||
-re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" \
|
||||
{ pass "run until main breakpoint" }
|
||||
-re ".*$gdb_prompt$" { fail "run until main breakpoint" }
|
||||
timeout { fail "run until main breakpoint (timeout)" }
|
||||
@ -258,7 +258,7 @@ gdb_expect {
|
||||
#
|
||||
send_gdb "signal SIGUSR1\n"
|
||||
gdb_expect {
|
||||
-re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:185:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
|
||||
-re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
|
||||
{ pass "send SIGUSR1" }
|
||||
-re ".*$gdb_prompt$" { fail "send SIGUSR1" }
|
||||
timeout { fail "send SIGUSR1 (timeout)" }
|
||||
|
@ -5,7 +5,7 @@
|
||||
this may cause some tests to fail. But at least we can still compile
|
||||
the test program and run the tests... */
|
||||
|
||||
#ifndef __STDC__
|
||||
#if !defined(__STDC__) && !defined(__cplusplus)
|
||||
#define signed /**/
|
||||
#endif
|
||||
|
||||
|
@ -29,6 +29,7 @@ char *arg;
|
||||
|
||||
#else /* ! vxworks */
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
#endif /* ! vxworks */
|
||||
|
||||
/*
|
||||
@ -38,20 +39,34 @@ char *arg;
|
||||
* of gcc have or have had problems with this).
|
||||
*/
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int marker1 (void) { return (0); }
|
||||
int marker2 (int a) { return (1); }
|
||||
void marker3 (char *a, char *b) {}
|
||||
void marker4 (long d) {}
|
||||
#else
|
||||
int marker1 () { return (0); }
|
||||
int marker2 (a) int a; { return (1); }
|
||||
void marker3 (a, b) char *a, *b; {}
|
||||
void marker4 (d) long d; {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This simple classical example of recursion is useful for
|
||||
* testing stack backtraces and such.
|
||||
*/
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int factorial(int);
|
||||
|
||||
int
|
||||
main (int argc, char **argv, char **envp)
|
||||
#else
|
||||
int
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char *argv[], **envp;
|
||||
#endif
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
@ -70,8 +85,12 @@ char *argv[], **envp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int factorial (int value)
|
||||
#else
|
||||
int factorial (value)
|
||||
int value;
|
||||
#endif
|
||||
{
|
||||
if (value > 1) {
|
||||
value *= factorial (value - 1);
|
||||
|
@ -39,6 +39,10 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
@ -88,22 +92,22 @@ gdb_test "break $srcfile:factorial" \
|
||||
#
|
||||
# test break at line number
|
||||
#
|
||||
gdb_test "break 64" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 64\\." \
|
||||
gdb_test "break 79" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 79\\." \
|
||||
"breakpoint line number"
|
||||
|
||||
#
|
||||
# test duplicate breakpoint
|
||||
#
|
||||
gdb_test "break 64" \
|
||||
"Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line 64\\." \
|
||||
gdb_test "break 79" \
|
||||
"Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line 79\\." \
|
||||
"breakpoint duplicate"
|
||||
|
||||
#
|
||||
# test break at line number in file
|
||||
#
|
||||
gdb_test "break $srcfile:70" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 70\\." \
|
||||
gdb_test "break $srcfile:85" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 85\\." \
|
||||
"breakpoint line number in file"
|
||||
|
||||
|
||||
@ -111,18 +115,23 @@ gdb_test "break $srcfile:70" \
|
||||
# check to see what breakpoints are set
|
||||
#
|
||||
if [target_info exists gdb_stub] {
|
||||
set main_line 57
|
||||
set main_line 72
|
||||
} else {
|
||||
set main_line 60
|
||||
set main_line 75
|
||||
}
|
||||
|
||||
if {$hp_aCC_compiler} {
|
||||
set proto "\\(int\\)"
|
||||
} else {
|
||||
set proto ""
|
||||
}
|
||||
gdb_test "info break" \
|
||||
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial at .*$srcfile:76.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:64.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:64.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:70" \
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:95.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:85" \
|
||||
"breakpoint info"
|
||||
|
||||
|
||||
@ -150,35 +159,35 @@ if ![target_info exists use_gdb_stub] {
|
||||
send_gdb "y\n"
|
||||
exp_continue
|
||||
}
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*$gdb_prompt $"\
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:75.*75\[\t \]+if .argc.* \{.*$gdb_prompt $"\
|
||||
{ pass "run until function breakpoint" }
|
||||
-re ".*$gdb_prompt $" { fail "run until function breakpoint" }
|
||||
timeout { fail "run until function breakpoint (timeout)" }
|
||||
}
|
||||
} else {
|
||||
if ![target_info exists gdb_stub] {
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:60.*60\[\t \]+if .argc.*\{" "stub continue"
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:75.*75\[\t \]+if .argc.*\{" "stub continue"
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# run until the breakpoint at a line number
|
||||
#
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:64.*64\[\t \]+printf.*factorial.*" \
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
|
||||
"run until breakpoint set at a line number"
|
||||
|
||||
#
|
||||
# Run until the breakpoint set in a function in a file
|
||||
#
|
||||
for {set i 6} {$i >= 1} {incr i -1} {
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:76.*76\[\t \]+if .value > 1. \{" \
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:95.*95\[\t \]+.*if .value > 1. \{.*" \
|
||||
"run until file:function($i) breakpoint"
|
||||
}
|
||||
|
||||
#
|
||||
# run until the file:function breakpoint at a line number in a file
|
||||
#
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:70.*70\[\t \]+return 0;" \
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:85.*85\[\t \]+return 0;" \
|
||||
"run until file:linenum breakpoint"
|
||||
|
||||
#
|
||||
@ -202,31 +211,38 @@ gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*"
|
||||
#
|
||||
# test break at line number
|
||||
#
|
||||
send_gdb "tbreak 64\n"
|
||||
send_gdb "tbreak 79\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint.*at.* file .*$srcfile, line 64.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
|
||||
-re "Breakpoint.*at.* file .*$srcfile, line 79.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
|
||||
-re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
|
||||
timeout { fail "breakpoint line number #1 (timeout)" }
|
||||
}
|
||||
|
||||
gdb_test "tbreak 60" "Breakpoint.*at.* file .*$srcfile, line 60.*" "Temporary breakpoint line number #2"
|
||||
gdb_test "tbreak 75" "Breakpoint.*at.* file .*$srcfile, line 75.*" "Temporary breakpoint line number #2"
|
||||
|
||||
#
|
||||
# test break at line number in file
|
||||
#
|
||||
send_gdb "tbreak $srcfile:70\n"
|
||||
send_gdb "tbreak $srcfile:85\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint.*at.* file .*$srcfile, line 70.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
|
||||
-re "Breakpoint.*at.* file .*$srcfile, line 85.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
|
||||
-re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
|
||||
timeout { fail "Temporary breakpoint line number in file #1 (timeout)" }
|
||||
}
|
||||
|
||||
gdb_test "tbreak $srcfile:66" "Breakpoint.*at.* file .*$srcfile, line 66.*" "Temporary breakpoint line number in file #2"
|
||||
gdb_test "tbreak $srcfile:81" "Breakpoint.*at.* file .*$srcfile, line 81.*" "Temporary breakpoint line number in file #2"
|
||||
|
||||
#
|
||||
# check to see what breakpoints are set (temporary this time)
|
||||
#
|
||||
gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial at .*$srcfile:76.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:64.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:70.*" "Temporary breakpoint info"
|
||||
gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]
|
||||
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]
|
||||
\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial$proto at .*$srcfile:95.*\[\r\n\]
|
||||
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:79.*\[\r\n\]
|
||||
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:75.*\[\r\n\]
|
||||
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:85.*\[\r\n\]
|
||||
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:81.*" \
|
||||
"Temporary breakpoint info"
|
||||
|
||||
|
||||
#***********
|
||||
@ -301,18 +317,18 @@ gdb_expect {
|
||||
# Verify that "until <location>" works. (This is really just syntactic
|
||||
# sugar for "tbreak <location>; continue".)
|
||||
#
|
||||
send_gdb "until 64\n"
|
||||
send_gdb "until 79\n"
|
||||
gdb_expect {
|
||||
-re "main .* at .*:64.*$gdb_prompt $"\
|
||||
{pass "until 64"}
|
||||
-re "main .* at .*:79.*$gdb_prompt $"\
|
||||
{pass "until 79"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "until 64"}
|
||||
timeout {fail "(timeout) until 64"}
|
||||
{fail "until 79"}
|
||||
timeout {fail "(timeout) until 79"}
|
||||
}
|
||||
|
||||
# Verify that a malformed "until" is gracefully caught.
|
||||
#
|
||||
send_gdb "until 65 then stop\n"
|
||||
send_gdb "until 80 then stop\n"
|
||||
gdb_expect {
|
||||
-re "Junk at end of arguments..*$gdb_prompt $"\
|
||||
{pass "malformed until"}
|
||||
@ -379,13 +395,13 @@ gdb_expect {
|
||||
#
|
||||
if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "break 64\n"
|
||||
send_gdb "break 79\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 64.*$gdb_prompt $"\
|
||||
{pass "set to-be-silent break 64"}
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 79.*$gdb_prompt $"\
|
||||
{pass "set to-be-silent break 79"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set to-be-silent break 64"}
|
||||
timeout {fail "(timeout) set to-be-silent break 64"}
|
||||
{fail "set to-be-silent break 79"}
|
||||
timeout {fail "(timeout) set to-be-silent break 79"}
|
||||
}
|
||||
|
||||
send_gdb "commands $expect_out(1,string)\n"
|
||||
@ -393,33 +409,33 @@ send_gdb "silent\n"
|
||||
send_gdb "end\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $"\
|
||||
{pass "set silent break 64"}
|
||||
timeout {fail "(timeout) set silent break 64"}
|
||||
{pass "set silent break 79"}
|
||||
timeout {fail "(timeout) set silent break 79"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]*breakpoint.*:64\r\n\[ \t\]*silent.*$gdb_prompt $"\
|
||||
{pass "info silent break 64"}
|
||||
-re "\[0-9\]*\[ \t\]*breakpoint.*:79\r\n\[ \t\]*silent.*$gdb_prompt $"\
|
||||
{pass "info silent break 79"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info silent break 64"}
|
||||
timeout {fail "(timeout) info silent break 64"}
|
||||
{fail "info silent break 79"}
|
||||
timeout {fail "(timeout) info silent break 79"}
|
||||
}
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Continuing.\r\n$gdb_prompt $"\
|
||||
{pass "hit silent break 64"}
|
||||
{pass "hit silent break 79"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "hit silent break 64"}
|
||||
timeout {fail "(timeout) hit silent break 64"}
|
||||
{fail "hit silent break 79"}
|
||||
timeout {fail "(timeout) hit silent break 79"}
|
||||
}
|
||||
send_gdb "bt\n"
|
||||
gdb_expect {
|
||||
-re "#0 main .* at .*:64.*$gdb_prompt $"\
|
||||
{pass "stopped for silent break 64"}
|
||||
-re "#0 main .* at .*:79.*$gdb_prompt $"\
|
||||
{pass "stopped for silent break 79"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "stopped for silent break 64"}
|
||||
timeout {fail "(timeout) stopped for silent break 64"}
|
||||
{fail "stopped for silent break 79"}
|
||||
timeout {fail "(timeout) stopped for silent break 79"}
|
||||
}
|
||||
|
||||
# Verify that GDB can at least parse a breakpoint with the
|
||||
@ -427,7 +443,7 @@ gdb_expect {
|
||||
# thread-specific breakpoint really triggers appropriately.
|
||||
# The gdb.threads subdirectory contains tests for that.)
|
||||
#
|
||||
send_gdb "break 65 thread 999\n"
|
||||
send_gdb "break 80 thread 999\n"
|
||||
gdb_expect {
|
||||
-re "Unknown thread 999.*$gdb_prompt $"\
|
||||
{pass "thread-specific breakpoint on non-existent thread disallowed"}
|
||||
@ -435,7 +451,7 @@ gdb_expect {
|
||||
{fail "thread-specific breakpoint on non-existent thread disallowed"}
|
||||
timeout {fail "(timeout) thread-specific breakpoint on non-existent thread disallowed"}
|
||||
}
|
||||
send_gdb "break 65 thread foo\n"
|
||||
send_gdb "break 80 thread foo\n"
|
||||
gdb_expect {
|
||||
-re "Junk after thread keyword..*$gdb_prompt $"\
|
||||
{pass "thread-specific breakpoint on bogus thread ID disallowed"}
|
||||
@ -447,7 +463,7 @@ gdb_expect {
|
||||
# Verify that GDB responds gracefully to a breakpoint command with
|
||||
# trailing garbage.
|
||||
#
|
||||
send_gdb "break 65 foo\n"
|
||||
send_gdb "break 80 foo\n"
|
||||
gdb_expect {
|
||||
-re "Junk at end of arguments..*$gdb_prompt $"\
|
||||
{pass "breakpoint with trailing garbage disallowed"}
|
||||
@ -466,9 +482,9 @@ gdb_expect {
|
||||
{pass "step over breakpoint"}
|
||||
timeout {fail "(timeout) step over breakpoint"}
|
||||
}
|
||||
send_gdb "clear 66\n"
|
||||
send_gdb "clear 81\n"
|
||||
gdb_expect {
|
||||
-re "No breakpoint at 66..*$gdb_prompt $"\
|
||||
-re "No breakpoint at 81..*$gdb_prompt $"\
|
||||
{pass "clear line has no breakpoint disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "clear line has no breakpoint disallowed"}
|
||||
@ -485,15 +501,15 @@ gdb_expect {
|
||||
|
||||
# Verify that a breakpoint can be set via a convenience variable.
|
||||
#
|
||||
send_gdb "set \$foo=66\n"
|
||||
send_gdb "set \$foo=81\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "set convenience variable \$foo to 66"}
|
||||
timeout {fail "(timeout) set convenience variable \$foo to 66"}
|
||||
{pass "set convenience variable \$foo to 81"}
|
||||
timeout {fail "(timeout) set convenience variable \$foo to 81"}
|
||||
}
|
||||
send_gdb "break \$foo\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 66.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 81.*$gdb_prompt $"\
|
||||
{pass "set breakpoint via convenience variable"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set breakpoint via convenience variable"}
|
||||
@ -503,11 +519,11 @@ gdb_expect {
|
||||
# Verify that GDB responds gracefully to an attempt to set a
|
||||
# breakpoint via a convenience variable whose type is not integer.
|
||||
#
|
||||
send_gdb "set \$foo=66.5\n"
|
||||
send_gdb "set \$foo=81.5\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "set convenience variable \$foo to 66.5"}
|
||||
timeout {fail "(timeout) set convenience variable \$foo to 66.5"}
|
||||
{pass "set convenience variable \$foo to 81.5"}
|
||||
timeout {fail "(timeout) set convenience variable \$foo to 81.5"}
|
||||
}
|
||||
send_gdb "break \$foo\n"
|
||||
gdb_expect {
|
||||
@ -522,7 +538,7 @@ gdb_expect {
|
||||
#
|
||||
send_gdb "break marker2\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 42.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
|
||||
{pass "set breakpoint on to-be-called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set breakpoint on to-be-called function"}
|
||||
@ -530,7 +546,7 @@ gdb_expect {
|
||||
}
|
||||
send_gdb "print marker2(99)\n"
|
||||
gdb_expect {
|
||||
-re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
|
||||
-re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
|
||||
{pass "hit breakpoint on called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "hit breakpoint on called function"}
|
||||
@ -543,7 +559,9 @@ gdb_expect {
|
||||
if [istarget "hppa*-*-hpux*"] then {
|
||||
send_gdb "bt\n"
|
||||
gdb_expect {
|
||||
-re "#0\[ \t\]*marker2.*:42\r\n#1.*_sr4export.*$gdb_prompt $"\
|
||||
-re "#0\[ \t\]*marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\
|
||||
{pass "backtrace while in called function"}
|
||||
-re "#0\[ \t\]*marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\
|
||||
{pass "backtrace while in called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "backtrace while in called function"}
|
||||
@ -551,7 +569,9 @@ if [istarget "hppa*-*-hpux*"] then {
|
||||
}
|
||||
send_gdb "finish\n"
|
||||
gdb_expect {
|
||||
-re "Run till exit from .*marker2.* at .*42\r\n.* in _sr4export.*$gdb_prompt $"\
|
||||
-re "Run till exit from .*marker2.* at .*4\[49\]\r\n.* in _sr4export.*$gdb_prompt $"\
|
||||
{pass "finish from called function"}
|
||||
-re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*function called from gdb.*$gdb_prompt $"\
|
||||
{pass "finish from called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "finish from called function"}
|
||||
|
@ -141,9 +141,13 @@ struct int_char_combo_t {
|
||||
* IN id_int student -- enumerated type
|
||||
* IN colors shirt -- enumerated type
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_student_id_shirt_color (id_int student, colors shirt)
|
||||
#else
|
||||
void print_student_id_shirt_color ( student, shirt )
|
||||
id_int student;
|
||||
colors shirt;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("student id : %d\t", student);
|
||||
@ -192,9 +196,12 @@ void print_student_id_shirt_color ( student, shirt )
|
||||
* PRINT_CHAR_ARRAY :
|
||||
* IN char array_c[] -- character array
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_char_array (char array_c[])
|
||||
#else
|
||||
void print_char_array ( array_c )
|
||||
char array_c[];
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
@ -212,9 +219,12 @@ void print_char_array ( array_c )
|
||||
* PRINT_DOUBLE_ARRAY :
|
||||
* IN double array_d[] -- array of doubles
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_double_array (double array_d[])
|
||||
#else
|
||||
void print_double_array (array_d)
|
||||
double array_d[];
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
@ -232,9 +242,12 @@ void print_double_array (array_d)
|
||||
* PRINT_FLOAT_ARRAY:
|
||||
* IN float array_f[] -- array of floats
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_float_array (float array_f[])
|
||||
#else
|
||||
void print_float_array ( array_f )
|
||||
float array_f[];
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
@ -253,9 +266,12 @@ void print_float_array ( array_f )
|
||||
* PRINT_INT_ARRAY:
|
||||
* IN int array_i[] -- array of integers
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_int_array (int array_i[])
|
||||
#else
|
||||
void print_int_array ( array_i )
|
||||
int array_i[];
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
@ -277,12 +293,15 @@ void print_int_array ( array_i )
|
||||
* IN float array_f[] -- array of floats
|
||||
* IN double array_d[] -- array of doubles
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_all_arrays(int array_i[], char array_c[], float array_f[], double array_d[])
|
||||
#else
|
||||
void print_all_arrays( array_i, array_c, array_f, array_d )
|
||||
int array_i[];
|
||||
char array_c[];
|
||||
float array_f[];
|
||||
double array_d[];
|
||||
|
||||
#endif
|
||||
{
|
||||
print_int_array(array_i);
|
||||
print_char_array(array_c);
|
||||
@ -306,8 +325,12 @@ void loop_count () {
|
||||
* A do nothing function. Used to provide a point at which calls can be made.
|
||||
* IN int seed
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void compute_with_small_structs (int seed)
|
||||
#else
|
||||
void compute_with_small_structs ( seed )
|
||||
int seed;
|
||||
#endif
|
||||
{
|
||||
|
||||
struct small_rep_info_t array[4];
|
||||
@ -337,6 +360,9 @@ void compute_with_small_structs ( seed )
|
||||
* IN unsigned e -- 0 or 1
|
||||
* IN unsigned o -- 0 or 1
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsigned g, unsigned d, unsigned e, unsigned o)
|
||||
#else
|
||||
void init_bit_flags ( bit_flags, a, b, g, d, e, o )
|
||||
struct bit_flags_t *bit_flags;
|
||||
unsigned a;
|
||||
@ -345,6 +371,7 @@ unsigned g;
|
||||
unsigned d;
|
||||
unsigned e;
|
||||
unsigned o;
|
||||
#endif
|
||||
{
|
||||
|
||||
bit_flags->alpha = a;
|
||||
@ -370,6 +397,9 @@ unsigned o;
|
||||
* IN unsigned e -- 0 or 1
|
||||
* IN unsigned o -- 0 or 1
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a, unsigned b, char ch1, unsigned g, unsigned d, char ch2, unsigned e, unsigned o)
|
||||
#else
|
||||
void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
|
||||
struct bit_flags_combo_t *bit_flags_combo;
|
||||
unsigned a;
|
||||
@ -380,6 +410,7 @@ void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
|
||||
char ch2;
|
||||
unsigned e;
|
||||
unsigned o;
|
||||
#endif
|
||||
{
|
||||
|
||||
bit_flags_combo->alpha = a;
|
||||
@ -398,9 +429,13 @@ void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
|
||||
* OUT struct one_double_t *one_double -- structure to fill
|
||||
* IN double init_val
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_one_double (struct one_double_t *one_double, double init_val)
|
||||
#else
|
||||
void init_one_double ( one_double, init_val )
|
||||
struct one_double_t *one_double;
|
||||
double init_val;
|
||||
#endif
|
||||
{
|
||||
|
||||
one_double->double1 = init_val;
|
||||
@ -412,10 +447,14 @@ void init_one_double ( one_double, init_val )
|
||||
* IN float init_val1
|
||||
* IN float init_val2
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_two_floats (struct two_floats_t *two_floats, float init_val1, float init_val2)
|
||||
#else
|
||||
void init_two_floats ( two_floats, init_val1, init_val2 )
|
||||
struct two_floats_t *two_floats;
|
||||
float init_val1;
|
||||
float init_val2;
|
||||
#endif
|
||||
{
|
||||
two_floats->float1 = init_val1;
|
||||
two_floats->float2 = init_val2;
|
||||
@ -427,10 +466,14 @@ void init_two_floats ( two_floats, init_val1, init_val2 )
|
||||
* IN char init_val1
|
||||
* IN char init_val2
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2)
|
||||
#else
|
||||
void init_two_chars ( two_char, init_val1, init_val2 )
|
||||
struct two_char_t *two_char;
|
||||
char init_val1;
|
||||
char init_val2;
|
||||
#endif
|
||||
{
|
||||
|
||||
two_char->ch1 = init_val1;
|
||||
@ -444,11 +487,15 @@ void init_two_chars ( two_char, init_val1, init_val2 )
|
||||
* IN char init_val2
|
||||
* IN char init_val3
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_three_chars (struct three_char_t *three_char, char init_val1, char init_val2, char init_val3)
|
||||
#else
|
||||
void init_three_chars ( three_char, init_val1, init_val2, init_val3 )
|
||||
struct three_char_t *three_char;
|
||||
char init_val1;
|
||||
char init_val2;
|
||||
char init_val3;
|
||||
#endif
|
||||
{
|
||||
|
||||
three_char->ch1 = init_val1;
|
||||
@ -465,6 +512,9 @@ void init_three_chars ( three_char, init_val1, init_val2, init_val3 )
|
||||
* IN char init_val4
|
||||
* IN char init_val5
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_five_chars (struct five_char_t *five_char, char init_val1, char init_val2, char init_val3, char init_val4, char init_val5)
|
||||
#else
|
||||
void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init_val5 )
|
||||
struct five_char_t *five_char;
|
||||
char init_val1;
|
||||
@ -472,6 +522,7 @@ void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init
|
||||
char init_val3;
|
||||
char init_val4;
|
||||
char init_val5;
|
||||
#endif
|
||||
{
|
||||
five_char->ch1 = init_val1;
|
||||
five_char->ch2 = init_val2;
|
||||
@ -486,10 +537,14 @@ void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init
|
||||
* IN int init_val1
|
||||
* IN char init_val2
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char init_val2)
|
||||
#else
|
||||
void init_int_char_combo ( combo, init_val1, init_val2 )
|
||||
struct int_char_combo_t *combo;
|
||||
int init_val1;
|
||||
char init_val2;
|
||||
#endif
|
||||
{
|
||||
|
||||
combo->int1 = init_val1;
|
||||
@ -501,10 +556,13 @@ void init_int_char_combo ( combo, init_val1, init_val2 )
|
||||
* OUT struct small_rep_into_t *small_struct -- structure to be filled
|
||||
* IN int seed
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_struct_rep(struct small_rep_info_t *small_struct, int seed)
|
||||
#else
|
||||
void init_struct_rep( small_struct, seed )
|
||||
struct small_rep_info_t *small_struct;
|
||||
int seed;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
small_struct->value = 2 + (seed*2);
|
||||
@ -516,6 +574,24 @@ void init_struct_rep( small_struct, seed )
|
||||
* Takes all the small structures as input and calls the appropriate
|
||||
* initialization routine for each structure
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_small_structs (
|
||||
struct small_rep_info_t *struct1,
|
||||
struct small_rep_info_t *struct2,
|
||||
struct small_rep_info_t *struct3,
|
||||
struct small_rep_info_t *struct4,
|
||||
struct bit_flags_t *flags,
|
||||
struct bit_flags_combo_t *flags_combo,
|
||||
struct three_char_t *three_char,
|
||||
struct five_char_t *five_char,
|
||||
struct int_char_combo_t *int_char_combo,
|
||||
struct one_double_t *d1,
|
||||
struct one_double_t *d2,
|
||||
struct one_double_t *d3,
|
||||
struct two_floats_t *f1,
|
||||
struct two_floats_t *f2,
|
||||
struct two_floats_t *f3)
|
||||
#else
|
||||
void init_small_structs (struct1, struct2, struct3,struct4,flags,flags_combo,
|
||||
three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
|
||||
struct small_rep_info_t *struct1;
|
||||
@ -533,7 +609,7 @@ three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
|
||||
struct two_floats_t *f1;
|
||||
struct two_floats_t *f2;
|
||||
struct two_floats_t *f3;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
|
||||
@ -560,6 +636,19 @@ three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
|
||||
* PRINT_TEN_DOUBLES :
|
||||
* ?????????????????????????????
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_ten_doubles (
|
||||
double d1,
|
||||
double d2,
|
||||
double d3,
|
||||
double d4,
|
||||
double d5,
|
||||
double d6,
|
||||
double d7,
|
||||
double d8,
|
||||
double d9,
|
||||
double d10)
|
||||
#else
|
||||
void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
|
||||
double d1;
|
||||
double d2;
|
||||
@ -571,6 +660,7 @@ void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
|
||||
double d8;
|
||||
double d9;
|
||||
double d10;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Two Doubles : %f\t%f\n", d1, d2);
|
||||
@ -584,8 +674,12 @@ void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
|
||||
* PRINT_BIT_FLAGS :
|
||||
* IN struct bit_flags_t bit_flags
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_bit_flags (struct bit_flags_t bit_flags)
|
||||
#else
|
||||
void print_bit_flags ( bit_flags )
|
||||
struct bit_flags_t bit_flags;
|
||||
#endif
|
||||
{
|
||||
|
||||
if (bit_flags.alpha) printf("alpha\n");
|
||||
@ -600,8 +694,12 @@ struct bit_flags_t bit_flags;
|
||||
* PRINT_BIT_FLAGS_COMBO :
|
||||
* IN struct bit_flags_combo_t bit_flags_combo
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
|
||||
#else
|
||||
void print_bit_flags_combo ( bit_flags_combo )
|
||||
struct bit_flags_combo_t bit_flags_combo;
|
||||
struct bit_flags_combo_t bit_flags_combo;
|
||||
#endif
|
||||
{
|
||||
|
||||
if (bit_flags_combo.alpha) printf("alpha\n");
|
||||
@ -617,8 +715,12 @@ struct bit_flags_combo_t bit_flags_combo;
|
||||
* PRINT_ONE_DOUBLE :
|
||||
* IN struct one_double_t one_double
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_one_double (struct one_double_t one_double)
|
||||
#else
|
||||
void print_one_double ( one_double )
|
||||
struct one_double_t one_double;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of one_double_t: \n\n");
|
||||
@ -629,8 +731,12 @@ struct one_double_t one_double;
|
||||
* PRINT_TWO_FLOATS :
|
||||
* IN struct two_floats_t two_floats
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_two_floats (struct two_floats_t two_floats)
|
||||
#else
|
||||
void print_two_floats ( two_floats )
|
||||
struct two_floats_t two_floats;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of two_floats_t: \n\n");
|
||||
@ -641,8 +747,12 @@ struct two_floats_t two_floats;
|
||||
* PRINT_TWO_CHARS :
|
||||
* IN struct two_char_t two_char
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_two_chars (struct two_char_t two_char)
|
||||
#else
|
||||
void print_two_chars ( two_char )
|
||||
struct two_char_t two_char;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of two_char_t: \n\n");
|
||||
@ -653,8 +763,12 @@ struct two_char_t two_char;
|
||||
* PRINT_THREE_CHARS :
|
||||
* IN struct three_char_t three_char
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_three_chars (struct three_char_t three_char)
|
||||
#else
|
||||
void print_three_chars ( three_char )
|
||||
struct three_char_t three_char;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of three_char_t: \n\n");
|
||||
@ -665,8 +779,12 @@ struct three_char_t three_char;
|
||||
* PRINT_FIVE_CHARS :
|
||||
* IN struct five_char_t five_char
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_five_chars (struct five_char_t five_char)
|
||||
#else
|
||||
void print_five_chars ( five_char )
|
||||
struct five_char_t five_char;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of five_char_t: \n\n");
|
||||
@ -679,8 +797,12 @@ struct five_char_t five_char;
|
||||
* PRINT_INT_CHAR_COMBO :
|
||||
* IN struct int_char_combo_t int_char_combo
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_int_char_combo (struct int_char_combo_t int_char_combo)
|
||||
#else
|
||||
void print_int_char_combo ( int_char_combo )
|
||||
struct int_char_combo_t int_char_combo;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of int_char_combo_t: \n\n");
|
||||
@ -695,11 +817,17 @@ struct int_char_combo_t int_char_combo;
|
||||
* IN struct small_rep_info_t struct2
|
||||
* IN struct small_rep_info_t struct3
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_struct_rep(
|
||||
struct small_rep_info_t struct1,
|
||||
struct small_rep_info_t struct2,
|
||||
struct small_rep_info_t struct3)
|
||||
#else
|
||||
void print_struct_rep( struct1, struct2, struct3)
|
||||
struct small_rep_info_t struct1;
|
||||
struct small_rep_info_t struct2;
|
||||
struct small_rep_info_t struct3;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
|
||||
@ -721,13 +849,21 @@ void print_struct_rep( struct1, struct2, struct3)
|
||||
* IN struct small_rep_info_t struct3
|
||||
* IN struct small_rep_info_t struct4
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void sum_struct_print (
|
||||
int seed,
|
||||
struct small_rep_info_t struct1,
|
||||
struct small_rep_info_t struct2,
|
||||
struct small_rep_info_t struct3,
|
||||
struct small_rep_info_t struct4)
|
||||
#else
|
||||
void sum_struct_print ( seed, struct1, struct2, struct3, struct4)
|
||||
int seed;
|
||||
struct small_rep_info_t struct1;
|
||||
struct small_rep_info_t struct2;
|
||||
struct small_rep_info_t struct3;
|
||||
struct small_rep_info_t struct4;
|
||||
|
||||
#endif
|
||||
{
|
||||
int sum;
|
||||
|
||||
@ -742,6 +878,24 @@ void sum_struct_print ( seed, struct1, struct2, struct3, struct4)
|
||||
* All of the small structures of odd sizes (40 bits, 8bits, etc.)
|
||||
* are pushed onto the stack.
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_small_structs (
|
||||
struct small_rep_info_t struct1,
|
||||
struct small_rep_info_t struct2,
|
||||
struct small_rep_info_t struct3,
|
||||
struct small_rep_info_t struct4,
|
||||
struct bit_flags_t flags,
|
||||
struct bit_flags_combo_t flags_combo,
|
||||
struct three_char_t three_char,
|
||||
struct five_char_t five_char,
|
||||
struct int_char_combo_t int_char_combo,
|
||||
struct one_double_t d1,
|
||||
struct one_double_t d2,
|
||||
struct one_double_t d3,
|
||||
struct two_floats_t f1,
|
||||
struct two_floats_t f2,
|
||||
struct two_floats_t f3)
|
||||
#else
|
||||
void print_small_structs ( struct1, struct2, struct3, struct4, flags,
|
||||
flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
|
||||
struct small_rep_info_t struct1;
|
||||
@ -759,6 +913,7 @@ flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
|
||||
struct two_floats_t f1;
|
||||
struct two_floats_t f2;
|
||||
struct two_floats_t f3;
|
||||
#endif
|
||||
{
|
||||
print_bit_flags(flags);
|
||||
print_bit_flags_combo(flags_combo);
|
||||
@ -784,6 +939,30 @@ flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
|
||||
* may force more space to be pushed onto the stack as part of the callers
|
||||
* frame.
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_long_arg_list (
|
||||
double a,
|
||||
double b,
|
||||
int c,
|
||||
int d,
|
||||
int e,
|
||||
int f,
|
||||
struct small_rep_info_t struct1,
|
||||
struct small_rep_info_t struct2,
|
||||
struct small_rep_info_t struct3,
|
||||
struct small_rep_info_t struct4,
|
||||
struct bit_flags_t flags,
|
||||
struct bit_flags_combo_t flags_combo,
|
||||
struct three_char_t three_char,
|
||||
struct five_char_t five_char,
|
||||
struct int_char_combo_t int_char_combo,
|
||||
struct one_double_t d1,
|
||||
struct one_double_t d2,
|
||||
struct one_double_t d3,
|
||||
struct two_floats_t f1,
|
||||
struct two_floats_t f2,
|
||||
struct two_floats_t f3)
|
||||
#else
|
||||
void print_long_arg_list ( a, b, c, d, e, f, struct1, struct2, struct3,
|
||||
struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1,d2,d3,
|
||||
f1, f2, f3 )
|
||||
@ -808,7 +987,7 @@ f1, f2, f3 )
|
||||
struct two_floats_t f1;
|
||||
struct two_floats_t f2;
|
||||
struct two_floats_t f3;
|
||||
|
||||
#endif
|
||||
{
|
||||
printf("double : %f\n", a);
|
||||
printf("double : %f\n", b);
|
||||
@ -822,9 +1001,12 @@ f1, f2, f3 )
|
||||
}
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void print_one_large_struct (struct array_rep_info_t linked_list1)
|
||||
#else
|
||||
void print_one_large_struct( linked_list1 )
|
||||
struct array_rep_info_t linked_list1;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
/* printf("Contents of linked list1: \n\n");
|
||||
@ -845,11 +1027,17 @@ void print_one_large_struct( linked_list1 )
|
||||
* IN struct array_rep_info_t linked_list2
|
||||
* IN struct array_rep_info_t linked_list3
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void print_array_rep(
|
||||
struct array_rep_info_t linked_list1,
|
||||
struct array_rep_info_t linked_list2,
|
||||
struct array_rep_info_t linked_list3)
|
||||
#else
|
||||
void print_array_rep( linked_list1, linked_list2, linked_list3 )
|
||||
struct array_rep_info_t linked_list1;
|
||||
struct array_rep_info_t linked_list2;
|
||||
struct array_rep_info_t linked_list3;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
@ -895,13 +1083,21 @@ void print_array_rep( linked_list1, linked_list2, linked_list3 )
|
||||
* IN struct array_rep_info_t linked_list3
|
||||
* IN struct array_rep_info_t linked_list4
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void sum_array_print (
|
||||
int seed,
|
||||
struct array_rep_info_t linked_list1,
|
||||
struct array_rep_info_t linked_list2,
|
||||
struct array_rep_info_t linked_list3,
|
||||
struct array_rep_info_t linked_list4)
|
||||
#else
|
||||
void sum_array_print ( seed, linked_list1, linked_list2, linked_list3,linked_list4)
|
||||
int seed;
|
||||
struct array_rep_info_t linked_list1;
|
||||
struct array_rep_info_t linked_list2;
|
||||
struct array_rep_info_t linked_list3;
|
||||
struct array_rep_info_t linked_list4;
|
||||
|
||||
#endif
|
||||
{
|
||||
int index;
|
||||
int sum;
|
||||
@ -925,10 +1121,15 @@ void sum_array_print ( seed, linked_list1, linked_list2, linked_list3,linked_lis
|
||||
* IN struct array_rep_info_t *linked_list
|
||||
* IN int seed
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_array_rep(
|
||||
struct array_rep_info_t *linked_list,
|
||||
int seed)
|
||||
#else
|
||||
void init_array_rep( linked_list, seed )
|
||||
struct array_rep_info_t *linked_list;
|
||||
int seed;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
@ -994,7 +1195,8 @@ int main () {
|
||||
for (index = 0; index < 120; index++) {
|
||||
if ((index%2) == 0) char_array[index] = 'Z';
|
||||
else char_array[index] = 'a';
|
||||
} char_array[120] = '\0'; /* call-ar-st.exp uses line numbers everywhere */
|
||||
}
|
||||
char_array[120] = '\0';
|
||||
|
||||
for (index = 0; index < 100; index++) {
|
||||
double_array[index] = index*23.4567;
|
||||
|
@ -101,25 +101,36 @@ if ![runto_main] then {
|
||||
continue
|
||||
}
|
||||
|
||||
#go -until 1007
|
||||
gdb_test "tbreak 1007" \
|
||||
"Breakpoint \[0-9\]+.*file.*$srcfile, line 1007.*" \
|
||||
"tbreakpoint line 1007"
|
||||
#go -until 1209
|
||||
gdb_test "tbreak 1209" \
|
||||
"Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
|
||||
"tbreakpoint line 1209"
|
||||
|
||||
gdb_test continue \
|
||||
"Continuing\\..*main \\(\\) at.*$srcfile:1007.*" \
|
||||
"Continuing\\..*main \\(\\) at.*$srcfile:1209.*" \
|
||||
"run until breakpoint set at a line"
|
||||
|
||||
|
||||
#call print_double_array(double_array)
|
||||
if {![target_info exists gdb,skip_float_tests]} {
|
||||
send_gdb "print print_double_array(double_array)\n"
|
||||
gdb_expect {
|
||||
-re "array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+.*$gdb_prompt $" {
|
||||
pass "print print_double_array(double_array)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_double_array(double_array)" }
|
||||
timeout { fail "(timeout) print print_double_array(double_array)" }
|
||||
gdb_expect_list "print print_double_array(double_array)" ".*$gdb_prompt $" {
|
||||
"\[ \t\r\n\]+array_d :"
|
||||
"\[ \t\r\n\]+========="
|
||||
"\[ \t\r\n\]+0.000000"
|
||||
"\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
|
||||
"\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
|
||||
"\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
|
||||
"\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
|
||||
"\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
|
||||
"\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
|
||||
"\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
|
||||
"\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
|
||||
"\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
|
||||
"\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
|
||||
"\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
|
||||
"\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
|
||||
"\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,18 +147,18 @@ gdb_expect {
|
||||
|
||||
|
||||
|
||||
#go -until 1014
|
||||
gdb_test "tbreak 1014" \
|
||||
"Breakpoint.*file.*$srcfile, line 1014.*" \
|
||||
"tbreakpoint line 1014"
|
||||
#go -until 1216
|
||||
gdb_test "tbreak 1216" \
|
||||
"Breakpoint.*file.*$srcfile, line 1216.*" \
|
||||
"tbreakpoint line 1216"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+\[ \t\r\n\]+main.*at.*$srcfile:1014\[ \t\r\n\]+.*print_double_array\\(double_array\\).*$gdb_prompt $" {
|
||||
pass "continue to 1014"
|
||||
-re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+\[ \t\r\n\]+main.*at.*$srcfile:1216\[ \t\r\n\]+.*print_double_array\\(double_array\\).*$gdb_prompt $" {
|
||||
pass "continue to 1216"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1014" }
|
||||
timeout { fail "(timeout) continue to 1014" }
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1216" }
|
||||
timeout { fail "(timeout) continue to 1216" }
|
||||
}
|
||||
|
||||
# I am disabling this test, because it takes too long. I verified by
|
||||
@ -163,19 +174,40 @@ gdb_expect {
|
||||
# }
|
||||
|
||||
#set timeout $oldtimeout
|
||||
#go -until 1018
|
||||
gdb_test "tbreak 1018" \
|
||||
"Breakpoint.* file .*$srcfile, line 1018.*" \
|
||||
"tbreakpoint line 1018"
|
||||
#go -until 1220
|
||||
gdb_test "tbreak 1220" \
|
||||
"Breakpoint.* file .*$srcfile, line 1220.*" \
|
||||
"tbreakpoint line 1220"
|
||||
|
||||
gdb_test continue \
|
||||
"Continuing\\..*array_d :.*array_f :.*student id :\[\t \]+.*YELLOW.*array_i :.*main \\(\\) at .*call-ar-st.c:1018\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)." \
|
||||
"continuing to breakpoint 1018"
|
||||
send_gdb "continue\n"
|
||||
gdb_expect_list "continuing to breakpoint 1220" ".*$gdb_prompt $" {
|
||||
"Continuing\\."
|
||||
"\[ \t\r\n\]+array_d :"
|
||||
"\[ \t\r\n\]+========="
|
||||
"\[ \t\r\n\]+0.000000"
|
||||
"\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
|
||||
"\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
|
||||
"\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
|
||||
"\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
|
||||
"\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
|
||||
"\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
|
||||
"\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
|
||||
"\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
|
||||
"\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
|
||||
"\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
|
||||
"\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
|
||||
"\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
|
||||
"\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
|
||||
".*array_f :"
|
||||
".*student id :\[\t \]+.*YELLOW"
|
||||
".*array_i :"
|
||||
".*main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
|
||||
}
|
||||
|
||||
#step
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:287\[ \t\r\n\]+287.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step inside print_all_arrays"}
|
||||
-re "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:306\[ \t\r\n\]+306.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step inside print_all_arrays"}
|
||||
-re ".*$gdb_prompt $" { fail "step inside print_all_arrays" }
|
||||
timeout { fail "step inside print_all_arrays (timeout)" }
|
||||
}
|
||||
@ -184,7 +216,7 @@ gdb_test continue \
|
||||
#step -over
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "array_i :.*288.*print_char_array\\(array_c\\);.*$gdb_prompt $" {pass "next over print_int_array in print-all_arrays"}
|
||||
-re "array_i :.*307.*print_char_array\\(array_c\\);.*$gdb_prompt $" {pass "next over print_int_array in print-all_arrays"}
|
||||
-re ".*$gdb_prompt $" { fail "next over print_int_array in print-all_arrays" }
|
||||
timeout { fail "next over print_int_array in print-all_arrays (timeout)" }
|
||||
}
|
||||
@ -194,21 +226,52 @@ gdb_test continue \
|
||||
#call print_double_array(array_d)
|
||||
if {![target_info exists gdb,skip_float_tests]} {
|
||||
send_gdb "print print_double_array(array_d)\n"
|
||||
gdb_expect {
|
||||
-re "array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+.*$gdb_prompt $" {
|
||||
pass "print print_double_array(array_d)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_double_array(array_d)" }
|
||||
timeout { fail "(timeout) print print_double_array(array_d)" }
|
||||
gdb_expect_list "print print_double_array(array_d)" ".*$gdb_prompt $" {
|
||||
"array_d :"
|
||||
"\[ \t\r\n\]+========="
|
||||
"\[ \t\r\n\]+\[ \t\r\n\]+0.000000"
|
||||
"\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
|
||||
"\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
|
||||
"\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
|
||||
"\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
|
||||
"\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
|
||||
"\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
|
||||
"\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
|
||||
"\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
|
||||
"\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
|
||||
"\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
|
||||
"\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
|
||||
"\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
|
||||
"\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
|
||||
}
|
||||
}
|
||||
|
||||
#go -until 1034
|
||||
gdb_test "tbreak 1034" \
|
||||
"Breakpoint.* file .*$srcfile, line 1034.*" \
|
||||
"tbreakpoint line 1034"
|
||||
#go -until 1236
|
||||
gdb_test "tbreak 1236" \
|
||||
"Breakpoint.* file .*$srcfile, line 1236.*" \
|
||||
"tbreakpoint line 1236"
|
||||
|
||||
gdb_test continue "Continuing\\..*array_c.*array_f.*array_d.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1034.*printf\\(.BYE BYE FOR NOW.n.\\)." "continuing to 1034"
|
||||
send_gdb "continue\n"
|
||||
gdb_expect_list "continuing to 1236" ".*$gdb_prompt $" {
|
||||
"Continuing\\..*array_c"
|
||||
".*array_f"
|
||||
"\[ \t\r\n\]+array_d :"
|
||||
"\[ \t\r\n\]+========="
|
||||
"\[ \t\r\n\]+0.000000"
|
||||
"\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
|
||||
"\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200"
|
||||
"\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800"
|
||||
"\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400"
|
||||
"\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000"
|
||||
"\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600"
|
||||
"\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200"
|
||||
"\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800"
|
||||
"\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400"
|
||||
"\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000"
|
||||
"\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600"
|
||||
"\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200"
|
||||
"\[ \t\r\n\]+2275.299900 2298.756600 2322.213300.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
|
||||
}
|
||||
|
||||
|
||||
#call sum_array_print(10, *list1, *list2, *list3, *list4)
|
||||
@ -225,9 +288,9 @@ gdb_expect {
|
||||
#step over
|
||||
send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re ".*BYE BYE FOR NOW.*1035.*printf\\(.VERY GREEN GRASS.n.\\);.*$gdb_prompt $" { pass "next to 1035"}
|
||||
-re ".*$gdb_prompt $" { fail "next to 1035" }
|
||||
timeout { fail "next to 1035(timeout)" }
|
||||
-re ".*BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*$gdb_prompt $" { pass "next to 1237"}
|
||||
-re ".*$gdb_prompt $" { fail "next to 1237" }
|
||||
timeout { fail "next to 1237(timeout)" }
|
||||
}
|
||||
|
||||
#call print_array_rep(\*list1, \*list2, \*list3)
|
||||
@ -241,17 +304,17 @@ gdb_expect {
|
||||
timeout { fail "(timeout) print print_array_rep(*list1, *list2, *list3)" }
|
||||
}
|
||||
|
||||
#go -until 1039
|
||||
gdb_test "tbreak 1039" \
|
||||
"Breakpoint..* file .*$srcfile, line 1039.*" \
|
||||
"tbreakpoint line 1039"
|
||||
#go -until 1241
|
||||
gdb_test "tbreak 1241" \
|
||||
"Breakpoint..* file .*$srcfile, line 1241.*" \
|
||||
"tbreakpoint line 1241"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*main \\(\\) at .*call-ar-st.c:1039\r\n1039\t\[ \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {
|
||||
pass "continue to 1039"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1039"}
|
||||
timeout { fail "(timeout) continue to 1039"}
|
||||
-re ".*main \\(\\) at .*call-ar-st.c:1241\r\n1241\t\[ \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {
|
||||
pass "continue to 1241"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1241"}
|
||||
timeout { fail "(timeout) continue to 1241"}
|
||||
}
|
||||
|
||||
|
||||
@ -268,7 +331,7 @@ gdb_test "break sum_array_print" \
|
||||
".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
|
||||
"set breakpoint in sum_array_print"
|
||||
gdb_test "continue" \
|
||||
".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:909\[ \t\n\r\]+909.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
|
||||
".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
|
||||
"check args of sum_array_print"
|
||||
|
||||
#call print_array_rep(linked_list1, linked_list2, linked_list3)
|
||||
@ -285,17 +348,17 @@ gdb_test "continue" \
|
||||
#}
|
||||
|
||||
|
||||
#go -until 1079
|
||||
gdb_test "tbreak 1079" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1079.*" \
|
||||
"tbreakpoint line 1079"
|
||||
#go -until 1281
|
||||
gdb_test "tbreak 1281" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1281.*" \
|
||||
"tbreakpoint line 1281"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1079.*c = 0.*$gdb_prompt $" {
|
||||
pass "continue to 1079"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1079"}
|
||||
timeout { fail "(timeout) continue to 1079"}
|
||||
-re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c = 0.*$gdb_prompt $" {
|
||||
pass "continue to 1281"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1281"}
|
||||
timeout { fail "(timeout) continue to 1281"}
|
||||
}
|
||||
|
||||
#call print_small_structs(*struct1, *struct2, *struct3, *struct4,*flags, *flags_combo,
|
||||
@ -334,30 +397,51 @@ if {![target_info exists gdb,skip_float_tests]} {
|
||||
}
|
||||
}
|
||||
|
||||
#go -until 1084
|
||||
gdb_test "tbreak 1084" \
|
||||
"Breakpoint .* file .*call-ar-st.c, line 1084.*" \
|
||||
"tbreakpoint line 1084"
|
||||
#go -until 1286
|
||||
gdb_test "tbreak 1286" \
|
||||
"Breakpoint .* file .*call-ar-st.c, line 1286.*" \
|
||||
"tbreakpoint line 1286"
|
||||
|
||||
gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1084\[\t\r\n \]+1084.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1084"
|
||||
gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286"
|
||||
|
||||
# We can't just assume that a "step" will get us into print_long_arg_list here,either.
|
||||
gdb_test "tbreak print_long_arg_list" \
|
||||
"Breakpoint .* file .*call-ar-st.c, line .*" \
|
||||
"tbreak in print_long_arg_list after stepping into memcpy"
|
||||
send_gdb "continue\n"
|
||||
if {![target_info exists gdb,skip_float_tests]} {
|
||||
gdb_expect {
|
||||
-re ".*print_long_arg_list \\(a=22.219999999999999, b=33.332999999999998, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.3399999999999999\}, d3=\{double1 = 675.09123\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at ${srcdir}/${subdir}/${srcfile}:813\[\r\n\]+813\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
|
||||
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
|
||||
timeout { fail "step into print_long_arg_list (timeout)" }
|
||||
}
|
||||
if { [istarget "hppa*-*-hpux*"] } {
|
||||
#
|
||||
# NOTE:(FIXME)
|
||||
# the aCC demangler cannot demangle the name of a function with >10 args.
|
||||
# so I added a .* after the name of the function, to match the
|
||||
# incredibly long mangled name
|
||||
# (getting aCC's libdemangle.a bundled w/ the system?)
|
||||
# DTS CLLbs16994 coulter 990114
|
||||
#
|
||||
# FIXME: use step for hppa* testing for now
|
||||
# guo 990621
|
||||
#
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re ".*print_long_arg_list.*\\(a=22.219999999999999, b=33.332999999999998, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.3399999999999999\}, d3=\{double1 = 675.09123\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at ${srcdir}/${subdir}/${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
|
||||
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
|
||||
timeout { fail "step into print_long_arg_list (timeout)" }
|
||||
}
|
||||
} else {
|
||||
gdb_expect {
|
||||
-re ".*print_long_arg_list \\(.*\\).*$gdb_prompt $" { pass "step into print_long_arg_list" }
|
||||
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
|
||||
timeout { fail "step into print_long_arg_list (timeout)" }
|
||||
}
|
||||
|
||||
# We can't just assume that a "step" will get us into print_long_arg_list here,either.
|
||||
gdb_test "tbreak print_long_arg_list" \
|
||||
"Breakpoint .* file .*call-ar-st.c, line .*" \
|
||||
"tbreak in print_long_arg_list after stepping into memcpy"
|
||||
send_gdb "continue\n"
|
||||
if {![target_info exists gdb,skip_float_tests]} {
|
||||
gdb_expect {
|
||||
-re ".*print_long_arg_list \\(a=22.219999999999999, b=33.332999999999998, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.3399999999999999\}, d3=\{double1 = 675.09123\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at ${srcdir}/${subdir}/${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
|
||||
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
|
||||
timeout { fail "step into print_long_arg_list (timeout)" }
|
||||
}
|
||||
} else {
|
||||
gdb_expect {
|
||||
-re ".*print_long_arg_list \\(.*\\).*$gdb_prompt $" { pass "step into print_long_arg_list" }
|
||||
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
|
||||
timeout { fail "step into print_long_arg_list (timeout)" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#call print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)
|
||||
@ -373,19 +457,25 @@ if {![target_info exists gdb,skip_float_tests]} {
|
||||
}
|
||||
|
||||
|
||||
#go -until 1098
|
||||
gdb_test "tbreak 1098" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1098.*" \
|
||||
"tbreakpoint line 1098"
|
||||
#go -until 1300
|
||||
gdb_test "tbreak 1300" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1300.*" \
|
||||
"tbreakpoint line 1300"
|
||||
|
||||
gdb_test continue "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*call-ar-st.c:1098.*1098.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
|
||||
"continue to 1098"
|
||||
gdb_test continue "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*call-ar-st.c:1300.*1300.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
|
||||
"continue to 1300"
|
||||
|
||||
|
||||
# FIXME:
|
||||
# HP aCC demangler currently does not handle hp aCC functions with >10 args
|
||||
# DTS CLLbs16994 coulter 990114
|
||||
|
||||
if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
|
||||
#step
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "
|
||||
init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:385\[ \t\n\r\]+385.*bit_flags_combo->alpha = a;.*$gdb_prompt $" {
|
||||
init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:416\[ \t\n\r\]+416.*bit_flags_combo->alpha = a;.*$gdb_prompt $" {
|
||||
pass "step into init_bit_flags_combo"}
|
||||
-re ".*$gdb_prompt $" { fail "step into init_bit_flags_combo" }
|
||||
timeout { fail "step into init_bit_flags_combo (timeout)" }
|
||||
@ -402,13 +492,13 @@ gdb_expect {
|
||||
}
|
||||
|
||||
|
||||
#go -until 1103
|
||||
gdb_test "tbreak 1103" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1103.*" \
|
||||
"tbreakpoint line 1103"
|
||||
#go -until 1305
|
||||
gdb_test "tbreak 1305" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1305.*" \
|
||||
"tbreakpoint line 1305"
|
||||
|
||||
gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1103\[\r\n\t \]+1103.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
|
||||
"continue to 1103"
|
||||
gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
|
||||
"continue to 1305"
|
||||
|
||||
#call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
|
||||
if {![target_info exists gdb,skip_float_tests]} {
|
||||
@ -423,13 +513,13 @@ if {![target_info exists gdb,skip_float_tests]} {
|
||||
}
|
||||
|
||||
|
||||
#go -until 1109
|
||||
gdb_test "tbreak 1109" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1109.*" \
|
||||
"tbreakpoint line 1109"
|
||||
#go -until 1311
|
||||
gdb_test "tbreak 1311" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1311.*" \
|
||||
"tbreakpoint line 1311"
|
||||
|
||||
gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1109\[ \t\n\r\]+1109.*compute_with_small_structs\\(35\\);" \
|
||||
"continue to 1109"
|
||||
gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \
|
||||
"continue to 1311"
|
||||
|
||||
|
||||
#call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
|
||||
|
@ -119,6 +119,16 @@ void loop_count () {
|
||||
* IN unsigned e -- 0 or 1
|
||||
* IN unsigned o -- 0 or 1
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_bit_flags (
|
||||
struct bit_flags_t *bit_flags,
|
||||
unsigned a,
|
||||
unsigned b,
|
||||
unsigned g,
|
||||
unsigned d,
|
||||
unsigned e,
|
||||
unsigned o)
|
||||
#else
|
||||
void init_bit_flags (bit_flags,a,b,g,d,e,o)
|
||||
struct bit_flags_t *bit_flags;
|
||||
unsigned a;
|
||||
@ -127,6 +137,7 @@ unsigned g;
|
||||
unsigned d;
|
||||
unsigned e;
|
||||
unsigned o;
|
||||
#endif
|
||||
{
|
||||
|
||||
bit_flags->alpha = a;
|
||||
@ -152,6 +163,18 @@ unsigned o;
|
||||
* IN unsigned e -- 0 or 1
|
||||
* IN unsigned o -- 0 or 1
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_bit_flags_combo (
|
||||
struct bit_flags_combo_t *bit_flags_combo,
|
||||
unsigned a,
|
||||
unsigned b,
|
||||
char ch1,
|
||||
unsigned g,
|
||||
unsigned d,
|
||||
char ch2,
|
||||
unsigned e,
|
||||
unsigned o)
|
||||
#else
|
||||
void init_bit_flags_combo (bit_flags_combo, a, b, ch1, g, d, ch2, e, o)
|
||||
struct bit_flags_combo_t *bit_flags_combo;
|
||||
unsigned a;
|
||||
@ -162,6 +185,7 @@ unsigned d;
|
||||
char ch2;
|
||||
unsigned e;
|
||||
unsigned o;
|
||||
#endif
|
||||
{
|
||||
|
||||
bit_flags_combo->alpha = a;
|
||||
@ -180,9 +204,13 @@ unsigned o;
|
||||
* OUT struct one_double_t *one_double -- structure to fill
|
||||
* IN double init_val
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_one_double ( struct one_double_t *one_double, double init_val)
|
||||
#else
|
||||
void init_one_double (one_double, init_val)
|
||||
struct one_double_t *one_double;
|
||||
double init_val;
|
||||
#endif
|
||||
{
|
||||
|
||||
one_double->double1 = init_val;
|
||||
@ -194,10 +222,17 @@ double init_val;
|
||||
* IN float init_val1
|
||||
* IN float init_val2
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_two_floats (
|
||||
struct two_floats_t *two_floats,
|
||||
float init_val1,
|
||||
float init_val2)
|
||||
#else
|
||||
void init_two_floats (two_floats, init_val1, init_val2)
|
||||
struct two_floats_t *two_floats;
|
||||
float init_val1;
|
||||
float init_val2;
|
||||
#endif
|
||||
{
|
||||
|
||||
two_floats->float1 = init_val1;
|
||||
@ -211,11 +246,19 @@ float init_val2;
|
||||
* IN char init_val2
|
||||
* IN char init_val3
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_three_chars (
|
||||
struct three_char_t *three_char,
|
||||
char init_val1,
|
||||
char init_val2,
|
||||
char init_val3)
|
||||
#else
|
||||
void init_three_chars ( three_char, init_val1, init_val2, init_val3)
|
||||
struct three_char_t *three_char;
|
||||
char init_val1;
|
||||
char init_val2;
|
||||
char init_val3;
|
||||
#endif
|
||||
{
|
||||
|
||||
three_char->ch1 = init_val1;
|
||||
@ -232,6 +275,15 @@ char init_val3;
|
||||
* IN char init_val4
|
||||
* IN char init_val5
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_five_chars (
|
||||
struct five_char_t *five_char,
|
||||
char init_val1,
|
||||
char init_val2,
|
||||
char init_val3,
|
||||
char init_val4,
|
||||
char init_val5)
|
||||
#else
|
||||
void init_five_chars ( five_char, init_val1, init_val2, init_val3, init_val4, init_val5)
|
||||
struct five_char_t *five_char;
|
||||
char init_val1;
|
||||
@ -239,6 +291,7 @@ char init_val2;
|
||||
char init_val3;
|
||||
char init_val4;
|
||||
char init_val5;
|
||||
#endif
|
||||
{
|
||||
|
||||
five_char->ch1 = init_val1;
|
||||
@ -254,10 +307,17 @@ char init_val5;
|
||||
* IN int init_val1
|
||||
* IN char init_val2
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_int_char_combo (
|
||||
struct int_char_combo_t *combo,
|
||||
int init_val1,
|
||||
char init_val2)
|
||||
#else
|
||||
void init_int_char_combo ( combo, init_val1, init_val2)
|
||||
struct int_char_combo_t *combo;
|
||||
int init_val1;
|
||||
char init_val2;
|
||||
#endif
|
||||
{
|
||||
|
||||
combo->int1 = init_val1;
|
||||
@ -269,10 +329,15 @@ char init_val2;
|
||||
* OUT struct small_rep_into_t *small_struct -- structure to be filled
|
||||
* IN int seed
|
||||
*****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_struct_rep(
|
||||
struct small_rep_info_t *small_struct,
|
||||
int seed)
|
||||
#else
|
||||
void init_struct_rep( small_struct, seed)
|
||||
struct small_rep_info_t *small_struct;
|
||||
int seed;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
small_struct->value = 2 + (seed*2);
|
||||
@ -283,8 +348,12 @@ int seed;
|
||||
* PRINT_BIT_FLAGS :
|
||||
* IN struct bit_flags_t bit_flags
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags)
|
||||
#else
|
||||
struct bit_flags_t print_bit_flags ( bit_flags)
|
||||
struct bit_flags_t bit_flags;
|
||||
#endif
|
||||
{
|
||||
|
||||
if (bit_flags.alpha) printf("alpha\n");
|
||||
@ -301,8 +370,12 @@ struct bit_flags_t bit_flags;
|
||||
* PRINT_BIT_FLAGS_COMBO :
|
||||
* IN struct bit_flags_combo_t bit_flags_combo
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
|
||||
#else
|
||||
struct bit_flags_combo_t print_bit_flags_combo ( bit_flags_combo )
|
||||
struct bit_flags_combo_t bit_flags_combo;
|
||||
#endif
|
||||
{
|
||||
|
||||
if (bit_flags_combo.alpha) printf("alpha\n");
|
||||
@ -320,8 +393,12 @@ struct bit_flags_combo_t bit_flags_combo;
|
||||
* PRINT_ONE_DOUBLE :
|
||||
* IN struct one_double_t one_double
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct one_double_t print_one_double (struct one_double_t one_double)
|
||||
#else
|
||||
struct one_double_t print_one_double ( one_double )
|
||||
struct one_double_t one_double;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of one_double_t: \n\n");
|
||||
@ -334,8 +411,12 @@ struct one_double_t one_double;
|
||||
* PRINT_TWO_FLOATS :
|
||||
* IN struct two_floats_t two_floats
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct two_floats_t print_two_floats (struct two_floats_t two_floats)
|
||||
#else
|
||||
struct two_floats_t print_two_floats ( two_floats )
|
||||
struct two_floats_t two_floats;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of two_floats_t: \n\n");
|
||||
@ -348,8 +429,12 @@ struct two_floats_t two_floats;
|
||||
* PRINT_THREE_CHARS :
|
||||
* IN struct three_char_t three_char
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct three_char_t print_three_chars (struct three_char_t three_char)
|
||||
#else
|
||||
struct three_char_t print_three_chars ( three_char )
|
||||
struct three_char_t three_char;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of three_char_t: \n\n");
|
||||
@ -362,8 +447,12 @@ struct three_char_t three_char;
|
||||
* PRINT_FIVE_CHARS :
|
||||
* IN struct five_char_t five_char
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct five_char_t print_five_chars (struct five_char_t five_char)
|
||||
#else
|
||||
struct five_char_t print_five_chars ( five_char )
|
||||
struct five_char_t five_char;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of five_char_t: \n\n");
|
||||
@ -378,8 +467,12 @@ struct five_char_t five_char;
|
||||
* PRINT_INT_CHAR_COMBO :
|
||||
* IN struct int_char_combo_t int_char_combo
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_combo)
|
||||
#else
|
||||
struct int_char_combo_t print_int_char_combo ( int_char_combo )
|
||||
struct int_char_combo_t int_char_combo;
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of int_char_combo_t: \n\n");
|
||||
@ -391,9 +484,12 @@ struct int_char_combo_t int_char_combo;
|
||||
/*****************************************************************
|
||||
* PRINT_STRUCT_REP :
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
struct small_rep_info_t print_struct_rep(struct small_rep_info_t struct1)
|
||||
#else
|
||||
struct small_rep_info_t print_struct_rep( struct1 )
|
||||
struct small_rep_info_t struct1;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
printf("Contents of struct1: \n\n");
|
||||
@ -406,8 +502,12 @@ struct small_rep_info_t struct1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
struct array_rep_info_t print_one_large_struct(struct array_rep_info_t linked_list1)
|
||||
#else
|
||||
struct array_rep_info_t print_one_large_struct( linked_list1 )
|
||||
struct array_rep_info_t linked_list1;
|
||||
#endif
|
||||
{
|
||||
|
||||
|
||||
@ -423,10 +523,13 @@ struct array_rep_info_t linked_list1;
|
||||
* IN struct array_rep_info_t *linked_list
|
||||
* IN int seed
|
||||
****************************************************************/
|
||||
#ifdef PROTOTYPES
|
||||
void init_array_rep(struct array_rep_info_t *linked_list, int seed)
|
||||
#else
|
||||
void init_array_rep( linked_list, seed )
|
||||
struct array_rep_info_t *linked_list;
|
||||
int seed;
|
||||
|
||||
#endif
|
||||
{
|
||||
|
||||
int index;
|
||||
|
@ -122,8 +122,10 @@ gdb_expect {
|
||||
|
||||
send_gdb "finish\n"
|
||||
gdb_expect {
|
||||
-re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:514\[ \t\r\n\]+514\[\t \]+return 0;.*$gdb_prompt $" {
|
||||
pass "finish out from loop_count"}
|
||||
-re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:617\[ \t\r\n\]+617\[\t \]+return 0;.*$gdb_prompt $" {
|
||||
pass "finish out from loop_count (line 617)"}
|
||||
-re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:615\[ \t\r\n\]+615\[\t \]+loop_count.*$gdb_prompt $" {
|
||||
pass "finish out from loop_count (line 615)"}
|
||||
-re ".*$gdb_prompt $" { fail "finish out from loop_count"}
|
||||
timeout { fail "(timeout)finish out from loop_count"}
|
||||
}
|
||||
|
@ -1,16 +1,33 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char buf[100];
|
||||
char bigbuf[1000];
|
||||
char * s;
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
char * str_func1(char *s1)
|
||||
#else
|
||||
char * str_func1(s1)
|
||||
char *s1;
|
||||
#endif
|
||||
{
|
||||
printf("first string arg is: %s\n", s1);
|
||||
strcpy(bigbuf, s1);
|
||||
return bigbuf;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
char * str_func(
|
||||
char * s1,
|
||||
char * s2,
|
||||
char * s3,
|
||||
char * s4,
|
||||
char * s5,
|
||||
char * s6,
|
||||
char * s7)
|
||||
#else
|
||||
char * str_func(s1,
|
||||
s2,
|
||||
s3,
|
||||
@ -25,6 +42,7 @@ char * s4;
|
||||
char * s5;
|
||||
char * s6;
|
||||
char * s7;
|
||||
#endif
|
||||
{
|
||||
printf("first string arg is: %s\n", s1);
|
||||
printf("second string arg is: %s\n", s2);
|
||||
@ -49,11 +67,12 @@ link_malloc ()
|
||||
return (char*) malloc (1);
|
||||
}
|
||||
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
s = &buf[0];
|
||||
strcpy(buf, "test string");
|
||||
str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12");
|
||||
str_func1("abcd");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -217,26 +217,25 @@ gdb_expect {
|
||||
timeout { fail "(timeout) call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
|
||||
}
|
||||
|
||||
#print str_func(s,s,s,s,s,s,s,s)
|
||||
send_gdb "print str_func(s,s,s,s,s,s,s,s)\n"
|
||||
#print str_func(s,s,s,s,s,s,s)
|
||||
send_gdb "print str_func(s,s,s,s,s,s,s)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*$gdb_prompt $" {
|
||||
pass "print str_func(s,s,s,s,s,s,s,s)"
|
||||
pass "print str_func(s,s,s,s,s,s,s)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print str_func(s,s,s,s,s,s,s,s)" }
|
||||
timeout { fail "(timeout) print str_func(s,s,s,s,s,s,s,s)" }
|
||||
-re ".*$gdb_prompt $" { fail "print str_func(s,s,s,s,s,s,s)" }
|
||||
timeout { fail "(timeout) print str_func(s,s,s,s,s,s,s)" }
|
||||
}
|
||||
|
||||
#call str_func(s,s,s,s,s,s,s,s)
|
||||
send_gdb "call str_func(s,s,s,s,s,s,s,s)\n"
|
||||
#call str_func(s,s,s,s,s,s,s)
|
||||
send_gdb "call str_func(s,s,s,s,s,s,s)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*$gdb_prompt $" {
|
||||
pass "call str_func(s,s,s,s,s,s,s,s)"
|
||||
pass "call str_func(s,s,s,s,s,s,s)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "call str_func(s,s,s,s,s,s,s,s)" }
|
||||
timeout { fail "(timeout) call str_func(s,s,s,s,s,s,s,s)" }
|
||||
-re ".*$gdb_prompt $" { fail "call str_func(s,s,s,s,s,s,s)" }
|
||||
timeout { fail "(timeout) call str_func(s,s,s,s,s,s,s)" }
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
~
|
||||
|
@ -8,6 +8,9 @@
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
char char_val1 = 'a';
|
||||
char char_val2 = 'b';
|
||||
|
||||
@ -28,8 +31,8 @@ double double_val2 = -67.66;
|
||||
|
||||
#define DELTA (0.001)
|
||||
|
||||
char *string_val1 = "string 1";
|
||||
char *string_val2 = "string 2";
|
||||
char *string_val1 = (char *)"string 1";
|
||||
char *string_val2 = (char *)"string 2";
|
||||
|
||||
char char_array_val1[] = "carray 1";
|
||||
char char_array_val2[] = "carray 2";
|
||||
@ -46,15 +49,20 @@ struct struct1 {
|
||||
|
||||
/* Some functions that can be passed as arguments to other test
|
||||
functions, or called directly. */
|
||||
|
||||
int add (a, b)
|
||||
int a, b;
|
||||
#ifdef PROTOTYPES
|
||||
int add (int a, int b)
|
||||
#else
|
||||
int add (a, b) int a, b;
|
||||
#endif
|
||||
{
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
int doubleit (a)
|
||||
int a;
|
||||
#ifdef PROTOTYPES
|
||||
int doubleit (int a)
|
||||
#else
|
||||
int doubleit (a) int a;
|
||||
#endif
|
||||
{
|
||||
return (a + a);
|
||||
}
|
||||
@ -69,20 +77,29 @@ enum enumtype enum_val1 = enumval1;
|
||||
enum enumtype enum_val2 = enumval2;
|
||||
enum enumtype enum_val3 = enumval3;
|
||||
|
||||
int t_enum_value1 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
#ifdef PROTOTYPES
|
||||
int t_enum_value1 (enum enumtype enum_arg)
|
||||
#else
|
||||
int t_enum_value1 (enum_arg) enum enumtype enum_arg;
|
||||
#endif
|
||||
{
|
||||
return (enum_arg == enum_val1);
|
||||
}
|
||||
|
||||
int t_enum_value2 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
#ifdef PROTOTYPES
|
||||
int t_enum_value2 (enum enumtype enum_arg)
|
||||
#else
|
||||
int t_enum_value2 (enum_arg) enum enumtype enum_arg;
|
||||
#endif
|
||||
{
|
||||
return (enum_arg == enum_val2);
|
||||
}
|
||||
|
||||
int t_enum_value3 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
#ifdef PROTOTYPES
|
||||
int t_enum_value3 (enum enumtype enum_arg)
|
||||
#else
|
||||
int t_enum_value3 (enum_arg) enum enumtype enum_arg;
|
||||
#endif
|
||||
{
|
||||
return (enum_arg == enum_val3);
|
||||
}
|
||||
@ -90,9 +107,11 @@ enum enumtype enum_arg;
|
||||
/* A function that takes a vector of integers (along with an explicit
|
||||
count) and returns their sum. */
|
||||
|
||||
int sum_args (argc, argv)
|
||||
int argc;
|
||||
int argv[];
|
||||
#ifdef PROTOTYPES
|
||||
int sum_args (int argc, int argv[])
|
||||
#else
|
||||
int sum_args (argc, argv) int argc; int argv[];
|
||||
#endif
|
||||
{
|
||||
int sumval = 0;
|
||||
int idx;
|
||||
@ -107,6 +126,15 @@ int argv[];
|
||||
/* Test that we can call functions that take structs and return
|
||||
members from that struct */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
char t_structs_c (struct struct1 tstruct) { return (tstruct.c); }
|
||||
short t_structs_s (struct struct1 tstruct) { return (tstruct.s); }
|
||||
int t_structs_i (struct struct1 tstruct) { return (tstruct.i); }
|
||||
long t_structs_l (struct struct1 tstruct) { return (tstruct.l); }
|
||||
float t_structs_f (struct struct1 tstruct) { return (tstruct.f); }
|
||||
double t_structs_d (struct struct1 tstruct) { return (tstruct.d); }
|
||||
char *t_structs_a (struct struct1 tstruct) { return (tstruct.a); }
|
||||
#else
|
||||
char t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
|
||||
short t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
|
||||
int t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
|
||||
@ -114,19 +142,30 @@ long t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
|
||||
float t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
|
||||
double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
|
||||
char *t_structs_a (tstruct) struct struct1 tstruct; { return (tstruct.a); }
|
||||
#endif
|
||||
|
||||
/* Test that calling functions works if there are a lot of arguments. */
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
sum10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
|
||||
#else
|
||||
int
|
||||
sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
|
||||
#endif
|
||||
{
|
||||
return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
|
||||
}
|
||||
|
||||
/* Test that args are passed in the right order. */
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
cmp10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
|
||||
#else
|
||||
int
|
||||
cmp10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
|
||||
#endif
|
||||
{
|
||||
return
|
||||
(i0 == 0) && (i1 == 1) && (i2 == 2) && (i3 == 3) && (i4 == 4) &&
|
||||
@ -152,14 +191,21 @@ int main ()
|
||||
either 0 or 1, depending upon whether the values were
|
||||
passed incorrectly or correctly, respectively. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_char_values (char char_arg1, char char_arg2)
|
||||
#else
|
||||
int t_char_values (char_arg1, char_arg2)
|
||||
char char_arg1, char_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
#ifdef PROTOTYPES
|
||||
t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
|
||||
char arg6, short arg7, int arg8, short arg9, short arg10)
|
||||
#else
|
||||
t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
|
||||
char arg1;
|
||||
short arg2;
|
||||
@ -171,34 +217,47 @@ t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
|
||||
int arg8;
|
||||
short arg9;
|
||||
short arg10;
|
||||
#else
|
||||
t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
|
||||
char arg6, short arg7, int arg8, short arg9, short arg10)
|
||||
#endif
|
||||
{
|
||||
return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_short_values (short short_arg1, short short_arg2)
|
||||
#else
|
||||
int t_short_values (short_arg1, short_arg2)
|
||||
short short_arg1, short_arg2;
|
||||
short short_arg1, short_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_int_values (int int_arg1, int int_arg2)
|
||||
#else
|
||||
int t_int_values (int_arg1, int_arg2)
|
||||
int int_arg1, int_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_long_values (long long_arg1, long long_arg2)
|
||||
#else
|
||||
int t_long_values (long_arg1, long_arg2)
|
||||
long long_arg1, long_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_float_values (float float_arg1, float float_arg2)
|
||||
#else
|
||||
int t_float_values (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
&& (float_arg1 - float_val1) > -DELTA
|
||||
@ -207,13 +266,13 @@ float float_arg1, float_arg2;
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
#ifdef PROTOTYPES
|
||||
t_float_values2 (float float_arg1, float float_arg2)
|
||||
#else
|
||||
/* In this case we are just duplicating t_float_values, but that is the
|
||||
easiest way to deal with either ANSI or non-ANSI. */
|
||||
t_float_values2 (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
#else
|
||||
t_float_values2 (float float_arg1, float float_arg2)
|
||||
#endif
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
@ -222,8 +281,12 @@ t_float_values2 (float float_arg1, float float_arg2)
|
||||
&& (float_arg2 - float_val2) > -DELTA);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_double_values (double double_arg1, double double_arg2)
|
||||
#else
|
||||
int t_double_values (double_arg1, double_arg2)
|
||||
double double_arg1, double_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((double_arg1 - double_val1) < DELTA
|
||||
&& (double_arg1 - double_val1) > -DELTA
|
||||
@ -231,15 +294,23 @@ double double_arg1, double_arg2;
|
||||
&& (double_arg2 - double_val2) > -DELTA);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_string_values (char *string_arg1, char *string_arg2)
|
||||
#else
|
||||
int t_string_values (string_arg1, string_arg2)
|
||||
char *string_arg1, *string_arg2;
|
||||
#endif
|
||||
{
|
||||
return (!strcmp (string_arg1, string_val1) &&
|
||||
!strcmp (string_arg2, string_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_char_array_values (char char_array_arg1[], char char_array_arg2[])
|
||||
#else
|
||||
int t_char_array_values (char_array_arg1, char_array_arg2)
|
||||
char char_array_arg1[], char_array_arg2[];
|
||||
#endif
|
||||
{
|
||||
return (!strcmp (char_array_arg1, char_array_val1) &&
|
||||
!strcmp (char_array_arg2, char_array_val2));
|
||||
@ -264,17 +335,25 @@ char char_array_arg1[], char_array_arg2[];
|
||||
that function indirectly through the function pointer. This would fail
|
||||
on the HPPA. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_func_values (int (*func_arg1)(int, int), int (*func_arg2)(int))
|
||||
#else
|
||||
int t_func_values (func_arg1, func_arg2)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int (*func_arg2) PARAMS ((int));
|
||||
#endif
|
||||
{
|
||||
return ((*func_arg1) (5,5) == (*func_val1) (5,5)
|
||||
&& (*func_arg2) (6) == (*func_val2) (6));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_call_add (int (*func_arg1)(int, int), int a, int b)
|
||||
#else
|
||||
int t_call_add (func_arg1, a, b)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int a, b;
|
||||
#endif
|
||||
{
|
||||
return ((*func_arg1)(a, b));
|
||||
}
|
||||
|
@ -31,14 +31,8 @@ set testfile "callfuncs"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
set prototypes 1
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
set prototypes 0;
|
||||
# built the second test case since we can't use prototypes
|
||||
warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
|
||||
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
|
||||
@ -48,6 +42,12 @@ if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if {$hp_aCC_compiler} {
|
||||
set prototypes 1
|
||||
} else {
|
||||
set prototypes 0
|
||||
}
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
@ -129,13 +129,13 @@ proc do_function_calls {} {
|
||||
# Gcc emits different stabs for the two parameters; the first is
|
||||
# claimed to be a float, the second a double.
|
||||
# dbxout.c in gcc claims this is the desired behavior.
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
|
||||
|
||||
# Test passing of arguments which might not be widened.
|
||||
@ -144,7 +144,7 @@ proc do_function_calls {} {
|
||||
# Although PR 5318 mentions SunOS specifically, this seems
|
||||
# to be a generic problem on quite a few platforms.
|
||||
if $prototypes then {
|
||||
setup_xfail "hppa*-*-*" "sparc-*-*" "mips*-*-*" 5318
|
||||
setup_xfail "sparc-*-*" "mips*-*-*" 5318
|
||||
if {!$gcc_compiled} then {
|
||||
setup_xfail "alpha-dec-osf2*" "i*86-*-sysv4*" 5318
|
||||
}
|
||||
@ -186,7 +186,17 @@ proc do_function_calls {} {
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(add,func_val2)" "You cannot.*ignored.*"
|
||||
send_gdb "p t_func_values(add,func_val2)\n"
|
||||
gdb_expect {
|
||||
-re "You cannot.*ignored.*" {pass "p t_func_values(add,func_val2)"}
|
||||
-re "Program received signal SIGBUS, Bus error.*" {
|
||||
if [istarget hppa*-*-hpux*] {
|
||||
pass "p t_func_values(add,func_val2)"
|
||||
} else {
|
||||
fail "p t_func_values(add,func_val2)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gdb_test "p t_func_values(add,func_val2)" " = 1"
|
||||
}
|
||||
@ -194,7 +204,17 @@ proc do_function_calls {} {
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" "You cannot.*ignored.*"
|
||||
send_gdb "p t_func_values(func_val1,doubleit)\n"
|
||||
gdb_expect {
|
||||
-re "You cannot.*ignored.*" {pass "p t_func_values(func_val1,doubleit)"}
|
||||
-re "Program received signal SIGBUS, Bus error.*" {
|
||||
if [istarget hppa*-*-hpux*] {
|
||||
pass "p t_func_values(func_val1,doubleit)"
|
||||
} else {
|
||||
fail "p t_func_values(func_val1,doubleit)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
|
||||
}
|
||||
@ -204,7 +224,17 @@ proc do_function_calls {} {
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_call_add(add,3,4)" "You cannot.*ignored.*"
|
||||
send_gdb "p t_call_add(add,3,4)\n"
|
||||
gdb_expect {
|
||||
-re "You cannot.*ignored.*" {pass "p t_call_add(add,3,4)"}
|
||||
-re "Program received signal SIGBUS, Bus error.*" {
|
||||
if [istarget hppa*-*-hpux*] {
|
||||
pass "p t_call_add(add,3,4)"
|
||||
} else {
|
||||
fail "p t_call_add(add,3,4)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gdb_test "p t_call_add(add,3,4)" " = 7"
|
||||
}
|
||||
@ -255,12 +285,27 @@ gdb_test "set print sevenbit-strings" ""
|
||||
gdb_test "set print address off" ""
|
||||
gdb_test "set width 0" ""
|
||||
|
||||
if { ![set_lang_c] } {
|
||||
gdb_suppress_tests;
|
||||
} else {
|
||||
if { $hp_aCC_compiler } {
|
||||
# Do not set language explicitly to 'C'. This will cause aCC
|
||||
# tests to fail because promotion rules are different. Just let
|
||||
# the language be set to the default.
|
||||
|
||||
if { ![runto_main] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
# However, turn off overload-resolution for aCC. Having it on causes
|
||||
# a lot of failures.
|
||||
|
||||
gdb_test "set overload-resolution 0" ".*"
|
||||
} else {
|
||||
if { ![set_lang_c] } {
|
||||
gdb_suppress_tests;
|
||||
} else {
|
||||
if { ![runto_main] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gdb_test "next" ".*"
|
||||
|
@ -8,6 +8,8 @@
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
|
||||
# include <string.h>
|
||||
|
||||
char char_val1 = 'a';
|
||||
char char_val2 = 'b';
|
||||
|
||||
@ -28,8 +30,8 @@ double double_val2 = -67.66;
|
||||
|
||||
#define DELTA (0.001)
|
||||
|
||||
char *string_val1 = "string 1";
|
||||
char *string_val2 = "string 2";
|
||||
char *string_val1 = (char *)"string 1";
|
||||
char *string_val2 = (char *)"string 2";
|
||||
|
||||
char char_array_val1[] = "carray 1";
|
||||
char char_array_val2[] = "carray 2";
|
||||
@ -46,15 +48,21 @@ struct struct1 {
|
||||
|
||||
/* Some functions that can be passed as arguments to other test
|
||||
functions, or called directly. */
|
||||
|
||||
int add (a, b)
|
||||
int a, b;
|
||||
#ifdef PROTOTYPES
|
||||
int add (int a, int b)
|
||||
#else
|
||||
int add (a, b) int a, b;
|
||||
#endif
|
||||
{
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int doubleit (int a)
|
||||
#else
|
||||
int doubleit (a)
|
||||
int a;
|
||||
#endif
|
||||
{
|
||||
return (a + a);
|
||||
}
|
||||
@ -69,20 +77,32 @@ enum enumtype enum_val1 = enumval1;
|
||||
enum enumtype enum_val2 = enumval2;
|
||||
enum enumtype enum_val3 = enumval3;
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_enum_value1 (enum enumtype enum_arg)
|
||||
#else
|
||||
t_enum_value1 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
#endif
|
||||
{
|
||||
return (enum_arg == enum_val1);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_enum_value2 (enum enumtype enum_arg)
|
||||
#else
|
||||
t_enum_value2 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
#endif
|
||||
{
|
||||
return (enum_arg == enum_val2);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_enum_value3 (enum enumtype enum_arg)
|
||||
#else
|
||||
t_enum_value3 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
#endif
|
||||
{
|
||||
return (enum_arg == enum_val3);
|
||||
}
|
||||
@ -90,9 +110,13 @@ enum enumtype enum_arg;
|
||||
/* A function that takes a vector of integers (along with an explicit
|
||||
count) and returns their sum. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int sum_args (int argc, int argv[])
|
||||
#else
|
||||
int sum_args (argc, argv)
|
||||
int argc;
|
||||
int argv[];
|
||||
#endif
|
||||
{
|
||||
int sumval = 0;
|
||||
int idx;
|
||||
@ -107,6 +131,15 @@ int argv[];
|
||||
/* Test that we can call functions that take structs and return
|
||||
members from that struct */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
char t_structs_c (struct struct1 tstruct) { return (tstruct.c); }
|
||||
short t_structs_s (struct struct1 tstruct) { return (tstruct.s); }
|
||||
int t_structs_i (struct struct1 tstruct) { return (tstruct.i); }
|
||||
long t_structs_l (struct struct1 tstruct) { return (tstruct.l); }
|
||||
float t_structs_f (struct struct1 tstruct) { return (tstruct.f); }
|
||||
double t_structs_d (struct struct1 tstruct) { return (tstruct.d); }
|
||||
char *t_structs_a (struct struct1 tstruct) { return (tstruct.a); }
|
||||
#else
|
||||
char t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
|
||||
short t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
|
||||
int t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
|
||||
@ -114,11 +147,16 @@ long t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
|
||||
float t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
|
||||
double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
|
||||
char *t_structs_a (tstruct) struct struct1 tstruct; { return (tstruct.a); }
|
||||
#endif
|
||||
|
||||
/* Test that calling functions works if there are a lot of arguments. */
|
||||
#ifdef PROTOTYPES
|
||||
int sum10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
|
||||
#else
|
||||
int
|
||||
sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
|
||||
#endif
|
||||
{
|
||||
return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
|
||||
}
|
||||
@ -126,27 +164,40 @@ sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
/* Gotta have a main to be able to generate a linked, runnable
|
||||
executable, and also provide a useful place to set a breakpoint. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int main()
|
||||
#else
|
||||
main ()
|
||||
#endif
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
t_structs_c(struct_val1);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/* Functions that expect specific values to be passed and return
|
||||
either 0 or 1, depending upon whether the values were
|
||||
passed incorrectly or correctly, respectively. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_char_values (char char_arg1, char char_arg2)
|
||||
#else
|
||||
int t_char_values (char_arg1, char_arg2)
|
||||
char char_arg1, char_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
#ifdef PROTOTYPES
|
||||
t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
|
||||
char arg6, short arg7, int arg8, short arg9, short arg10)
|
||||
#else
|
||||
t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
|
||||
char arg1;
|
||||
short arg2;
|
||||
@ -158,34 +209,47 @@ t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
|
||||
int arg8;
|
||||
short arg9;
|
||||
short arg10;
|
||||
#else
|
||||
t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
|
||||
char arg6, short arg7, int arg8, short arg9, short arg10)
|
||||
#endif
|
||||
{
|
||||
return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_short_values (short short_arg1, short short_arg2)
|
||||
#else
|
||||
int t_short_values (short_arg1, short_arg2)
|
||||
short short_arg1, short_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_int_values (int int_arg1, int int_arg2)
|
||||
#else
|
||||
int t_int_values (int_arg1, int_arg2)
|
||||
int int_arg1, int_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_long_values (long long_arg1, long long_arg2)
|
||||
#else
|
||||
int t_long_values (long_arg1, long_arg2)
|
||||
long long_arg1, long_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_float_values (float float_arg1, float float_arg2)
|
||||
#else
|
||||
int t_float_values (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
&& (float_arg1 - float_val1) > -DELTA
|
||||
@ -194,13 +258,13 @@ float float_arg1, float_arg2;
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
#ifdef PROTOTYPES
|
||||
t_float_values2 (float float_arg1, float float_arg2)
|
||||
#else
|
||||
/* In this case we are just duplicating t_float_values, but that is the
|
||||
easiest way to deal with either ANSI or non-ANSI. */
|
||||
t_float_values2 (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
#else
|
||||
t_float_values2 (float float_arg1, float float_arg2)
|
||||
#endif
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
@ -209,8 +273,12 @@ t_float_values2 (float float_arg1, float float_arg2)
|
||||
&& (float_arg2 - float_val2) > -DELTA);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_double_values (double double_arg1, double double_arg2)
|
||||
#else
|
||||
int t_double_values (double_arg1, double_arg2)
|
||||
double double_arg1, double_arg2;
|
||||
#endif
|
||||
{
|
||||
return ((double_arg1 - double_val1) < DELTA
|
||||
&& (double_arg1 - double_val1) > -DELTA
|
||||
@ -218,15 +286,23 @@ double double_arg1, double_arg2;
|
||||
&& (double_arg2 - double_val2) > -DELTA);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_string_values (char *string_arg1, char *string_arg2)
|
||||
#else
|
||||
int t_string_values (string_arg1, string_arg2)
|
||||
char *string_arg1, *string_arg2;
|
||||
#endif
|
||||
{
|
||||
return (!strcmp (string_arg1, string_val1) &&
|
||||
!strcmp (string_arg2, string_val2));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_char_array_values (char char_array_arg1[], char char_array_arg2[])
|
||||
#else
|
||||
int t_char_array_values (char_array_arg1, char_array_arg2)
|
||||
char char_array_arg1[], char_array_arg2[];
|
||||
#endif
|
||||
{
|
||||
return (!strcmp (char_array_arg1, char_array_val1) &&
|
||||
!strcmp (char_array_arg2, char_array_val2));
|
||||
@ -251,17 +327,25 @@ char char_array_arg1[], char_array_arg2[];
|
||||
that function indirectly through the function pointer. This would fail
|
||||
on the HPPA. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_func_values (int (*func_arg1)(int, int), int (*func_arg2)(int))
|
||||
#else
|
||||
int t_func_values (func_arg1, func_arg2)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int (*func_arg2) PARAMS ((int));
|
||||
#endif
|
||||
{
|
||||
return ((*func_arg1) (5,5) == (*func_val1) (5,5)
|
||||
&& (*func_arg2) (6) == (*func_val2) (6));
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int t_call_add (int (*func_arg1)(int, int), int a, int b)
|
||||
#else
|
||||
int t_call_add (func_arg1, a, b)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int a, b;
|
||||
#endif
|
||||
{
|
||||
return ((*func_arg1)(a, b));
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
# This file was written by Fred Fish. (fnf@cygnus.com)
|
||||
|
||||
# SAME tests as in callfuncs.exp but here the inferior program does not call malloc.
|
||||
# SAME tests as in callfns.exp but here the inferior program does not call malloc.
|
||||
|
||||
|
||||
|
||||
@ -34,14 +34,8 @@ set testfile "callfuncs2"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
set prototypes 1
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
set prototypes 0;
|
||||
# built the second test case since we can't use prototypes
|
||||
warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
|
||||
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
|
||||
@ -51,6 +45,11 @@ if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if {$hp_aCC_compiler} {
|
||||
set prototypes 1
|
||||
} else {
|
||||
set prototypes 0
|
||||
}
|
||||
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
@ -134,13 +133,13 @@ proc do_function_calls {} {
|
||||
# Gcc emits different stabs for the two parameters; the first is
|
||||
# claimed to be a float, the second a double.
|
||||
# dbxout.c in gcc claims this is the desired behavior.
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
setup_xfail "mn10300-*-*" "hppa*-*-*11*"
|
||||
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
|
||||
|
||||
# Test passing of arguments which might not be widened.
|
||||
@ -149,7 +148,7 @@ proc do_function_calls {} {
|
||||
# Although PR 5318 mentions SunOS specifically, this seems
|
||||
# to be a generic problem on quite a few platforms.
|
||||
if $prototypes then {
|
||||
setup_xfail "hppa*-*-*" "sparc-*-*" "mips*-*-*" 5318
|
||||
setup_xfail "sparc-*-*" "mips*-*-*" 5318
|
||||
if {!$gcc_compiled} then {
|
||||
setup_xfail "alpha-dec-osf2*" "i*86-*-sysv4*" 5318
|
||||
}
|
||||
@ -193,7 +192,17 @@ proc do_function_calls {} {
|
||||
setup_xfail "powerpc*-*-*"
|
||||
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(add,func_val2)" "You cannot.*ignored.*"
|
||||
send_gdb "p t_func_values(add,func_val2)\n"
|
||||
gdb_expect {
|
||||
-re "You cannot.*ignored.*" {pass "p t_func_values(add,func_val2)"}
|
||||
-re "Program received signal SIGBUS, Bus error.*" {
|
||||
if [istarget hppa*-*-hpux*] {
|
||||
pass "p t_func_values(add,func_val2)"
|
||||
} else {
|
||||
fail "p t_func_values(add,func_val2)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gdb_test "p t_func_values(add,func_val2)" " = 1"
|
||||
}
|
||||
@ -202,7 +211,17 @@ proc do_function_calls {} {
|
||||
setup_xfail "powerpc*-*-*"
|
||||
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" "You cannot.*ignored.*"
|
||||
send_gdb "p t_func_values(func_val1,doubleit)\n"
|
||||
gdb_expect {
|
||||
-re "You cannot.*ignored.*" {pass "p t_func_values(func_val1,doubleit)"}
|
||||
-re "Program received signal SIGBUS, Bus error.*" {
|
||||
if [istarget hppa*-*-hpux*] {
|
||||
pass "p t_func_values(func_val1,doubleit)"
|
||||
} else {
|
||||
fail "p t_func_values(func_val1,doubleit)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
|
||||
}
|
||||
@ -213,7 +232,17 @@ proc do_function_calls {} {
|
||||
setup_xfail "powerpc*-*-*"
|
||||
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_call_add(add,3,4)" "You cannot.*ignored.*"
|
||||
send_gdb "p t_call_add(add,3,4)\n"
|
||||
gdb_expect {
|
||||
-re "You cannot.*ignored.*" {pass "p t_call_add(add,3,4)"}
|
||||
-re "Program received signal SIGBUS, Bus error.*" {
|
||||
if [istarget hppa*-*-hpux*] {
|
||||
pass "p t_call_add(add,3,4)"
|
||||
} else {
|
||||
fail "p t_call_add(add,3,4)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gdb_test "p t_call_add(add,3,4)" " = 7"
|
||||
}
|
||||
@ -262,12 +291,24 @@ gdb_test "set print sevenbit-strings" ""
|
||||
gdb_test "set print address off" ""
|
||||
gdb_test "set width 0" ""
|
||||
|
||||
if { ![set_lang_c] } {
|
||||
gdb_suppress_tests;
|
||||
} else {
|
||||
if { $hp_aCC_compiler } {
|
||||
# Do not set language explicitly to 'C'. This will cause aCC
|
||||
# tests to fail because promotion rules are different. Just let
|
||||
# the language be set to the default.
|
||||
|
||||
if { ![runto_main] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
gdb_test "set overload-resolution 0" ".*"
|
||||
} else {
|
||||
if { ![set_lang_c] } {
|
||||
gdb_suppress_tests;
|
||||
} else {
|
||||
if { ![runto_main] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gdb_test "next" ".*"
|
||||
|
@ -93,6 +93,7 @@ proc progvar_simple_while_test {} {
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "set args 5" "" "set args in progvar_simple_while_test"
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
@ -110,6 +111,7 @@ proc progvar_complex_if_while_test {} {
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "set args 4" "" "set args in progvar_complex_if_while_test"
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
@ -125,6 +127,7 @@ proc if_while_breakpoint_command_test {} {
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "set args 5" "" "set args in if_while_breakpoint_command_test"
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
@ -155,6 +158,7 @@ proc infrun_breakpoint_command_test {} {
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "set args 6" "" "set args in progvar_simple_while_test"
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
@ -177,8 +181,14 @@ proc infrun_breakpoint_command_test {} {
|
||||
}
|
||||
gdb_test "step\nstep\nstep\nstep\nbt\nend" "" \
|
||||
"commands in infrun_breakpoint_command_test #2"
|
||||
|
||||
gdb_test "continue" "Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*
|
||||
|
||||
if { [istarget "hppa*-hp-hpux*"] } {
|
||||
gdb_test "continue" \
|
||||
"Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*" \
|
||||
"contiune in infrun_breakpoint_command_test"
|
||||
} else {
|
||||
gdb_test "continue" \
|
||||
"Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*
|
||||
\[0-9\]*\[ \]*if \\(value > 1\\) \{.*
|
||||
\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*
|
||||
factorial \\(value=4\\) at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*
|
||||
@ -190,7 +200,9 @@ factorial \\(value=3\\) at .*
|
||||
#2 \[0-9a-fx\]* in factorial \\(value=5\\).*
|
||||
#3 \[0-9a-fx\]* in factorial \\(value=6\\).*
|
||||
#4 \[0-9a-fx\]* in main \\(.*\\).*" \
|
||||
"continue in infrun_breakpoint_command_test";
|
||||
"continue in infrun_breakpoint_command_test";
|
||||
}
|
||||
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
@ -200,6 +212,7 @@ proc breakpoint_command_test {} {
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "set args 6" "" "set args in breakpoint_command_test"
|
||||
if { ![runto factorial] } then { gdb_suppress_tests; }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
@ -207,7 +220,7 @@ proc breakpoint_command_test {} {
|
||||
delete_breakpoints
|
||||
gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #2"
|
||||
gdb_test "commands\nprintf \"Now the value is %d\\n\", value\nend" \
|
||||
"Type commands.*\nEnd with.*" "commands in breakpoint_command_test"
|
||||
"End with.*" "commands in breakpoint_command_test"
|
||||
gdb_test "continue" "Breakpoint \[0-9\]*, factorial.*Now the value is 5" \
|
||||
"continue in breakpoint_command_test"
|
||||
gdb_test "print value" " = 5" "print value in breakpoint_command_test"
|
||||
@ -236,7 +249,84 @@ proc user_defined_command_test {} {
|
||||
gdb_test "show user mycommand" "while.*set.*if.*p/x.*else.*p/x.*end.*" "display user command in user_defined_command_test"
|
||||
}
|
||||
|
||||
proc watchpoint_command_test {} {
|
||||
global noargs
|
||||
global gdb_prompt
|
||||
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping watchpoint_command_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "set args 6" "" "set args in watchpoint_command_test"
|
||||
if { ![runto factorial] } then { return }
|
||||
delete_breakpoints
|
||||
|
||||
# Verify that we can create a watchpoint, and give it a commands
|
||||
# list that continues the inferior. We set the watchpoint on a
|
||||
# local variable, too, so that it self-deletes when the watched
|
||||
# data goes out of scope.
|
||||
#
|
||||
# What should happen is: Each time the watchpoint triggers, it
|
||||
# continues the inferior. Eventually, the watchpoint will self-
|
||||
# delete, when the watched variable is out of scope. But by that
|
||||
# time, the inferior should have exited. GDB shouldn't crash or
|
||||
# anything untoward as a result of this.
|
||||
#
|
||||
set wp_id -1
|
||||
|
||||
send_gdb "watch local_var\n"
|
||||
gdb_expect {
|
||||
-re ".*\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" {
|
||||
set wp_id $expect_out(1,string)
|
||||
pass "watch local_var"
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "watch local_var"}
|
||||
timeout {fail "(timeout) watch local_var"}
|
||||
}
|
||||
|
||||
if {$wp_id == -1} {return}
|
||||
|
||||
send_gdb "commands $wp_id\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for when breakpoint $wp_id is hit, one per line.*>"\
|
||||
{pass "begin commands on watch"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "begin commands on watch"}
|
||||
timeout {fail "(timeout) begin commands on watch"}
|
||||
}
|
||||
send_gdb "print value\n"
|
||||
gdb_expect {
|
||||
-re ">"\
|
||||
{pass "add print command to watch"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "add print command to watch"}
|
||||
timeout {fail "(timeout) add print command to watch"}
|
||||
}
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ">"\
|
||||
{pass "add continue command to watch"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "add continue command to watch"}
|
||||
timeout {fail "(timeout) add continue command to watch"}
|
||||
}
|
||||
send_gdb "end\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "begin commands on watch"}
|
||||
timeout {fail "(timeout) begin commands on watch"}
|
||||
}
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:57.*"\
|
||||
{pass "continue with watch"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue with watch"}
|
||||
timeout {fail "(timeout) continue with watch"}
|
||||
}
|
||||
}
|
||||
|
||||
proc test_command_prompt_position {} {
|
||||
global gdb_prompt
|
||||
@ -295,6 +385,7 @@ if_while_breakpoint_command_test
|
||||
infrun_breakpoint_command_test
|
||||
breakpoint_command_test
|
||||
user_defined_command_test
|
||||
watchpoint_command_test
|
||||
test_command_prompt_position
|
||||
|
||||
|
||||
|
@ -52,9 +52,10 @@ if $tracelevel then {
|
||||
}
|
||||
|
||||
|
||||
#skip all these tests for now (FIXME)
|
||||
|
||||
continue
|
||||
if { ![istarget "hppa*-hp-hpux*"] } {
|
||||
#skip all these tests for now (FIXME)
|
||||
continue
|
||||
}
|
||||
|
||||
global usestubs
|
||||
|
||||
@ -71,6 +72,10 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
@ -81,7 +86,7 @@ if ![runto_main] then {
|
||||
}
|
||||
|
||||
set oldtimeout1 $timeout
|
||||
set timeout [expr $timeout + 500]
|
||||
set timeout 30
|
||||
|
||||
|
||||
send_gdb "hfgfh\t"
|
||||
@ -162,31 +167,33 @@ sleep 1
|
||||
gdb_expect {
|
||||
-re "^p\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "The history is empty\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p'"}
|
||||
timeout {fail "(timeout) complete 'p'"}
|
||||
timeout {fail "(timeout) complete 'p' 2"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p'" }
|
||||
timeout { fail "(timeout) complete 'p'" }
|
||||
timeout { fail "(timeout) complete 'p' 1" }
|
||||
}
|
||||
|
||||
send_gdb "p \t"
|
||||
sleep 1
|
||||
sleep 3
|
||||
gdb_expect {
|
||||
-re "^p \\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "The history is empty\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p '"}
|
||||
timeout {fail "(timeout) complete 'p '"}
|
||||
timeout {fail "(timeout) complete 'p ' 1"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p '" }
|
||||
timeout { fail "(timeout) complete 'p '" }
|
||||
timeout { fail "(timeout) complete 'p ' 2" }
|
||||
}
|
||||
|
||||
|
||||
@ -283,7 +290,7 @@ gdb_expect {
|
||||
-re "^info $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\ninfo address.*info watchpoints.*\r\n\r\nType \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
-re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*info address.*info watchpoints.*\r\n\r\nType \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'info'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info'"}
|
||||
timeout {fail "(timeout) complete 'info'"}
|
||||
@ -299,7 +306,7 @@ gdb_expect {
|
||||
-re "^info \\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\ninfo address.*Type \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
-re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*info address.*Type \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'info '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info '"}
|
||||
timeout {fail "(timeout) complete 'info '"}
|
||||
@ -313,7 +320,7 @@ gdb_expect {
|
||||
send_gdb "info \t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info \0x7$"\
|
||||
-re "^info \\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "address.*types.*$gdb_prompt info $"\
|
||||
@ -368,26 +375,46 @@ gdb_expect {
|
||||
|
||||
send_gdb "p 'a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p 'a\\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "a64l.*atol.*$gdb_prompt p .a$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Invalid character constant\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'p \'a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p \'a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p \'a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
gdb_expect {
|
||||
-re "^p 'a\\\x07$" {
|
||||
send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "a64l.*atol.*$gdb_prompt p .a$" {
|
||||
send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Invalid character constant\\..*$gdb_prompt $" {
|
||||
pass "complete (2) 'p \'a'"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
}
|
||||
-re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
|
||||
send_gdb "n"
|
||||
gdb_expect {
|
||||
-re "\\(gdb\\) p 'a$" {
|
||||
send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Invalid character constant\\..*$gdb_prompt $" {
|
||||
pass "complete (2) 'p \'a'"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "complete (2) 'p \'a'"
|
||||
}
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "p b-a\t"
|
||||
@ -408,57 +435,79 @@ gdb_expect {
|
||||
|
||||
send_gdb "p b-a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p b-a\\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "a64l.*atol.*$gdb_prompt p b-a$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'p b-a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
gdb_expect {
|
||||
-re "^p b-a\\\x07$" {
|
||||
send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "a64l.*atol.*$gdb_prompt p b-a$" {
|
||||
send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $" {
|
||||
pass "complete (2) 'p b-a'"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
}
|
||||
}
|
||||
-re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
|
||||
send_gdb "n"
|
||||
gdb_expect {
|
||||
-re "\\(gdb\\) p b-a$" {
|
||||
send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $" {
|
||||
pass "complete (2) 'p b-a'"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "complete (2) 'p b-a'"
|
||||
}
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
}
|
||||
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
}
|
||||
|
||||
send_gdb "p b-\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p b-\\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "There are $decimal possibilities\\. Do you really\r\nwish to see them all. \\(y or n\\)$"\
|
||||
{ send_gdb "n"
|
||||
gdb_expect {
|
||||
-re "\\(gdb\\) p b-$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'p b-'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-'" }
|
||||
}
|
||||
-re "^p b-\\\x07$" {
|
||||
send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
|
||||
send_gdb "n"
|
||||
gdb_expect {
|
||||
-re "\\(gdb\\) p b-$" {
|
||||
send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $" {
|
||||
pass "complete (2) 'p b-'"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "complete (2) 'p b-'"
|
||||
}
|
||||
timeout { fail "(timeout) complete (2) 'p b-'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-'" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-'" }
|
||||
}
|
||||
|
||||
send_gdb "file ${objdir}/Make\t"
|
||||
sleep 1
|
||||
@ -487,7 +536,7 @@ gdb_expect {
|
||||
send_gdb "file ${srcdir}/gdb.base/a1\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^file ${srcdir}/gdb.base/.*'a1.*-selftest\\.exp' $"\
|
||||
-re "^file ${srcdir}/gdb.base/.*'a1.*-self\\.exp' $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"
|
||||
@ -513,13 +562,14 @@ send_gdb "info func mark\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info func mark.*er$"\
|
||||
{ send_gdb "\t\t"
|
||||
{
|
||||
send_gdb "\t\t"
|
||||
sleep 3
|
||||
gdb_expect {
|
||||
-re "marker1 marker2 marker3 marker4.*$gdb_prompt info func marker$"\
|
||||
-re "marker1.*$gdb_prompt info func marker$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\);\r\n$gdb_prompt $"\
|
||||
-re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(.*\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long\\);\r\n$gdb_prompt $"\
|
||||
{ pass "complete 'info func mar'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
|
||||
timeout {fail "(timeout) complete 'info func mar'"}
|
||||
@ -540,6 +590,8 @@ gdb_expect {
|
||||
-re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Requires an argument.*parent.*child.*ask.*$gdb_prompt $"\
|
||||
{ pass "complete 'set follow-fork-mode'"}
|
||||
-re "Ambiguous item \"\"\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'set follow-fork-mode'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'"}
|
||||
|
@ -29,6 +29,7 @@ char *arg;
|
||||
|
||||
#else /* ! vxworks */
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
#endif /* ! vxworks */
|
||||
|
||||
/*
|
||||
@ -38,20 +39,34 @@ char *arg;
|
||||
* of gcc have or have had problems with this).
|
||||
*/
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int marker1 (void) { return (0); }
|
||||
int marker2 (int a) { return (1); }
|
||||
void marker3 (char *a, char *b) {}
|
||||
void marker4 (long d) {}
|
||||
#else
|
||||
int marker1 () { return (0); }
|
||||
int marker2 (a) int a; { return (1); }
|
||||
void marker3 (a, b) char *a, *b; {}
|
||||
void marker4 (d) long d; {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This simple classical example of recursion is useful for
|
||||
* testing stack backtraces and such.
|
||||
*/
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int factorial(int);
|
||||
|
||||
int
|
||||
main (int argc, char **argv, char **envp)
|
||||
#else
|
||||
int
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char *argv[], **envp;
|
||||
#endif
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
@ -70,8 +85,12 @@ char *argv[], **envp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int factorial (int value)
|
||||
#else
|
||||
int factorial (value)
|
||||
int value;
|
||||
#endif
|
||||
{
|
||||
if (value > 1) {
|
||||
value *= factorial (value - 1);
|
||||
|
@ -43,6 +43,10 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
@ -74,8 +78,8 @@ gdb_test "delete 2" \
|
||||
#
|
||||
# test conditional break at line number
|
||||
#
|
||||
gdb_test "break 64 if 1==1" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 64\\." \
|
||||
gdb_test "break 79 if 1==1" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 79\\." \
|
||||
"break line if condition"
|
||||
|
||||
gdb_test "delete 3" \
|
||||
@ -92,8 +96,8 @@ gdb_test "break marker1 if (1==1)" \
|
||||
#
|
||||
# test conditional break at line number
|
||||
#
|
||||
gdb_test "break 64 if (1==1)" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 64\\." \
|
||||
gdb_test "break 79 if (1==1)" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 79\\." \
|
||||
"break line if (condition)"
|
||||
|
||||
gdb_test "break marker2 if (a==43)" \
|
||||
@ -104,15 +108,23 @@ gdb_test "break marker2 if (a==43)" \
|
||||
# check to see what breakpoints are set
|
||||
#
|
||||
|
||||
set main_line 60
|
||||
if {$hp_aCC_compiler} {
|
||||
set marker1_proto "\\(void\\)"
|
||||
set marker2_proto "\\(int\\)"
|
||||
} else {
|
||||
set marker1_proto ""
|
||||
set marker2_proto ""
|
||||
}
|
||||
|
||||
set main_line 75
|
||||
gdb_test "info break" \
|
||||
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in marker1 at .*$srcfile:41.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile:4\[38\].*
|
||||
\[\t \]+stop only if 1 == 1.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:64.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
|
||||
\[\t \]+stop only if 1 == 1.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile:42.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile:4\[49\].*
|
||||
\[\t \]+stop only if a == 43.*" \
|
||||
"breakpoint info"
|
||||
|
||||
@ -127,19 +139,21 @@ rerun_to_main
|
||||
#
|
||||
# run until the breakpoint at a line number
|
||||
#
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:64.*64\[\t \]+printf.*factorial.*" \
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
|
||||
"run until breakpoint set at a line number"
|
||||
|
||||
#
|
||||
# run until the breakpoint at marker1
|
||||
#
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:41.*41\[\t \]+.*" \
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*" \
|
||||
"run until breakpoint at marker1"
|
||||
|
||||
#
|
||||
# run until the breakpoint at marker2
|
||||
#
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:42.*42\[\t \]+.*" \
|
||||
#See 11512CLLbs
|
||||
setup_xfail hppa2.0w-*-*
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" \
|
||||
"run until breakpoint at marker2"
|
||||
|
||||
|
||||
|
@ -41,8 +41,14 @@ set testfile "constvars"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
if [istarget "hppa*-*-*"] {
|
||||
set lang "c++"
|
||||
} else {
|
||||
set lang ""
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug $lang]] != "" } {
|
||||
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
|
||||
@ -94,7 +100,7 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
send_gdb "ptype qux1\n"
|
||||
gdb_expect {
|
||||
-re "type = int \\(const char, const char &, const char *, char * const\\).*$gdb_prompt $" {
|
||||
-re "type = int \\(const char, const char, const char \\*, char \\* const\\).*$gdb_prompt $" {
|
||||
pass "ptype qux1"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "ptype qux1" }
|
||||
@ -150,102 +156,100 @@ proc do_constvar_tests {} {
|
||||
gdb_test "ptype languid" "type = const double"
|
||||
gdb_test "print *legend" " = 66 'B'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype legend" "type = const char *"
|
||||
gdb_test "ptype legend" "type = const char \\*"
|
||||
gdb_test "print *legerdemain" " = 10 '\\\\n'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype legerdemain" "type = const unsigned char *"
|
||||
gdb_test "ptype legerdemain" "type = const unsigned char \\*"
|
||||
gdb_test "print *leniency" " = 20"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype leniency" "type = const short *"
|
||||
gdb_test "ptype leniency" "type = const short \\*"
|
||||
gdb_test "print *leonine" " = 30"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype leonine" "type = const unsigned short *"
|
||||
gdb_test "ptype leonine" "type = const unsigned short \\*"
|
||||
gdb_test "print *lesion" " = 40"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lesion" "type = const long *"
|
||||
gdb_test "ptype lesion" "type = const long \\*"
|
||||
gdb_test "print *lethal" " = 50"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lethal" "type = const unsigned long *"
|
||||
gdb_test "ptype lethal" "type = const unsigned long \\*"
|
||||
gdb_test "print *lethargic" " = 60"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lethargic" "type = const float *"
|
||||
gdb_test "ptype lethargic" "type = const float \\*"
|
||||
gdb_test "print *levity" " = 70"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype levity" "type = const double *"
|
||||
gdb_test "ptype levity" "type = const double \\*"
|
||||
gdb_test "print *lewd" " = 65 'A'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lewd" "type = const char * const"
|
||||
gdb_test "ptype lewd" "type = const char \\* const"
|
||||
gdb_test "print *lexicographer" " = 1 '.001'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lexicographer" "type = const unsigned char * const"
|
||||
gdb_test "ptype lexicographer" "type = const unsigned char \\* const"
|
||||
gdb_test "print *lexicon" " = 2"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lexicon" "type = const short * const"
|
||||
gdb_test "ptype lexicon" "type = const short \\* const"
|
||||
gdb_test "print *liaison" " = 3"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype liaison" "type = const unsigned short * const"
|
||||
gdb_test "ptype liaison" "type = const unsigned short \\* const"
|
||||
gdb_test "print *libation" " = 4"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libation" "type = const long * const"
|
||||
gdb_test "ptype libation" "type = const long \\* const"
|
||||
gdb_test "print *libelous" " = 5"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libelous" "type = const unsigned long * const"
|
||||
gdb_test "ptype libelous" "type = const unsigned long \\* const"
|
||||
gdb_test "print *libertine" " = 6"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libertine" "type = const float * const"
|
||||
gdb_test "ptype libertine" "type = const float \\* const"
|
||||
gdb_test "print *libidinous" " = 7"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libidinous" "type = const double * const"
|
||||
gdb_test "ptype libidinous" "type = const double \\* const"
|
||||
gdb_test "print *languish" " = 65 'A'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype languish" "type = const char *"
|
||||
gdb_test "ptype languish" "type = const char \\*"
|
||||
gdb_test "print *languor" " = 1 '.001'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype languor" "type = const unsigned char *"
|
||||
gdb_test "ptype languor" "type = const unsigned char \\*"
|
||||
gdb_test "print *lank" " = 2"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lank" "type = const short *"
|
||||
gdb_test "ptype lank" "type = const short \\*"
|
||||
gdb_test "print *lapidary" " = 3"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lapidary" "type = const unsigned short *"
|
||||
gdb_test "ptype lapidary" "type = const unsigned short \\*"
|
||||
gdb_test "print *larceny" " = 4"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype larceny" "type = const long *"
|
||||
gdb_test "ptype larceny" "type = const long \\*"
|
||||
gdb_test "print *largess" " = 5"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype largess" "type = const unsigned long *"
|
||||
gdb_test "ptype largess" "type = const unsigned long \\*"
|
||||
gdb_test "print *lascivious" " = 6"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lascivious" "type = const float *"
|
||||
gdb_test "ptype lascivious" "type = const float \\*"
|
||||
gdb_test "print *lassitude" " = 7"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lassitude" "type = const double *"
|
||||
gdb_test "ptype lassitude" "type = const double \\*"
|
||||
gdb_test "print *lamprey" " = 66 'B'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lamprey" "type = char * const"
|
||||
gdb_test "ptype lamprey" "type = char \\* const"
|
||||
gdb_test "print *lariat" " = 10 '\\\\n'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lariat" "type = unsigned char * const"
|
||||
gdb_test "ptype lariat" "type = unsigned char \\* const"
|
||||
gdb_test "print *laudanum" " = 20"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype laudanum" "type = short * const"
|
||||
gdb_test "ptype laudanum" "type = short \\* const"
|
||||
gdb_test "print *lecithin" " = 30"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lecithin" "type = unsigned short * const"
|
||||
gdb_test "ptype lecithin" "type = unsigned short \\* const"
|
||||
gdb_test "print *leviathan" " = 40"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype leviathan" "type = long * const"
|
||||
gdb_test "ptype leviathan" "type = long \\* const"
|
||||
gdb_test "print *libretto" " = 50"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libretto" "type = unsigned long * const"
|
||||
gdb_test "ptype libretto" "type = unsigned long \\* const"
|
||||
gdb_test "print *lissome" " = 60"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lissome" "type = float * const"
|
||||
gdb_test "ptype lissome" "type = float \\* const"
|
||||
gdb_test "print *locust" " = 70"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype locust" "type = double * const"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype radiation" "type = const char &"
|
||||
gdb_test "ptype locust" "type = double \\* const"
|
||||
}
|
||||
|
||||
do_constvar_tests
|
||||
|
@ -183,13 +183,13 @@ gdb_test "print coremaker_data" "\\\$$decimal = 202"
|
||||
gdb_test "print coremaker_bss" "\\\$$decimal = 10"
|
||||
gdb_test "print coremaker_ro" "\\\$$decimal = 201"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
gdb_test "print func2::coremaker_local" "\\\$$decimal = {0, 1, 2, 3, 4}"
|
||||
|
||||
# Somehow we better test the ability to read the registers out of the core
|
||||
# file correctly. I don't think the other tests do this.
|
||||
|
||||
gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
|
||||
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp"
|
||||
|
||||
# Test ability to read mmap'd data
|
||||
|
||||
@ -217,7 +217,8 @@ gdb_expect {
|
||||
# test reinit_frame_cache
|
||||
|
||||
gdb_load ${binfile}
|
||||
# HP defect CLLbs17002
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp"
|
||||
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp (reinit)"
|
||||
|
||||
gdb_test "core" "No core file now."
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef __STDC__
|
||||
#define const /**/
|
||||
@ -33,7 +35,6 @@ void
|
||||
mmapdata ()
|
||||
{
|
||||
int j, fd;
|
||||
extern void *malloc ();
|
||||
|
||||
/* Allocate and initialize a buffer that will be used to write
|
||||
the file that is later mapped in. */
|
||||
@ -112,9 +113,10 @@ func1 ()
|
||||
func2 ();
|
||||
}
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
mmapdata ();
|
||||
func1 ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,11 @@ if ![target_info exists use_gdb_stub] {
|
||||
|
||||
setup_xfail "mips-idt-*" "a29k-*-udi"
|
||||
gdb_test "backtrace" "No stack."
|
||||
|
||||
# ba and bac are no longer unique command prefixes. So these tests
|
||||
# elict an error from GDB.
|
||||
# GDB needs to be fixed to map unique alias here for ba bac.
|
||||
#
|
||||
foreach i "bt ba bac" {
|
||||
setup_xfail "mips-idt-*" "a29k-*-udi"
|
||||
gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
|
||||
@ -335,6 +340,7 @@ gdb_test "info types" "All defined types:" "info types"
|
||||
#test info variables
|
||||
gdb_test "info variables" "All defined variables:" "info variables"
|
||||
#test info warranty
|
||||
setup_xfail "hppa*-hp-hpux*"
|
||||
gdb_test "info warranty" "NO WARRANTY.*\[\r\n\]+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*\[\r\n\]+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN.*\[\r\n\]+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*\[\r\n\]+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*\[\r\n\]+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*\[\r\n\]+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS.*\[\r\n\]+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE.*\[\r\n\]+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*\[\r\n\]+REPAIR OR CORRECTION..*\[\r\n\]+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*\[\r\n\]+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*\[\r\n\]+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*\[\r\n\]+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*\[\r\n\]+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED.*\[\r\n\]+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*\[\r\n\]+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*\[\r\n\]+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*\[\r\n\]+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
|
||||
#test info watchpoints
|
||||
gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
|
||||
@ -646,7 +652,7 @@ gdb_test "show values" "" "show values"
|
||||
#test show verbose
|
||||
gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
|
||||
#test show version
|
||||
|
||||
setup_xfail "hppa*-hp-hpux*"
|
||||
gdb_test "show version" "GNU gdb \[0-9\.\]*.*\[\r\n\]+Copyright \[0-9\]* Free Software Foundation, Inc.*\[\r\n\]+GDB is free software, covered by the GNU General Public License, and you are.*\[\r\n\]+welcome to change it and/or distribute copies of it under certain conditions.*\[\r\n\]+Type \"show copying\" to see the conditions.*\[\r\n\]+There is absolutely no warranty for GDB. Type \"show warranty\" for details.*\[\r\n\]+This GDB was configured as .*|GDB is free software and you are welcome to distribute copies of it.*\[\r\n\]+ under certain conditions; type \"show copying\" to see the conditions..*\[\r\n\]+There is absolutely no warranty for GDB; type \"show warranty\" for details..*\[\r\n\]+GDB.*Copyright \[0-9\]* Free Software Foundation, Inc.*" "show version"
|
||||
#test show width
|
||||
gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
|
||||
@ -719,8 +725,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. /dev/ttya.*$gdb_prompt $"\
|
||||
-re "To open a remote debug connection, you need to specify what.*serial.*device is attached to the remote system .e.g. /dev/ttya.*$gdb_prompt $"\
|
||||
{ pass "target remote" }
|
||||
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
|
||||
send_gdb "n\n"
|
||||
@ -792,6 +797,16 @@ setup_xfail "a29k-*-udi"
|
||||
gdb_test "where" "No stack." "where"
|
||||
#test x
|
||||
#The case in which it prints a number is for vxgdb.
|
||||
gdb_test "x" "0x0:.*0x\[0-9\]*|0x0:.*Cannot access memory at address 0x0." "x"
|
||||
send_gdb "x\n"
|
||||
gdb_expect {
|
||||
-re "0x0:.*Cannot access memory at address 0x0..*$gdb_prompt $" {
|
||||
pass "x"
|
||||
}
|
||||
-re "0x0:.*Error accessing memory address 0x0:.*$gdb_prompt $" {
|
||||
pass "x"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "x" }
|
||||
timeout { fail "(timeout) x" }
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
|
@ -68,7 +68,7 @@ gdb_expect {
|
||||
#
|
||||
send_gdb "nextwhere\n"
|
||||
gdb_expect {
|
||||
-re ".*64\[ \t\]*printf.*#0\[ \t\]*main.*:64.*$gdb_prompt $"\
|
||||
-re ".*79\[ \t\]*printf.*#0\[ \t\]*main.*:79.*$gdb_prompt $"\
|
||||
{pass "use user command: nextwhere"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "use user command: nextwhere"}
|
||||
@ -224,7 +224,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "#0\[ \t\]*main.*:66.*$gdb_prompt $"\
|
||||
-re "#0\[ \t\]*main.*:81.*$gdb_prompt $"\
|
||||
{pass "use hook-stop command"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "use hook-stop command"}
|
||||
|
@ -46,6 +46,15 @@ gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
# Some coverage stuff
|
||||
#
|
||||
gdb_test "kill" ".*The program is not being run.*" ""
|
||||
gdb_test "detach" ".*" ""
|
||||
gdb_test "run" ".*" ""
|
||||
|
||||
gdb_load ${binfile}
|
||||
gdb_test "kill" ".*" ""
|
||||
gdb_test "detach" ".*" ""
|
||||
|
||||
# Ok, on to real life
|
||||
#
|
||||
@ -132,8 +141,14 @@ gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*" ""
|
||||
# play with "p", too
|
||||
#
|
||||
gdb_test "p/r j" ".*Undefined output format.*" ""
|
||||
gdb_test "p j" ".*" "debug test output"
|
||||
#gdb_test "x/rx j" ".*Cannot access memory.*" "no error!"
|
||||
gdb_test "x/0 j" ".*" "x/0 j"
|
||||
# x/0 j doesn't produce any output and terminates PA64 process when testing
|
||||
if [istarget "hppa*-hp-hpux11*"] {
|
||||
xfail "'x/0 j' terminate PA64 process - skipped test point"
|
||||
} else {
|
||||
gdb_test "x/0 j" ".*" "x/0 j"
|
||||
}
|
||||
gdb_test "p/0 j" ".*Item count other than 1 is meaningless.*" "p/0 j"
|
||||
gdb_test "p/s sum" ".*Format letter.*is meaningless.*" " no s"
|
||||
gdb_test "p/i sum" ".*Format letter.*is meaningless.*.*" "no i"
|
||||
|
@ -74,7 +74,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
#
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
@ -118,7 +118,7 @@ gdb_expect {
|
||||
#
|
||||
send_gdb "break marker2\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 42.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
|
||||
{pass "break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker2"}
|
||||
@ -172,7 +172,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker3\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 43.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line (45|50).*$gdb_prompt $"\
|
||||
{pass "break marker3"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker3"}
|
||||
@ -197,7 +197,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*marker3 .*:43.*$gdb_prompt $"\
|
||||
-re ".*marker3 .*:(45|50).*$gdb_prompt $"\
|
||||
{pass "continue to auto-deleted break marker3"}
|
||||
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
|
||||
{fail "continue to auto-deleted break marker3"}
|
||||
@ -222,7 +222,7 @@ gdb_expect {
|
||||
#
|
||||
send_gdb "break marker4\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 44.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line (46|51).*$gdb_prompt $"\
|
||||
{pass "break marker4"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker4"}
|
||||
@ -253,7 +253,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
@ -340,7 +340,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
@ -377,7 +377,7 @@ rerun_to_main
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*marker1 .*:41.*$gdb_prompt $"\
|
||||
-re ".*marker1 .*:4\[38\].*$gdb_prompt $"\
|
||||
{pass "continue to ignored & auto-deleted break marker1"}
|
||||
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
|
||||
{fail "continue to ignored & auto-deleted break marker1"}
|
||||
@ -393,7 +393,7 @@ if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
@ -435,9 +435,9 @@ gdb_expect {
|
||||
#
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break 64\n"
|
||||
send_gdb "break 79\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*.*, line 64.*$gdb_prompt $"\
|
||||
-re "Breakpoint \[0-9\]*.*, line 79.*$gdb_prompt $"\
|
||||
{pass "prepare to continue with ignore count"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "prepare to continue with ignore count"}
|
||||
@ -454,7 +454,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re ".*66\[ \t\]*marker1.*$gdb_prompt $"\
|
||||
-re ".*81\[ \t\]*marker1.*$gdb_prompt $"\
|
||||
{pass "step after continue with ignore count"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "step after continue with ignore count"}
|
||||
|
@ -2,15 +2,20 @@
|
||||
* <leaves-core-file-on-quit> bugs.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int callee (int x)
|
||||
#else
|
||||
int callee( x )
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
int y = x * x;
|
||||
return (y - 2);
|
||||
}
|
||||
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
|
||||
int *p;
|
||||
@ -24,4 +29,5 @@ main()
|
||||
|
||||
}
|
||||
printf( " Goodbye!\n" );
|
||||
return 0;
|
||||
}
|
||||
|
@ -52,39 +52,39 @@ gdb_load ${binfile}
|
||||
# to the prolog--that's another bug...)
|
||||
#
|
||||
gdb_test "b 1" ".*Breakpoint.*line 1.*" "bpt at line before routine"
|
||||
gdb_test "b 8" ".*Note.*also.*Breakpoint.*2.*" ""
|
||||
gdb_test "b 13" ".*Note.*also.*Breakpoint.*2.*" ""
|
||||
|
||||
# Set up to go to the next-to-last line of the program
|
||||
#
|
||||
gdb_test "b 26" ".*Breakpoint.*3.*" ""
|
||||
gdb_test "b 31" ".*Breakpoint.*3.*" ""
|
||||
|
||||
# Expect to hit the bp at line "1", but symbolize this
|
||||
# as line "8". Then try to clear it--this should work.
|
||||
# as line "13". Then try to clear it--this should work.
|
||||
#
|
||||
if [target_info exists use_gdb_stub] {
|
||||
gdb_test "continue" ".*Breakpoint.*1.*callee.*8.*" ""
|
||||
gdb_test "continue" ".*Breakpoint.*1.*callee.*13.*" ""
|
||||
} else {
|
||||
gdb_test "r" ".*Breakpoint.*1.*callee.*8.*" ""
|
||||
gdb_test "r" ".*Breakpoint.*1.*callee.*13.*" ""
|
||||
}
|
||||
gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
|
||||
send_gdb "i b\n"
|
||||
gdb_expect {
|
||||
-re ".*breakpoint.*breakpoint.*$gdb_prompt $" { fail "clear bp" }
|
||||
-re ".*3.*main.*26.*$gdb_prompt $" { pass "cleared bp at line before routine" }
|
||||
-re ".*3.*main.*31.*$gdb_prompt $" { pass "cleared bp at line before routine" }
|
||||
-re ".*$gdb_prompt $" { fail "info b" }
|
||||
}
|
||||
|
||||
# Test some other "clear" combinations
|
||||
#
|
||||
gdb_test "b 1" ".*Breakpoint.*4.*" ""
|
||||
gdb_test "b 8" ".*Note.*also.*Breakpoint.*5.*" ""
|
||||
gdb_test "cle 8" ".*Deleted breakpoint 5.*" "Only cleared 1 by line"
|
||||
gdb_test "b 13" ".*Note.*also.*Breakpoint.*5.*" ""
|
||||
gdb_test "cle 13" ".*Deleted breakpoint 5.*" "Only cleared 1 by line"
|
||||
|
||||
send_gdb "inf line 8\n"
|
||||
send_gdb "inf line 13\n"
|
||||
gdb_expect {
|
||||
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
|
||||
set line_eight $expect_out(1,string)
|
||||
gdb_test "b 8" ".*Breakpoint.*6.*" ""
|
||||
gdb_test "b 13" ".*Breakpoint.*6.*" ""
|
||||
gdb_test "cle *$line_eight" ".*Deleted breakpoints 6 4.*" "Clear 2 by address"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
@ -92,13 +92,13 @@ gdb_expect {
|
||||
}
|
||||
}
|
||||
|
||||
send_gdb "inf line 9\n"
|
||||
send_gdb "inf line 14\n"
|
||||
gdb_expect {
|
||||
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
|
||||
set line_nine $expect_out(1,string)
|
||||
gdb_test "b 9" ".*Breakpoint.*7.*" ""
|
||||
gdb_test "b 14" ".*Breakpoint.*7.*" ""
|
||||
gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint.*8.*" ""
|
||||
gdb_test "c" ".*Breakpoint.*7.*callee.*9.*" ""
|
||||
gdb_test "c" ".*Breakpoint.*7.*callee.*14.*" ""
|
||||
gdb_test "cle" ".*Deleted breakpoints 8 7.*" "Clear 2 by default"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
@ -111,7 +111,7 @@ gdb_expect {
|
||||
-re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
|
||||
fail "didn't clear bps"
|
||||
}
|
||||
-re ".*3.*main.*26.*$gdb_prompt $" {
|
||||
-re ".*3.*main.*31.*$gdb_prompt $" {
|
||||
pass "all set to continue"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
@ -123,14 +123,14 @@ gdb_expect {
|
||||
# See if we can step out with control. The "1 2 3" stuff
|
||||
# is output from the program.
|
||||
#
|
||||
gdb_test "cont" ".*Breakpoint.*26.*" ""
|
||||
gdb_test "next" ".*1 2 7 14 23 34 47 62 79 Goodbye!.*27.*" "Step to return"
|
||||
gdb_test "cont" ".*Breakpoint.*32.*" ""
|
||||
gdb_test "next" ".*1 2 7 14 23 34 47 62 79 Goodbye!.*32.*" "Step to return"
|
||||
|
||||
set old_timeout $timeout
|
||||
set timeout 50
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "27.*$gdb_prompt $" {
|
||||
-re "33.*$gdb_prompt $" {
|
||||
# sometimes we stop at the closing brace, if so, do another next
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
@ -141,6 +141,9 @@ gdb_expect {
|
||||
-re ".*in.*start.*$gdb_prompt $" {
|
||||
pass "step out of main"
|
||||
}
|
||||
-re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
|
||||
pass "step out of main"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "step at end 2" }
|
||||
timeout { fail "hang or timeout on step at end 2" }
|
||||
}
|
||||
@ -152,6 +155,9 @@ gdb_expect {
|
||||
-re ".*in.*start.*$gdb_prompt $" {
|
||||
pass "step out of main"
|
||||
}
|
||||
-re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
|
||||
pass "step out of main 2"
|
||||
}
|
||||
-re ".*in.*currently asm.*$gdb_prompt $" {
|
||||
pass "step out of main into assembler"
|
||||
}
|
||||
@ -163,7 +169,18 @@ gdb_expect {
|
||||
}
|
||||
|
||||
if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
|
||||
gdb_test "n" ".*Single.*Program exited.*" "step to end of run"
|
||||
send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re ".*Single.*Program exited.*$gdb_prompt $" {
|
||||
pass "step to end of run 1"
|
||||
}
|
||||
-re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
|
||||
pass "step to end of run 2"
|
||||
gdb_test "c" ".*" "continue after exit"
|
||||
}
|
||||
timeout { fail "(timeout) step to end of run" }
|
||||
}
|
||||
|
||||
set timeout $old_timeout
|
||||
|
||||
gdb_test "n" ".*The program is not being run.*" "don't step after run"
|
||||
|
@ -48,8 +48,9 @@ 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."
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [get_compiler_info $binfile] {
|
||||
return -1
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
@ -67,10 +68,9 @@ gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable z=2" "" "set variable z=2"
|
||||
gdb_test "set variable w=3" "" "set variable w=3"
|
||||
|
||||
|
||||
send_gdb "print (0 && (x+y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x+y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x+y))" }
|
||||
@ -80,7 +80,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x-y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x-y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x-y))" }
|
||||
@ -90,7 +90,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x*y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x*y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x*y))" }
|
||||
@ -101,7 +101,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x/y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x/y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x/y))" }
|
||||
@ -111,7 +111,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x%y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x%y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x%y))" }
|
||||
@ -121,7 +121,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x&&y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x&&y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x&&y))" }
|
||||
@ -132,7 +132,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x||y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x||y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x||y))" }
|
||||
@ -143,7 +143,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x&y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x&y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x&y))" }
|
||||
@ -153,7 +153,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x|y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x|y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x|y))" }
|
||||
@ -163,7 +163,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x^y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x^y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x^y))" }
|
||||
@ -174,7 +174,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x < y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x < y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x < y))" }
|
||||
@ -184,7 +184,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x <= y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x <= y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x <= y))" }
|
||||
@ -195,7 +195,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x>y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x>y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x>y))" }
|
||||
@ -205,7 +205,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x>=y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x>=y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x>=y))" }
|
||||
@ -216,7 +216,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x==y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x==y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x==y))" }
|
||||
@ -226,7 +226,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x!=y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x!=y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x!=y))" }
|
||||
@ -236,7 +236,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x<<31))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x<<31))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x<<31))" }
|
||||
@ -246,7 +246,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x>>31))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x>>31))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x>>31))" }
|
||||
@ -257,7 +257,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (!x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (!x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (!x))" }
|
||||
@ -267,7 +267,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (~x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (~x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (~x))" }
|
||||
@ -276,7 +276,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (-x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (-x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (-x))" }
|
||||
@ -286,7 +286,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x++))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x++))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x++))" }
|
||||
@ -296,7 +296,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (++x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (++x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (++x))" }
|
||||
@ -306,7 +306,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x--))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x--))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x--))" }
|
||||
@ -316,7 +316,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (--x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (--x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (--x))" }
|
||||
@ -325,7 +325,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x+=7))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x+=7))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x+=7))" }
|
||||
@ -334,7 +334,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print (0 && (x=y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
-re ".$decimal = $false\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x=y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x=y))" }
|
||||
|
@ -1,7 +1,11 @@
|
||||
#ifdef PROTOTYPES
|
||||
int main (int argc, char **argv, char **envp)
|
||||
#else
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **envp;
|
||||
#endif
|
||||
{
|
||||
extern void dummy();
|
||||
#ifdef usestubs
|
||||
@ -9,6 +13,8 @@ main (argc, argv, envp)
|
||||
breakpoint();
|
||||
#endif
|
||||
dummy();
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/* We put main() right up front so its line number doesn't keep changing. */
|
||||
@ -44,7 +50,6 @@ unsigned long v_unsigned_long;
|
||||
|
||||
float v_float;
|
||||
double v_double;
|
||||
|
||||
/*
|
||||
* Now some derived types, which are arrays, functions-returning,
|
||||
* pointers, structures, unions, and enumerations.
|
||||
@ -70,7 +75,6 @@ unsigned long v_unsigned_long_array[2];
|
||||
|
||||
float v_float_array[2];
|
||||
double v_double_array[2];
|
||||
|
||||
/**** pointers *******/
|
||||
|
||||
char *v_char_pointer;
|
||||
@ -203,8 +207,6 @@ void dummy()
|
||||
|
||||
v_float = 100.0;
|
||||
v_double = 200.0;
|
||||
|
||||
|
||||
v_char_array[0] = v_char;
|
||||
v_signed_char_array[0] = v_signed_char;
|
||||
v_unsigned_char_array[0] = v_unsigned_char;
|
||||
@ -223,7 +225,6 @@ void dummy()
|
||||
|
||||
v_float_array[0] = v_float;
|
||||
v_double_array[0] = v_double;
|
||||
|
||||
v_char_pointer = &v_char;
|
||||
v_signed_char_pointer = &v_signed_char;
|
||||
v_unsigned_char_pointer = &v_unsigned_char;
|
||||
|
@ -73,150 +73,145 @@ proc test_expr { args } {
|
||||
#
|
||||
# test expressions with "char" types
|
||||
#
|
||||
test_expr "set variable v_char=127" "print v_char == 0" "\\$\[0-9\]* = 0" "print v_char == 127" "\\$\[0-9\]* = 1" "print char =="
|
||||
test_expr "set variable v_char=127" "print v_char != 0" "\\$\[0-9\]* = 1" "print v_char != 127" "\\$\[0-9\]* = 0" "print char !="
|
||||
test_expr "set variable v_char=127" "print v_char < 0" "\\$\[0-9\]* = 0" "print v_char < 127" "\\$\[0-9\]* = 0" "print char <"
|
||||
test_expr "set variable v_char=127" "print v_char > 0" "\\$\[0-9\]* = 1" "print v_char > 127" "\\$\[0-9\]* = 0" "print char >"
|
||||
test_expr "set variable v_char=127" "print v_char == 0" "\\$\[0-9\]* = $false" "print v_char == 127" "\\$\[0-9\]* = $true" "print char =="
|
||||
test_expr "set variable v_char=127" "print v_char != 0" "\\$\[0-9\]* = $true" "print v_char != 127" "\\$\[0-9\]* = $false" "print char !="
|
||||
test_expr "set variable v_char=127" "print v_char < 0" "\\$\[0-9\]* = $false" "print v_char < 127" "\\$\[0-9\]* = $false" "print char <"
|
||||
test_expr "set variable v_char=127" "print v_char > 0" "\\$\[0-9\]* = $true" "print v_char > 127" "\\$\[0-9\]* = $false" "print char >"
|
||||
#
|
||||
# test expressions with "signed char" types
|
||||
#
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "\\$\[0-9\]* = 0" "print v_signed_char == 127" "\\$\[0-9\]* = 1" "print signed char =="
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "\\$\[0-9\]* = 1" "print v_signed_char != 127" "\\$\[0-9\]* = 0" "print signed char !="
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "\\$\[0-9\]* = 0" "print v_signed_char < 127" "\\$\[0-9\]* = 0" "print signed char <"
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "\\$\[0-9\]* = 1" "print v_signed_char > 127" "\\$\[0-9\]* = 0" "print signed char >"
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == 127" "\\$\[0-9\]* = $true" "print signed char =="
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != 127" "\\$\[0-9\]* = $false" "print signed char !="
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "\\$\[0-9\]* = $false" "print v_signed_char < 127" "\\$\[0-9\]* = $false" "print signed char <"
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "\\$\[0-9\]* = $true" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char >"
|
||||
# make char a minus
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "\\$\[0-9\]* = 0" "print v_signed_char == -1" "\\$\[0-9\]* = 1" "print signed char == (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "\\$\[0-9\]* = 1" "print v_signed_char != -1" "\\$\[0-9\]* = 0" "print signed char != (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "\\$\[0-9\]* = 1" "print v_signed_char < 127" "\\$\[0-9\]* = 1" "print signed char < (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "\\$\[0-9\]* = 0" "print v_signed_char > 127" "\\$\[0-9\]* = 0" "print signed char > (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == -1" "\\$\[0-9\]* = $true" "print signed char == (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != -1" "\\$\[0-9\]* = $false" "print signed char != (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "\\$\[0-9\]* = $true" "print v_signed_char < 127" "\\$\[0-9\]* = $true" "print signed char < (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "\\$\[0-9\]* = $false" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned char" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "\\$\[0-9\]* = 0" "print v_unsigned_char == 127" "\\$\[0-9\]* = 1" "print unsigned char =="
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[0-9\]* = 1" "print v_unsigned_char != 127" "\\$\[0-9\]* = 0" "print unsigned char !="
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = 0" "print v_unsigned_char < 127" "\\$\[0-9\]* = 0" "print unsigned char <"
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = 1" "print v_unsigned_char > 127" "\\$\[0-9\]* = 0" "print unsigned char >"
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == 127" "\\$\[0-9\]* = $true" "print unsigned char =="
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != 127" "\\$\[0-9\]* = $false" "print unsigned char !="
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char <"
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $false" "print unsigned char >"
|
||||
# make char a minus
|
||||
# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've
|
||||
# set up an expected failure for this case.
|
||||
setup_xfail "i960-*-*" 1821
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = 0" "print v_unsigned_char == ~0" "\\$\[0-9\]* = 0" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = 1" "print unsigned char == (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)"
|
||||
# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've
|
||||
# set up an expected failure for this case.
|
||||
setup_xfail "i960-*-*" 1821
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = 1" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = 0" "print unsigned char != (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = 0" "print v_unsigned_char < 127" "\\$\[0-9\]* = 0" "print unsigned char < (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = 1" "print v_unsigned_char > 127" "\\$\[0-9\]* = 1" "print unsigned char > (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print unsigned char != (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)"
|
||||
#
|
||||
# test expressions with "short" types
|
||||
#
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short == 0" "\\$\[0-9\]* = 0" "print v_short == 0x7FFF" "\\$\[0-9\]* = 1" "print signed short =="
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short != 0" "\\$\[0-9\]* = 1" "print v_short != 0x7FFF" "\\$\[0-9\]* = 0" "print signed short !="
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short < 0" "\\$\[0-9\]* = 0" "print v_short < 0x7FFF" "\\$\[0-9\]* = 0" "print signed short <"
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short > 0" "\\$\[0-9\]* = 1" "print v_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed short >"
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed short =="
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed short !="
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short < 0" "\\$\[0-9\]* = $false" "print v_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed short <"
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short > 0" "\\$\[0-9\]* = $true" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short >"
|
||||
# make short a minus
|
||||
test_expr "set variable v_short=-1" "print v_short == 0" "\\$\[0-9\]* = 0" "print v_short == -1" "\\$\[0-9\]* = 1" "print signed short == (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short != 0" "\\$\[0-9\]* = 1" "print v_short != -1" "\\$\[0-9\]* = 0" "print signed short != (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short < 0" "\\$\[0-9\]* = 1" "print v_short < 0x7FFF" "\\$\[0-9\]* = 1" "print signed short < (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short > 0" "\\$\[0-9\]* = 0" "print v_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed short > (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == -1" "\\$\[0-9\]* = $true" "print signed short == (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != -1" "\\$\[0-9\]* = $false" "print signed short != (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short < 0" "\\$\[0-9\]* = $true" "print v_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed short < (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short > 0" "\\$\[0-9\]* = $false" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short > (minus)"
|
||||
#
|
||||
# test expressions with "signed short" types
|
||||
#
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "\\$\[0-9\]* = 0" "print v_signed_short == 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed short =="
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "\\$\[0-9\]* = 1" "print v_signed_short != 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short !="
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "\\$\[0-9\]* = 0" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short <"
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "\\$\[0-9\]* = 1" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short >"
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short =="
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short !="
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "\\$\[0-9\]* = $false" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short <"
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "\\$\[0-9\]* = $true" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short >"
|
||||
# make short a minus
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "\\$\[0-9\]* = 0" "print v_signed_short == -1" "\\$\[0-9\]* = 1" "print signed signed short == (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "\\$\[0-9\]* = 1" "print v_signed_short != -1" "\\$\[0-9\]* = 0" "print signed signed short != (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "\\$\[0-9\]* = 1" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed short < (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "\\$\[0-9\]* = 0" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short > (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == -1" "\\$\[0-9\]* = $true" "print signed signed short == (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != -1" "\\$\[0-9\]* = $false" "print signed signed short != (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "\\$\[0-9\]* = $true" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short < (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "\\$\[0-9\]* = $false" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned short" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "\\$\[0-9\]* = 0" "print v_unsigned_short == 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned short =="
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "\\$\[0-9\]* = 1" "print v_unsigned_short != 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short !="
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = 0" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short <"
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = 1" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short >"
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short =="
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short !="
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short <"
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short >"
|
||||
# make short a minus
|
||||
# note that (unsigned short) ~0 == ~0 iff sizeof(short) == sizeof(int),
|
||||
# so we can't test v_unsigned_short != ~0
|
||||
test_expr "set variable v_unsigned_short=~0" \
|
||||
"print v_unsigned_short == 0" "\\$\[0-9\]* = 0" \
|
||||
"print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = 1" \
|
||||
"print unsigned short == (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = 1" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = 0" "print unsigned short != (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = 0" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short < (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = 1" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned short > (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = $false" "print unsigned short != (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short < (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short > (~0)"
|
||||
#
|
||||
# test expressions with "int" types
|
||||
#
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int == 0" "\\$\[0-9\]* = 0" "print v_int == 0x7FFF" "\\$\[0-9\]* = 1" "print signed int =="
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int != 0" "\\$\[0-9\]* = 1" "print v_int != 0x7FFF" "\\$\[0-9\]* = 0" "print signed int !="
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int < 0" "\\$\[0-9\]* = 0" "print v_int < 0x7FFF" "\\$\[0-9\]* = 0" "print signed int <"
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int > 0" "\\$\[0-9\]* = 1" "print v_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed int >"
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed int =="
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed int !="
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int < 0" "\\$\[0-9\]* = $false" "print v_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed int <"
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int > 0" "\\$\[0-9\]* = $true" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int >"
|
||||
# make int a minus
|
||||
test_expr "set variable v_int=-1" "print v_int == 0" "\\$\[0-9\]* = 0" "print v_int == -1" "\\$\[0-9\]* = 1" "print signed int == (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int != 0" "\\$\[0-9\]* = 1" "print v_int != -1" "\\$\[0-9\]* = 0" "print signed int != (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int < 0" "\\$\[0-9\]* = 1" "print v_int < 0x7FFF" "\\$\[0-9\]* = 1" "print signed int < (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int > 0" "\\$\[0-9\]* = 0" "print v_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed int > (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == -1" "\\$\[0-9\]* = $true" "print signed int == (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != -1" "\\$\[0-9\]* = $false" "print signed int != (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int < 0" "\\$\[0-9\]* = $true" "print v_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed int < (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int > 0" "\\$\[0-9\]* = $false" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int > (minus)"
|
||||
#
|
||||
# test expressions with "signed int" types
|
||||
#
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "\\$\[0-9\]* = 0" "print v_signed_int == 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed int =="
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "\\$\[0-9\]* = 1" "print v_signed_int != 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int !="
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "\\$\[0-9\]* = 0" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int <"
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "\\$\[0-9\]* = 1" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int >"
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int =="
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int !="
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "\\$\[0-9\]* = $false" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int <"
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "\\$\[0-9\]* = $true" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int >"
|
||||
# make int a minus
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "\\$\[0-9\]* = 0" "print v_signed_int == -1" "\\$\[0-9\]* = 1" "print signed signed int == (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "\\$\[0-9\]* = 1" "print v_signed_int != -1" "\\$\[0-9\]* = 0" "print signed signed int != (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "\\$\[0-9\]* = 1" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed int < (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "\\$\[0-9\]* = 0" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int > (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == -1" "\\$\[0-9\]* = $true" "print signed signed int == (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != -1" "\\$\[0-9\]* = $false" "print signed signed int != (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "\\$\[0-9\]* = $true" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int < (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "\\$\[0-9\]* = $false" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned int" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "\\$\[0-9\]* = 0" "print v_unsigned_int == 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned int =="
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "\\$\[0-9\]* = 1" "print v_unsigned_int != 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int !="
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "\\$\[0-9\]* = 0" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int <"
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "\\$\[0-9\]* = 1" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int >"
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int =="
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int !="
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int <"
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int >"
|
||||
# make int a minus
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "\\$\[0-9\]* = 0" "print v_unsigned_int == ~0" "\\$\[0-9\]* = 1" "print v_unsigned_int == (unsigned int)~0" "\\$\[0-9\]* = 1" "print unsigned int == (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "\\$\[0-9\]* = 1" "print v_unsigned_int != (unsigned int)~0" "\\$\[0-9\]* = 0" "print unsigned int != (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "\\$\[0-9\]* = 0" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int < (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "\\$\[0-9\]* = 1" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned int > (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_int == (unsigned int)~0" "\\$\[0-9\]* = $true" "print unsigned int == (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != (unsigned int)~0" "\\$\[0-9\]* = $false" "print unsigned int != (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int < (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int > (~0)"
|
||||
#
|
||||
# test expressions with "long" types
|
||||
#
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long == 0" "\\$\[0-9\]* = 0" "print v_long == 0x7FFF" "\\$\[0-9\]* = 1" "print signed long =="
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long != 0" "\\$\[0-9\]* = 1" "print v_long != 0x7FFF" "\\$\[0-9\]* = 0" "print signed long !="
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long < 0" "\\$\[0-9\]* = 0" "print v_long < 0x7FFF" "\\$\[0-9\]* = 0" "print signed long <"
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long > 0" "\\$\[0-9\]* = 1" "print v_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed long >"
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed long =="
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed long !="
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long < 0" "\\$\[0-9\]* = $false" "print v_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed long <"
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long > 0" "\\$\[0-9\]* = $true" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long >"
|
||||
# make long a minus
|
||||
test_expr "set variable v_long=-1" "print v_long == 0" "\\$\[0-9\]* = 0" "print v_long == -1" "\\$\[0-9\]* = 1" "print signed long == (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long != 0" "\\$\[0-9\]* = 1" "print v_long != -1" "\\$\[0-9\]* = 0" "print signed long != (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long < 0" "\\$\[0-9\]* = 1" "print v_long < 0x7FFF" "\\$\[0-9\]* = 1" "print signed long < (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long > 0" "\\$\[0-9\]* = 0" "print v_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed long > (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == -1" "\\$\[0-9\]* = $true" "print signed long == (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != -1" "\\$\[0-9\]* = $false" "print signed long != (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long < 0" "\\$\[0-9\]* = $true" "print v_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed long < (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long > 0" "\\$\[0-9\]* = $false" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long > (minus)"
|
||||
#
|
||||
# test expressions with "signed long" types
|
||||
#
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "\\$\[0-9\]* = 0" "print v_signed_long == 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed long =="
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "\\$\[0-9\]* = 1" "print v_signed_long != 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long !="
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "\\$\[0-9\]* = 0" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long <"
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "\\$\[0-9\]* = 1" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long >"
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long =="
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long !="
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "\\$\[0-9\]* = $false" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long <"
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "\\$\[0-9\]* = $true" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long >"
|
||||
# make long a minus
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "\\$\[0-9\]* = 0" "print v_signed_long == -1" "\\$\[0-9\]* = 1" "print signed signed long == (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "\\$\[0-9\]* = 1" "print v_signed_long != -1" "\\$\[0-9\]* = 0" "print signed signed long != (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "\\$\[0-9\]* = 1" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed long < (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "\\$\[0-9\]* = 0" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long > (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == -1" "\\$\[0-9\]* = $true" "print signed signed long == (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != -1" "\\$\[0-9\]* = $false" "print signed signed long != (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "\\$\[0-9\]* = $true" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long < (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "\\$\[0-9\]* = $false" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned long" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "\\$\[0-9\]* = 0" "print v_unsigned_long == 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned long =="
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "\\$\[0-9\]* = 1" "print v_unsigned_long != 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long !="
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "\\$\[0-9\]* = 0" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long <"
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "\\$\[0-9\]* = 1" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long >"
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long =="
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long !="
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long <"
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long >"
|
||||
# make long a minus
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "\\$\[0-9\]* = 0" "print v_unsigned_long == ~0" "\\$\[0-9\]* = 1" "print v_unsigned_long == (unsigned long)~0" "\\$\[0-9\]* = 1" "print unsigned long == (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "\\$\[0-9\]* = 1" "print v_unsigned_long != (unsigned long)~0" "\\$\[0-9\]* = 0" "print unsigned long != (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "\\$\[0-9\]* = 0" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long < (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-9\]* = 1" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned long > (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_long == (unsigned long)~0" "\\$\[0-9\]* = $true" "print unsigned long == (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != (unsigned long)~0" "\\$\[0-9\]* = $false" "print unsigned long != (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long < (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long > (~0)"
|
||||
|
@ -71,8 +71,12 @@ char carray[] = {'a', 'n', ' ', 'a', 'r', 'r', 'a', 'y', '\0'};
|
||||
/* Test various permutations and interleaving of integral arguments */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call0a (char c, short s, int i, long l)
|
||||
#else
|
||||
call0a (c, s, i, l)
|
||||
char c; short s; int i; long l;
|
||||
#endif
|
||||
{
|
||||
c = 'a';
|
||||
s = 5;
|
||||
@ -80,26 +84,42 @@ char c; short s; int i; long l;
|
||||
l = 7;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call0b (short s, int i, long l, char c)
|
||||
#else
|
||||
call0b (s, i, l, c)
|
||||
short s; int i; long l; char c;
|
||||
#endif
|
||||
{
|
||||
s = 6; i = 7; l = 8; c = 'j';
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call0c (int i, long l, char c, short s)
|
||||
#else
|
||||
call0c (i, l, c, s)
|
||||
int i; long l; char c; short s;
|
||||
#endif
|
||||
{
|
||||
i = 3; l = 4; c = 'k'; s = 5;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call0d (long l, char c, short s, int i)
|
||||
#else
|
||||
call0d (l, c, s, i)
|
||||
long l; char c; short s; int i;
|
||||
#endif
|
||||
{
|
||||
l = 7; c = 'z'; s = 8; i = 9;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call0e (char c1, long l, char c2, int i, char c3, short s, char c4, char c5)
|
||||
#else
|
||||
call0e (c1, l, c2, i, c3, s, c4, c5)
|
||||
char c1; long l; char c2; int i; char c3; short s; char c4; char c5;
|
||||
#endif
|
||||
{
|
||||
c1 = 'a'; l = 5; c2 = 'b'; i = 7; c3 = 'c'; s = 7; c4 = 'f'; c5 = 'g';
|
||||
}
|
||||
@ -108,33 +128,53 @@ char c1; long l; char c2; int i; char c3; short s; char c4; char c5;
|
||||
/* Test various permutations and interleaving of unsigned integral arguments */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call1a (unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call1a (uc, us, ui, ul)
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call1b (unsigned short us, unsigned int ui, unsigned long ul, unsigned char uc)
|
||||
#else
|
||||
call1b (us, ui, ul, uc)
|
||||
unsigned short us; unsigned int ui; unsigned long ul; unsigned char uc;
|
||||
#endif
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call1c (unsigned int ui, unsigned long ul, unsigned char uc, unsigned short us)
|
||||
#else
|
||||
call1c (ui, ul, uc, us)
|
||||
unsigned int ui; unsigned long ul; unsigned char uc; unsigned short us;
|
||||
#endif
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call1d (unsigned long ul, unsigned char uc, unsigned short us, unsigned int ui)
|
||||
#else
|
||||
call1d (ul, uc, us, ui)
|
||||
unsigned long ul; unsigned char uc; unsigned short us; unsigned int ui;
|
||||
#endif
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call1e (unsigned char uc1, unsigned long ul, unsigned char uc2, unsigned int ui, unsigned char uc3, unsigned short us, unsigned char uc4, unsigned char uc5)
|
||||
#else
|
||||
call1e (uc1, ul, uc2, ui, uc3, us, uc4, uc5)
|
||||
unsigned char uc1; unsigned long ul; unsigned char uc2; unsigned int ui;
|
||||
unsigned char uc3; unsigned short us; unsigned char uc4; unsigned char uc5;
|
||||
#endif
|
||||
{
|
||||
uc1 = 5; ul = 7; uc2 = 8; ui = 9; uc3 = 10; us = 11; uc4 = 12; uc5 = 55;
|
||||
}
|
||||
@ -143,57 +183,93 @@ unsigned char uc3; unsigned short us; unsigned char uc4; unsigned char uc5;
|
||||
floating point arguments. */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2a (char c, float f1, short s, double d1, int i, float f2, long l, double d2)
|
||||
#else
|
||||
call2a (c, f1, s, d1, i, f2, l, d2)
|
||||
char c; float f1; short s; double d1; int i; float f2; long l; double d2;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2b (float f1, short s, double d1, int i, float f2, long l, double d2, char c)
|
||||
#else
|
||||
call2b (f1, s, d1, i, f2, l, d2, c)
|
||||
float f1; short s; double d1; int i; float f2; long l; double d2; char c;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2c (short s, double d1, int i, float f2, long l, double d2, char c, float f1)
|
||||
#else
|
||||
call2c (s, d1, i, f2, l, d2, c, f1)
|
||||
short s; double d1; int i; float f2; long l; double d2; char c; float f1;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2d (double d1, int i, float f2, long l, double d2, char c, float f1, short s)
|
||||
#else
|
||||
call2d (d1, i, f2, l, d2, c, f1, s)
|
||||
double d1; int i; float f2; long l; double d2; char c; float f1; short s;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2e (int i, float f2, long l, double d2, char c, float f1, short s, double d1)
|
||||
#else
|
||||
call2e (i, f2, l, d2, c, f1, s, d1)
|
||||
int i; float f2; long l; double d2; char c; float f1; short s; double d1;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2f (float f2, long l, double d2, char c, float f1, short s, double d1, int i)
|
||||
#else
|
||||
call2f (f2, l, d2, c, f1, s, d1, i)
|
||||
float f2; long l; double d2; char c; float f1; short s; double d1; int i;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2g (long l, double d2, char c, float f1, short s, double d1, int i, float f2)
|
||||
#else
|
||||
call2g (l, d2, c, f1, s, d1, i, f2)
|
||||
long l; double d2; char c; float f1; short s; double d1; int i; float f2;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2h (double d2, char c, float f1, short s, double d1, int i, float f2, long l)
|
||||
#else
|
||||
call2h (d2, c, f1, s, d1, i, f2, l)
|
||||
double d2; char c; float f1; short s; double d1; int i; float f2; long l;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call2i (char c1, float f1, char c2, char c3, double d1, char c4, char c5, char c6, float f2, short s, char c7, double d2)
|
||||
#else
|
||||
call2i (c1, f1, c2, c3, d1, c4, c5, c6, f2, s, c7, d2)
|
||||
char c1; float f1; char c2; char c3; double d1; char c4; char c5; char c6;
|
||||
float f2; short s; char c7; double d2;
|
||||
#endif
|
||||
{
|
||||
c1 = 'a'; f1 = 0.0; c2 = 5; d1 = 0.0; c3 = 6; f2 = 0.1; c4 = 7; d2 = 0.2;
|
||||
c5 = 's'; c6 = 'f'; c7 = 'z'; s = 77;
|
||||
@ -203,21 +279,33 @@ float f2; short s; char c7; double d2;
|
||||
/* Test pointers to various integral and floating types. */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call3a (char *cp, short *sp, int *ip, long *lp)
|
||||
#else
|
||||
call3a (cp, sp, ip, lp)
|
||||
char *cp; short *sp; int *ip; long *lp;
|
||||
#endif
|
||||
{
|
||||
cp = 0; sp = 0; ip = 0; lp = 0;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call3b (unsigned char *ucp, unsigned short *usp, unsigned int *uip, unsigned long *ulp)
|
||||
#else
|
||||
call3b (ucp, usp, uip, ulp)
|
||||
unsigned char *ucp; unsigned short *usp; unsigned int *uip;
|
||||
unsigned long *ulp;
|
||||
#endif
|
||||
{
|
||||
ucp = 0; usp = 0; uip = 0; ulp = 0;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call3c (float *fp, double *dp)
|
||||
#else
|
||||
call3c (fp, dp)
|
||||
float *fp; double *dp;
|
||||
#endif
|
||||
{
|
||||
fp = 0; dp = 0;
|
||||
}
|
||||
@ -226,12 +314,20 @@ float *fp; double *dp;
|
||||
/* Test passing structures and unions by reference. */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call4a (struct stag *stp)
|
||||
#else
|
||||
call4a (stp)
|
||||
struct stag *stp; {
|
||||
stp = 0;}
|
||||
struct stag *stp;
|
||||
#endif
|
||||
{stp = 0;}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call4b (union utag *unp)
|
||||
#else
|
||||
call4b (unp)
|
||||
union utag *unp;
|
||||
#endif
|
||||
{
|
||||
unp = 0;
|
||||
}
|
||||
@ -240,165 +336,258 @@ union utag *unp;
|
||||
/* Test passing structures and unions by value. */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call5a (struct stag st)
|
||||
#else
|
||||
call5a (st)
|
||||
struct stag st; {st.s1 = 5;}
|
||||
struct stag st;
|
||||
#endif
|
||||
{st.s1 = 5;}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call5b (union utag un)
|
||||
#else
|
||||
call5b (un)
|
||||
union utag un; {un.u1 = 7;}
|
||||
union utag un;
|
||||
#endif
|
||||
{un.u1 = 7;}
|
||||
|
||||
|
||||
/* Test shuffling of args */
|
||||
|
||||
|
||||
call6a (c, s, i, l, f, d, uc, us, ui, ul)
|
||||
char c; short s; int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
void call6k ()
|
||||
{
|
||||
c = c;
|
||||
call6b (s, i, l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6b (s, i, l, f, d, uc, us, ui, ul)
|
||||
short s; int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
s = s;
|
||||
call6c (i, l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6c (i, l, f, d, uc, us, ui, ul)
|
||||
int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
i = i;
|
||||
call6d (l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6d (l, f, d, uc, us, ui, ul)
|
||||
long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
l = l;
|
||||
call6e (f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6e (f, d, uc, us, ui, ul)
|
||||
float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
f = f;
|
||||
call6f (d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6f (d, uc, us, ui, ul)
|
||||
double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
d = d;
|
||||
call6g (uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6g (uc, us, ui, ul)
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
uc = uc;
|
||||
call6h (us, ui, ul);
|
||||
}
|
||||
|
||||
call6h (us, ui, ul)
|
||||
unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
us = us;
|
||||
call6i (ui, ul);
|
||||
}
|
||||
|
||||
call6i (ui, ul)
|
||||
unsigned int ui; unsigned long ul;
|
||||
{
|
||||
ui = ui;
|
||||
call6j (ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6j (unsigned long ul)
|
||||
#else
|
||||
call6j (ul)
|
||||
unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
ul = ul;
|
||||
call6k ();
|
||||
}
|
||||
|
||||
call6k ()
|
||||
#ifdef PROTOTYPES
|
||||
void call6i (unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6i (ui, ul)
|
||||
unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
ui = ui;
|
||||
call6j (ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6h (unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6h (us, ui, ul)
|
||||
unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
us = us;
|
||||
call6i (ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6g (unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6g (uc, us, ui, ul)
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
uc = uc;
|
||||
call6h (us, ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6f (double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6f (d, uc, us, ui, ul)
|
||||
double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
d = d;
|
||||
call6g (uc, us, ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6e (float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6e (f, d, uc, us, ui, ul)
|
||||
float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
f = f;
|
||||
call6f (d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6d (long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6d (l, f, d, uc, us, ui, ul)
|
||||
long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
l = l;
|
||||
call6e (f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6c (int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6c (i, l, f, d, uc, us, ui, ul)
|
||||
int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
i = i;
|
||||
call6d (l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6b (short s, int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6b (s, i, l, f, d, uc, us, ui, ul)
|
||||
short s; int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
s = s;
|
||||
call6c (i, l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call6a (char c, short s, int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
call6a (c, s, i, l, f, d, uc, us, ui, ul)
|
||||
char c; short s; int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
c = c;
|
||||
call6b (s, i, l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
/* Test shuffling of args, round robin */
|
||||
|
||||
|
||||
call7a (c, i, s, l, f, uc, d, us, ul, ui)
|
||||
#ifdef PROTOTYPES
|
||||
void call7k (char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui)
|
||||
#else
|
||||
call7k (c, i, s, l, f, uc, d, us, ul, ui)
|
||||
char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
#endif
|
||||
{
|
||||
call7b (i, s, l, f, uc, d, us, ul, ui, c);
|
||||
}
|
||||
|
||||
call7b (i, s, l, f, uc, d, us, ul, ui, c)
|
||||
int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c;
|
||||
{
|
||||
call7c (s, l, f, uc, d, us, ul, ui, c, i);
|
||||
}
|
||||
|
||||
call7c (s, l, f, uc, d, us, ul, ui, c, i)
|
||||
short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i;
|
||||
{
|
||||
call7d (l, f, uc, d, us, ul, ui, c, i, s);
|
||||
}
|
||||
|
||||
call7d (l, f, uc, d, us, ul, ui, c, i, s)
|
||||
long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s;
|
||||
{
|
||||
call7e (f, uc, d, us, ul, ui, c, i, s, l);
|
||||
}
|
||||
|
||||
call7e (f, uc, d, us, ul, ui, c, i, s, l)
|
||||
float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l;
|
||||
{
|
||||
call7f (uc, d, us, ul, ui, c, i, s, l, f);
|
||||
}
|
||||
|
||||
call7f (uc, d, us, ul, ui, c, i, s, l, f)
|
||||
unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f;
|
||||
{
|
||||
call7g (d, us, ul, ui, c, i, s, l, f, uc);
|
||||
}
|
||||
|
||||
call7g (d, us, ul, ui, c, i, s, l, f, uc)
|
||||
double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc;
|
||||
{
|
||||
call7h (us, ul, ui, c, i, s, l, f, uc, d);
|
||||
}
|
||||
|
||||
call7h (us, ul, ui, c, i, s, l, f, uc, d)
|
||||
unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d;
|
||||
{
|
||||
call7i (ul, ui, c, i, s, l, f, uc, d, us);
|
||||
}
|
||||
|
||||
call7i (ul, ui, c, i, s, l, f, uc, d, us)
|
||||
unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us;
|
||||
{
|
||||
call7j (ui, c, i, s, l, f, uc, d, us, ul);
|
||||
c = 'a'; i = 7; s = 8; l = 7; f = 0.3; uc = 44; d = 0.44; us = 77;
|
||||
ul = 43; ui = 33;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7j (unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul)
|
||||
#else
|
||||
call7j (ui, c, i, s, l, f, uc, d, us, ul)
|
||||
unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul;
|
||||
#endif
|
||||
{
|
||||
call7k (c, i, s, l, f, uc, d, us, ul, ui);
|
||||
}
|
||||
|
||||
call7k (c, i, s, l, f, uc, d, us, ul, ui)
|
||||
char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
#ifdef PROTOTYPES
|
||||
void call7i (unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us)
|
||||
#else
|
||||
call7i (ul, ui, c, i, s, l, f, uc, d, us)
|
||||
unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us;
|
||||
#endif
|
||||
{
|
||||
c = 'a'; i = 7; s = 8; l = 7; f = 0.3; uc = 44; d = 0.44; us = 77;
|
||||
ul = 43; ui = 33;
|
||||
call7j (ui, c, i, s, l, f, uc, d, us, ul);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7h (unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d)
|
||||
#else
|
||||
call7h (us, ul, ui, c, i, s, l, f, uc, d)
|
||||
unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d;
|
||||
#endif
|
||||
{
|
||||
call7i (ul, ui, c, i, s, l, f, uc, d, us);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7g (double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc)
|
||||
#else
|
||||
call7g (d, us, ul, ui, c, i, s, l, f, uc)
|
||||
double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc;
|
||||
#endif
|
||||
{
|
||||
call7h (us, ul, ui, c, i, s, l, f, uc, d);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7f (unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f)
|
||||
#else
|
||||
call7f (uc, d, us, ul, ui, c, i, s, l, f)
|
||||
unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f;
|
||||
#endif
|
||||
{
|
||||
call7g (d, us, ul, ui, c, i, s, l, f, uc);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7e (float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l)
|
||||
#else
|
||||
call7e (f, uc, d, us, ul, ui, c, i, s, l)
|
||||
float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l;
|
||||
#endif
|
||||
{
|
||||
call7f (uc, d, us, ul, ui, c, i, s, l, f);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7d (long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s)
|
||||
#else
|
||||
call7d (l, f, uc, d, us, ul, ui, c, i, s)
|
||||
long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s;
|
||||
#endif
|
||||
{
|
||||
call7e (f, uc, d, us, ul, ui, c, i, s, l);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7c (short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i)
|
||||
#else
|
||||
call7c (s, l, f, uc, d, us, ul, ui, c, i)
|
||||
short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i;
|
||||
#endif
|
||||
{
|
||||
call7d (l, f, uc, d, us, ul, ui, c, i, s);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7b (int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c)
|
||||
#else
|
||||
call7b (i, s, l, f, uc, d, us, ul, ui, c)
|
||||
int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c;
|
||||
#endif
|
||||
{
|
||||
call7c (s, l, f, uc, d, us, ul, ui, c, i);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call7a (char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui)
|
||||
#else
|
||||
call7a (c, i, s, l, f, uc, d, us, ul, ui)
|
||||
char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
#endif
|
||||
{
|
||||
call7b (i, s, l, f, uc, d, us, ul, ui, c);
|
||||
}
|
||||
|
||||
|
||||
@ -412,13 +601,17 @@ typedef struct s
|
||||
long l;
|
||||
} SVAL;
|
||||
|
||||
hitbottom ()
|
||||
void hitbottom ()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void recurse (SVAL a, int depth)
|
||||
#else
|
||||
void recurse (a, depth)
|
||||
SVAL a;
|
||||
int depth;
|
||||
#endif
|
||||
{
|
||||
a.s = a.i = a.l = --depth;
|
||||
if (depth == 0)
|
||||
@ -427,7 +620,7 @@ int depth;
|
||||
recurse (a, depth);
|
||||
}
|
||||
|
||||
test_struct_args ()
|
||||
void test_struct_args ()
|
||||
{
|
||||
SVAL s; s.s = 5; s.i = 5; s.l = 5;
|
||||
|
||||
@ -438,12 +631,16 @@ test_struct_args ()
|
||||
calls alloca may do things differently with respect to frames. So give
|
||||
it a try. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void localvars_after_alloca (char c, short s, int i, long l)
|
||||
#else
|
||||
int
|
||||
localvars_after_alloca (c, s, i, l)
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_STACK_ALLOCA
|
||||
/* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
|
||||
@ -458,21 +655,29 @@ localvars_after_alloca (c, s, i, l)
|
||||
l = 7;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call_after_alloca_subr (char c, short s, int i, long l, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
|
||||
#else
|
||||
void
|
||||
call_after_alloca_subr (c, s, i, l, uc, us, ui, ul)
|
||||
char c; int i; short s; long l; unsigned char uc; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
#endif
|
||||
{
|
||||
c = 'a';
|
||||
i = 7; s = 8; l = 7; uc = 44; us = 77;
|
||||
ul = 43; ui = 33;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
void call_after_alloca (char c, short s, int i, long l)
|
||||
#else
|
||||
int
|
||||
call_after_alloca (c, s, i, l)
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_STACK_ALLOCA
|
||||
/* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
|
||||
@ -491,9 +696,13 @@ call_after_alloca (c, s, i, l)
|
||||
will require a trampoline between dyncall and this function on the
|
||||
call path, then another trampoline on between this function and main
|
||||
on the return path. */
|
||||
#ifdef PROTOTYPES
|
||||
double call_with_trampolines (double d1)
|
||||
#else
|
||||
double
|
||||
call_with_trampolines (d1)
|
||||
double d1;
|
||||
#endif
|
||||
{
|
||||
return d1;
|
||||
} /* End of call_with_trampolines, this comment is needed by funcargs.exp */
|
||||
@ -506,10 +715,10 @@ marker_indirect_call () {}
|
||||
void
|
||||
marker_call_with_trampolines () {}
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
int (*pointer_to_call0a) () = call0a;
|
||||
double (*pointer_to_call_with_trampolines) () = call_with_trampolines;
|
||||
void (*pointer_to_call0a) (char, short, int, long) = (void (*)(char, short, int, long))call0a;
|
||||
double (*pointer_to_call_with_trampolines) (double) = call_with_trampolines;
|
||||
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
@ -579,4 +788,5 @@ main ()
|
||||
(*pointer_to_call0a) (c, s, i, l); /* Second step into call0a. */
|
||||
marker_call_with_trampolines ();
|
||||
(*pointer_to_call_with_trampolines) (d); /* Test multiple trampolines. */
|
||||
return 0;
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ proc float_and_integral_args {} {
|
||||
global gdb_prompt
|
||||
global det_file
|
||||
global gcc_compiled
|
||||
global hp_cc_compiler
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
@ -186,55 +187,67 @@ proc float_and_integral_args {} {
|
||||
# code is broken.
|
||||
setup_xfail "a29k-*-udi"
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
|
||||
# The debug info. for "f" is not correct. It's a known bug.
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
gdb_run_cmd
|
||||
gdb_expect {
|
||||
-re ".* call2a \\(c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { pass "run to call2a" }
|
||||
-re ".* call2a \\(c=97 'a', f1=.*, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { xfail "run to call2a" }
|
||||
-re "$gdb_prompt $" { fail "run to call2a" ; gdb_suppress_tests; }
|
||||
timeout { fail "(timeout) run to call2a" ; gdb_suppress_tests; }
|
||||
}
|
||||
|
||||
# Print each arg as a double check to see if we can print
|
||||
gdb_test "print c" ".* = 97 'a'" "print c after run to call2a"
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
gdb_test "print f1" ".* = 4" "print f1 after run to call2a"
|
||||
gdb_test "print s" ".* = 1" "print s after run to call2a"
|
||||
gdb_test "print d1" ".* = 5" "print d1 after run to call2a"
|
||||
gdb_test "print i" ".* = 2" "print i after run to call2a"
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
gdb_test "print f2" ".* = 4" "print f2 after run to call2a"
|
||||
gdb_test "print l" ".* = 3" "print l after run to call2a"
|
||||
gdb_test "print d2" ".* = 5" "print d2 after run to call2a"
|
||||
|
||||
setup_xfail "rs6000-*-*"
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
|
||||
# Continue; should stop at call2b and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2c and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) .*" "continue to call2c"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2d and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) .*" "continue to call2d"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2e and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) .*" "continue to call2e"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2f and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) .*" "continue to call2f"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2g and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) .*" "continue to call2g"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2h and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) .*" "continue to call2h"] {
|
||||
gdb_suppress_tests;
|
||||
@ -245,6 +258,7 @@ proc float_and_integral_args {} {
|
||||
delete_breakpoints
|
||||
gdb_breakpoint call2i
|
||||
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
# Continue; should stop at call2i and print actual arguments.
|
||||
if [gdb_test "cont" ".* call2i \\(c1=97 'a', f1=4, c2=97 'a', c3=97 'a', d1=5, c4=97 'a', c5=97 'a', c6=97 'a', f2=4, s=1, c7=97 'a', d2=5\\) .*" "continue to call2i"] {
|
||||
gdb_suppress_tests;
|
||||
@ -449,6 +463,7 @@ proc discard_and_shuffle {} {
|
||||
global decimal
|
||||
global det_file
|
||||
global gcc_compiled
|
||||
global hp_cc_compiler
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
@ -480,8 +495,30 @@ proc discard_and_shuffle {} {
|
||||
setup_xfail "mips-sgi-irix5*"
|
||||
}
|
||||
|
||||
if [gdb_test "backtrace 100" " call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6a"] {
|
||||
gdb_suppress_tests;
|
||||
# The debug info. for "f" is not correct. It's a known bug.
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
send_gdb "backtrace 100\n"
|
||||
gdb_expect {
|
||||
-re "backtrace 100\[\r\n\]+
|
||||
.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
|
||||
.* main \\(.*\\) .*\r
|
||||
$gdb_prompt $" {
|
||||
pass "backtrace from call6a"
|
||||
}
|
||||
-re "backtrace 100\[\r\n\]+
|
||||
.* call6a \\(c=97 'a', s=1, i=2, l=3, f=.*, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
|
||||
.* main \\(.*\\) .*\r
|
||||
$gdb_prompt $" {
|
||||
xfail "backtrace from call6a"
|
||||
}
|
||||
-re "$gdb_prompt $" {
|
||||
fail "backtrace from call6a"
|
||||
gdb_suppress_tests
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) backtrace from call6a"
|
||||
gdb_suppress_tests
|
||||
}
|
||||
}
|
||||
|
||||
# Continue; should stop at call6b and print actual arguments.
|
||||
@ -489,7 +526,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6b
|
||||
|
||||
if [gdb_test "backtrace 100" " call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6b"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\]*.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\]" "backtrace from call6b"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -498,7 +536,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6c
|
||||
|
||||
if [gdb_test "backtrace 100" " call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6c"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6c"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
# Continue; should stop at call6d and print actual arguments.
|
||||
@ -506,7 +545,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6d
|
||||
|
||||
if [gdb_test "backtrace 100" " call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6d"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6d"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -515,7 +555,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6e
|
||||
|
||||
if [gdb_test "backtrace 100" " call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6e"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6e"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -524,7 +565,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6f
|
||||
|
||||
if [gdb_test "backtrace 100" " call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6f"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6f"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -533,7 +575,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6g
|
||||
|
||||
if [gdb_test "backtrace 100" " call6g \\(uc=98 'b', us=6, ui=7, ul=8\\).* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6g"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6g"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -542,7 +585,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6h
|
||||
|
||||
if [gdb_test "backtrace 100" " call6h \\(us=6, ui=7, ul=8\\).* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\).* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6h"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6h \\(us=6, ui=7, ul=8\\) .*\[\r\n\].* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6h"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -558,7 +602,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6i
|
||||
|
||||
if [gdb_test "backtrace 100" " call6i \\(ui=7, ul=8\\).* call6h \\(us=6, ui=7, ul=8\\).* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\).* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6i"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6i \\(ui=7, ul=8\\) .*\[\r\n\].* call6h \\(us=6, ui=7, ul=8\\) .*\[\r\n\].* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6i"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -567,7 +612,8 @@ proc discard_and_shuffle {} {
|
||||
|
||||
gdb_continue call6j
|
||||
|
||||
if [gdb_test "backtrace 100" " call6j \\(ul=8\\).* call6i \\(ui=7, ul=8\\).* call6h \\(us=6, ui=7, ul=8\\).* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\).* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6j"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6j \\(ul=8\\) .*\[\r\n\].* call6i \\(ui=7, ul=8\\) .*\[\r\n\].* call6h \\(us=6, ui=7, ul=8\\) .*\[\r\n\].* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6j"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
@ -578,7 +624,8 @@ proc discard_and_shuffle {} {
|
||||
setup_xfail "i960-*-vxworks" 1786
|
||||
gdb_continue call6k
|
||||
|
||||
if [gdb_test "backtrace 100" " call6k \\(\\).* call6j \\(ul=8\\).* call6i \\(ui=7, ul=8\\).* call6h \\(us=6, ui=7, ul=8\\).* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\).* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\).* main \\(.*\\).*" "backtrace from call6k"] {
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
if [gdb_test "backtrace 100" ".* call6k \\(\\) .*\[\r\n\].* call6j \\(ul=8\\) .*\[\r\n\].* call6i \\(ui=7, ul=8\\) .*\[\r\n\].* call6h \\(us=6, ui=7, ul=8\\) .*\[\r\n\].* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n\].* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\[\r\n].* main \\(.*\\) .*" "backtrace from call6k"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
gdb_stop_suppressing_tests;
|
||||
@ -595,6 +642,7 @@ proc shuffle_round_robin {} {
|
||||
global decimal
|
||||
global det_file
|
||||
global gcc_compiled
|
||||
global hp_cc_compiler
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
@ -624,7 +672,25 @@ proc shuffle_round_robin {} {
|
||||
|
||||
setup_xfail "i960-*-*" 1813
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
|
||||
gdb_test "backtrace 100" " call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7a"
|
||||
# The debug info. for "f" is not correct. It's a known bug.
|
||||
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
|
||||
send_gdb "backtrace 100\n"
|
||||
gdb_expect {
|
||||
-re "backtrace 100\[\r\n\]+
|
||||
.* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
|
||||
.* main \\(.*\\) .*\r
|
||||
$gdb_prompt $" {
|
||||
pass "backtrace from call7a"
|
||||
}
|
||||
-re "backtrace 100\[\r\n\]+
|
||||
.* call7a \\(c=97 'a', i=2, s=1, l=3, f=.*, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
|
||||
.* main \\(.*\\) .*\r
|
||||
$gdb_prompt $" {
|
||||
xfail "backtrace from call7a"
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "backtrace from call7a" ; return }
|
||||
timeout { fail "(timeout) backtrace from call7a" ; return }
|
||||
}
|
||||
|
||||
# Continue; should stop at call7b and print actual arguments.
|
||||
# Print backtrace.
|
||||
@ -633,43 +699,43 @@ proc shuffle_round_robin {} {
|
||||
|
||||
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
|
||||
gdb_test "backtrace 100" " call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7b"
|
||||
gdb_test "backtrace 100" ".* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7b"
|
||||
|
||||
# Continue; should stop at call7c and print actual arguments.
|
||||
# Print backtrace.
|
||||
|
||||
gdb_continue call7c
|
||||
|
||||
gdb_test "backtrace 100" " call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7c"
|
||||
gdb_test "backtrace 100" ".* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7c"
|
||||
|
||||
# Continue; should stop at call7d and print actual arguments.
|
||||
# Print backtrace.
|
||||
|
||||
gdb_continue call7d
|
||||
|
||||
gdb_test "backtrace 100" " call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7d"
|
||||
gdb_test "backtrace 100" ".* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7d"
|
||||
|
||||
gdb_continue call7e
|
||||
|
||||
gdb_test "backtrace 100" " call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7e"
|
||||
gdb_test "backtrace 100" ".* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7e"
|
||||
|
||||
# Continue; should stop at call7f and print actual arguments.
|
||||
# Print backtrace.
|
||||
|
||||
gdb_continue call7f
|
||||
|
||||
gdb_test "backtrace 100" " call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\).* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7f"
|
||||
gdb_test "backtrace 100" ".* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\[\r\n\].* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7f"
|
||||
|
||||
# Continue; should stop at call7g and print actual arguments.
|
||||
# Print backtrace.
|
||||
|
||||
gdb_continue call7g
|
||||
|
||||
gdb_test "backtrace 100" " call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\).* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\).* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7g"
|
||||
gdb_test "backtrace 100" ".* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\[\r\n\].* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\[\r\n\].* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7g"
|
||||
|
||||
gdb_continue call7h
|
||||
|
||||
gdb_test "backtrace 100" " call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\).* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\).* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\).* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7h"
|
||||
gdb_test "backtrace 100" ".* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\[\r\n\].* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\[\r\n\].* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\[\r\n\].* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7h"
|
||||
|
||||
# monitor only allows 8 breakpoints; w89k board allows 10, so
|
||||
# break them up into two groups.
|
||||
@ -683,14 +749,14 @@ proc shuffle_round_robin {} {
|
||||
|
||||
gdb_continue call7i
|
||||
|
||||
gdb_test "backtrace 100" " call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\).* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\).* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\).* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\).* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7i"
|
||||
gdb_test "backtrace 100" ".* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) .*\[\r\n\].* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\[\r\n\].* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\[\r\n\].* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\[\r\n\].* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7i"
|
||||
|
||||
# Continue; should stop at call7j and print actual arguments.
|
||||
# Print backtrace.
|
||||
|
||||
gdb_continue call7j
|
||||
|
||||
gdb_test "backtrace 100" " call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\).* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\).* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\).* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\).* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\).* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7j"
|
||||
gdb_test "backtrace 100" ".* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) .*\[\r\n\].* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) .*\[\r\n\].* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\[\r\n\].* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\[\r\n\].* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\[\r\n\].* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7j"
|
||||
|
||||
# Continue; should stop at call7k and print actual arguments.
|
||||
# Print backtrace.
|
||||
@ -698,7 +764,7 @@ proc shuffle_round_robin {} {
|
||||
gdb_continue call7k
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
|
||||
gdb_test "backtrace 100" " call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\).* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\).* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\).* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\).* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\).* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\).* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\).* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\).* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\).* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\).* main \\(.*\\).*" "backtrace from call7k"
|
||||
gdb_test "backtrace 100" ".* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) .*\[\r\n\].* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) .*\[\r\n\].* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\[\r\n\].* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\[\r\n\].* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\[\r\n\].* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\[\r\n\].* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\[\r\n\].* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\[\r\n\].* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\[\r\n\].* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\].*" "backtrace from call7k"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
@ -729,7 +795,7 @@ proc recursive_structs_by_value {} {
|
||||
# The a29k fails all of these tests, perhaps because the prologue
|
||||
# code is broken.
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "backtrace 100" " hitbottom \\(\\).* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\).* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\).* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\).* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\).* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\).* test_struct_args \\(\\).* main \\(.*\\).*" "recursive passing of structs by value"
|
||||
gdb_test "backtrace 100" ".* hitbottom \\(\\) .*\[\r\n\].* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) .*\[\r\n\].* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) .*\[\r\n\].* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) .*\[\r\n\].* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) .*\[\r\n\].* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) .*\[\r\n\].* test_struct_args \\(\\) .*\[\r\n\].* main \\(.*\\) .*\[\r\n\]" "recursive passing of structs by value"
|
||||
} else {
|
||||
fail "recursive passing of structs by value (sparclet)"
|
||||
}
|
||||
@ -859,10 +925,12 @@ proc localvars_in_indirect_call { } {
|
||||
send_gdb "finish\n"
|
||||
gdb_expect {
|
||||
-re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
|
||||
#On hppa2.0w-hp-hpux11.00, gdb finishes at one line earlier than
|
||||
#hppa1.1-hp-hpux11.00. Therefore, an extra "step" is necessary to continue the test.
|
||||
send_gdb "step\n"
|
||||
exp_continue
|
||||
}
|
||||
-re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
|
||||
-re ".*\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
|
||||
pass "finish from indirectly called function"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
@ -922,7 +990,8 @@ proc test_stepping_over_trampolines { } {
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "main .* at.*$gdb_prompt $" {
|
||||
pass "stepping back to main from function called with trampolines" ;
|
||||
pass "stepping back to main from function called with trampolines" ;
|
||||
gdb_suppress_tests
|
||||
}
|
||||
-re "\}.*End of call_with_trampolines.*$gdb_prompt $" {
|
||||
send_gdb "step\n"
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
@ -28,6 +30,7 @@ main ()
|
||||
else
|
||||
write (1, &x, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -105,7 +105,14 @@ if ![file exists $binfile] then {
|
||||
fail "child died when we called func1, skipped rest of tests"
|
||||
return
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "call function when asleep (wrong output)" }
|
||||
-re "$gdb_prompt $" {
|
||||
# On HPUX-11.0 'send "p func1 ()"' above
|
||||
# terminates the program. A defect is pending on this
|
||||
# issue [defect #DTS CHFts24203]. Hence calling setup_xfail
|
||||
# below.
|
||||
setup_xfail "hppa*-*-*11*"
|
||||
fail "call function when asleep (wrong output)"
|
||||
}
|
||||
default {
|
||||
|
||||
# This fail probably happens whenever we use /proc (we
|
||||
@ -114,7 +121,6 @@ if ![file exists $binfile] then {
|
||||
|
||||
setup_xfail "sparc*-*-solaris2*"
|
||||
setup_xfail "mips-*-ultrix*"
|
||||
setup_xfail "hppa*-*-*"
|
||||
setup_xfail "i386*-*-bsd*"
|
||||
setup_xfail "i*86-*-solaris2*"
|
||||
setup_xfail "*-*-sysv4*"
|
||||
@ -154,6 +160,9 @@ if ![file exists $binfile] then {
|
||||
# The optional leading \r\n is in case we sent a newline above
|
||||
# to wake the program, in which case the program now sends it
|
||||
# back.
|
||||
# FIXME: The pattern below leads to an expected success on HPUX-11.0
|
||||
# but the success is spurious. Need to provide the right reg.expr.
|
||||
# here.
|
||||
gdb_expect {
|
||||
-re "^(\r\n|)data\r\n(|data\r\n)$" { pass "echo data" }
|
||||
timeout { fail "echo data (timeout)" }
|
||||
|
@ -2,18 +2,23 @@
|
||||
particularly deep about the functionality nor names in here.
|
||||
*/
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
static int square (int x)
|
||||
#else
|
||||
static int square (x)
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
return x*x;
|
||||
}
|
||||
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
int i = 99;
|
||||
|
||||
i++;
|
||||
i = square (i);
|
||||
i--;
|
||||
return 0;
|
||||
}
|
||||
|
@ -56,10 +56,10 @@ if ![runto_main] then {
|
||||
# Set a breakpoint on the statement that we're about to jump to.
|
||||
# The statement doesn't contain a function call.
|
||||
#
|
||||
send_gdb "break 18\n"
|
||||
send_gdb "break 22\n"
|
||||
set bp_on_non_call 0
|
||||
gdb_expect {
|
||||
-re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 18.*$gdb_prompt $"\
|
||||
-re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 22.*$gdb_prompt $"\
|
||||
{set bp_on_non_call $expect_out(1,string)
|
||||
pass "break before jump to non-call"}
|
||||
-re "$gdb_prompt $"\
|
||||
@ -69,9 +69,9 @@ gdb_expect {
|
||||
|
||||
# Can we jump to the statement? Do we stop there?
|
||||
#
|
||||
send_gdb "jump 18\n"
|
||||
send_gdb "jump 22\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:18.*$gdb_prompt $"\
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:22.*$gdb_prompt $"\
|
||||
{pass "jump to non-call"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump to non-call"}
|
||||
@ -81,10 +81,10 @@ gdb_expect {
|
||||
# Set a breakpoint on the statement that we're about to jump to.
|
||||
# The statement does contain a function call.
|
||||
#
|
||||
send_gdb "break 17\n"
|
||||
send_gdb "break 21\n"
|
||||
set bp_on_call 0
|
||||
gdb_expect {
|
||||
-re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 17.*$gdb_prompt $"\
|
||||
-re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 21.*$gdb_prompt $"\
|
||||
{set bp_on_call $expect_out(1,string)
|
||||
pass "break before jump to call"}
|
||||
-re "$gdb_prompt $"\
|
||||
@ -94,9 +94,9 @@ gdb_expect {
|
||||
|
||||
# Can we jump to the statement? Do we stop there?
|
||||
#
|
||||
send_gdb "jump 17\n"
|
||||
send_gdb "jump 21\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:17.*$gdb_prompt $"\
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:21.*$gdb_prompt $"\
|
||||
{pass "jump to call"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump to call"}
|
||||
@ -114,9 +114,9 @@ gdb_expect {
|
||||
timeout {fail "(timeout) disable breakpoint on call"}
|
||||
}
|
||||
|
||||
send_gdb "jump 17\n"
|
||||
send_gdb "jump 21\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:18.*$gdb_prompt $"\
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:22.*$gdb_prompt $"\
|
||||
{pass "jump to call with disabled breakpoint"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump to call with disabled breakpoint"}
|
||||
@ -138,7 +138,7 @@ gdb_expect {
|
||||
# Verify that GDB responds gracefully to the "jump" command with
|
||||
# trailing junk.
|
||||
#
|
||||
send_gdb "jump 17 100\n"
|
||||
send_gdb "jump 21 100\n"
|
||||
gdb_expect {
|
||||
-re "Junk at end of line specification: 100.*$gdb_prompt $"\
|
||||
{pass "jump with trailing argument junk"}
|
||||
@ -154,9 +154,9 @@ gdb_expect {
|
||||
#
|
||||
# Try it both ways: confirming and not confirming the jump.
|
||||
#
|
||||
send_gdb "jump 8\n"
|
||||
send_gdb "jump 12\n"
|
||||
gdb_expect {
|
||||
-re "Line 8 is not in `main'. Jump anyway.*y or n. $"\
|
||||
-re "Line 12 is not in `main'. Jump anyway.*y or n. $"\
|
||||
{send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re "Not confirmed.*$gdb_prompt $"\
|
||||
@ -171,9 +171,9 @@ gdb_expect {
|
||||
timeout {fail "(timeout) aborted jump out of current function"}
|
||||
}
|
||||
|
||||
send_gdb "jump 8\n"
|
||||
send_gdb "jump 12\n"
|
||||
gdb_expect {
|
||||
-re "Line 8 is not in `main'. Jump anyway.*y or n. $"\
|
||||
-re "Line 12 is not in `main'. Jump anyway.*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "Continuing at.*$gdb_prompt $"\
|
||||
|
@ -49,6 +49,8 @@ if { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} execut
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout 10
|
||||
|
||||
|
||||
|
||||
@ -63,12 +65,31 @@ gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load $binfile
|
||||
|
||||
gdb_test "b langs0" {Function "langs0" not defined\.} \
|
||||
gdb_test "b langs0" "Function \"langs0\" not defined\.|Breakpoint .* (deferred).*" \
|
||||
"break on nonexistent function in langs.exp"
|
||||
|
||||
if {$hp_aCC_compiler} {
|
||||
set isfixed 1
|
||||
set lang c\\+\\+
|
||||
set ext cxx
|
||||
set foo_func foo__Fi__Fi
|
||||
set do_func do::langs0
|
||||
} else {
|
||||
if {$hp_cc_compiler} {
|
||||
set isfixed 1
|
||||
set lang c
|
||||
set ext c
|
||||
} else {
|
||||
set isfixed 0
|
||||
}
|
||||
set foo_func foo__Fi
|
||||
set do_func langs0__2do
|
||||
}
|
||||
|
||||
if [runto csub] then {
|
||||
|
||||
gdb_test "show language" "currently c\".*" \
|
||||
if { !$isfixed } { set lang c }
|
||||
gdb_test "show language" "currently $lang\".*" \
|
||||
"show language at csub in langs.exp"
|
||||
# On some machines, foo doesn't get demangled because the N_SOL for
|
||||
# langs2.cxx is seen only after the function stab for foo. So
|
||||
@ -76,36 +97,41 @@ if [runto csub] then {
|
||||
# even though only the latter is correct. I haven't tried to xfail it
|
||||
# because it depends on details of the compiler.
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
gdb_test "bt" "#0.*csub.*#1.*(foo|foo__Fi) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*langs0__2do \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
|
||||
# Take out xfail. This test has been passing for some time now.
|
||||
#if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
gdb_test "bt" "#0.*csub.*#1.*(foo|$foo_func) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*$do_func \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
|
||||
|
||||
if { !$isfixed } { set lang c\\+\\+; set ext cxx }
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \
|
||||
gdb_test "up" ".* in (foo|$foo_func).* at langs2\\.$ext.*return csub \\(.*" \
|
||||
"up to foo in langs.exp"
|
||||
gdb_test "show language" "currently c\\+\\+.*" \
|
||||
gdb_test "show language" "currently $lang.*" \
|
||||
"show language at foo in langs.exp"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \
|
||||
gdb_test "up" ".* in cppsub_ .* at langs2\\.$ext.*return foo \\(.*" \
|
||||
"up to cppsub_ in langs.exp"
|
||||
gdb_test "show language" "currently c\\+\\+.*" \
|
||||
gdb_test "show language" "currently $lang.*" \
|
||||
"show language at cppsub_ in langs.exp"
|
||||
|
||||
if { !$isfixed } { set lang fortran }
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \
|
||||
gdb_test "up" ".* in fsub.* at langs1\\.f.*" \
|
||||
"up to fsub in langs.exp"
|
||||
gdb_test "show language" "currently fortran.*" \
|
||||
gdb_test "show language" "currently $lang.*" \
|
||||
"show language at fsub in langs.exp"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
gdb_test "up" ".* in langs0__2do .* at .*langs0\\.c.*return fsub.*" \
|
||||
# Take out xfail. This test has been passing for sometime now.
|
||||
#if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if { !$isfixed } { set lang c }
|
||||
gdb_test "up" ".* in $do_func .* at .*langs0\\.c.*return fsub.*" \
|
||||
"up to langs0__2do in langs.exp"
|
||||
gdb_test "show language" "currently c\".*" \
|
||||
gdb_test "show language" "currently $lang\".*" \
|
||||
"show language at langs0__2do in langs.exp"
|
||||
|
||||
gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \
|
||||
"up to main in langs.exp"
|
||||
gdb_test "show language" "currently c\".*" \
|
||||
gdb_test "show language" "currently $lang\".*" \
|
||||
"show language at main in langs.exp"
|
||||
|
||||
if [target_info exists gdb,noresults] { return }
|
||||
@ -119,4 +145,5 @@ if [runto csub] then {
|
||||
}
|
||||
}
|
||||
|
||||
set timeout $oldtimeout
|
||||
return 0
|
||||
|
@ -1,8 +1,14 @@
|
||||
/* This file is actually in C, it is not supposed to simulate something
|
||||
translated from another language or anything like that. */
|
||||
#ifdef PROTOTYPES
|
||||
extern int fsub_();
|
||||
|
||||
int csub (int x)
|
||||
#else
|
||||
int
|
||||
csub (x)
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
return x + 1;
|
||||
}
|
||||
|
@ -16,14 +16,22 @@ static integer c__10000 = 10000;
|
||||
|
||||
/* I am not sure whether there is a way to have a fortran program without */
|
||||
/* a MAIN, but it does not really harm us to have one. */
|
||||
#ifdef PROTOTYPES
|
||||
/* Main program */ void MAIN__()
|
||||
#else
|
||||
/* Main program */ MAIN__()
|
||||
#endif
|
||||
{
|
||||
} /* MAIN__ */
|
||||
|
||||
#line 4 "langs1.f"
|
||||
/* Subroutine */ int fsub_()
|
||||
{
|
||||
#ifdef PROTOTYPES
|
||||
extern integer cppsub_(int*);
|
||||
#else
|
||||
extern integer cppsub_();
|
||||
#endif
|
||||
|
||||
#line 5 "langs1.f"
|
||||
#line 6 "langs1.f"
|
||||
|
@ -1,4 +1,20 @@
|
||||
/* This is intended to be a vague simulation of cfront output. */
|
||||
#ifdef PROTOTYPES
|
||||
#line 1 "langs2.cxx"
|
||||
extern int csub (int);
|
||||
int
|
||||
foo__Fi (int x)
|
||||
{
|
||||
return csub (x / 2);
|
||||
}
|
||||
|
||||
extern int cppsub_ (int *y);
|
||||
int
|
||||
cppsub_ (int * y)
|
||||
{
|
||||
return foo__Fi (*y);
|
||||
}
|
||||
#else
|
||||
#line 1 "langs2.cxx"
|
||||
extern int csub ();
|
||||
int
|
||||
@ -13,3 +29,4 @@ cppsub_ (y) int *y;
|
||||
{
|
||||
return foo__Fi (*y);
|
||||
}
|
||||
#endif
|
||||
|
@ -84,6 +84,8 @@ proc set_listsize { arg } {
|
||||
|
||||
proc test_listsize {} {
|
||||
global gdb_prompt
|
||||
global hp_cc_compiler
|
||||
global hp_aCC_compiler
|
||||
|
||||
# Show default size
|
||||
|
||||
@ -101,10 +103,10 @@ proc test_listsize {} {
|
||||
|
||||
# Ensure we can limit printouts to one line
|
||||
|
||||
if [ set_listsize 1 ] then {
|
||||
setup_xfail "*-*-*"
|
||||
if [set_listsize 1] {
|
||||
if {!$hp_cc_compiler && !$hp_aCC_compiler} { setup_xfail "*-*-*" }
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 1"
|
||||
setup_xfail "*-*-*"
|
||||
if {!$hp_cc_compiler && !$hp_aCC_compiler} { setup_xfail "*-*-*" }
|
||||
gdb_test "list 2" "2\[ \t\]+" "list line 2 with listsize 1"
|
||||
}
|
||||
|
||||
@ -113,7 +115,7 @@ proc test_listsize {} {
|
||||
if [ set_listsize 2 ] {
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 2"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2"
|
||||
gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+" "list line 3 with listsize 2"
|
||||
gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+" "list line 3 with listsize 2"
|
||||
}
|
||||
|
||||
# Try small listsize > 1 that is an odd number
|
||||
@ -121,18 +123,18 @@ proc test_listsize {} {
|
||||
if [ set_listsize 3 ] {
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"2\[ \t\]+" "list line 1 with listsize 3"
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+main \[)(\]+" "list line 2 with listsize 3"
|
||||
if {!$hp_cc_compiler && !$hp_aCC_compiler} { setup_xfail "*-*-*" }
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 3"
|
||||
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3"
|
||||
if {!$hp_cc_compiler && !$hp_aCC_compiler} { setup_xfail "*-*-*" }
|
||||
gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3"
|
||||
}
|
||||
|
||||
# Try small listsize > 2 that is an even number.
|
||||
|
||||
if [ set_listsize 4 ] then {
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 4"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+main \[)(\]+" "list line 2 with listsize 4"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 4"
|
||||
|
||||
gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4"
|
||||
gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4"
|
||||
@ -141,9 +143,9 @@ proc test_listsize {} {
|
||||
# Try a size larger than the entire file.
|
||||
|
||||
if [ set_listsize 100 ] then {
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n42\[ \t\]+\}" "list line 1 with listsize 100"
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n4\[23\]\[ \t\]+\}" "list line 1 with listsize 100"
|
||||
|
||||
gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n42\[ \t\]+\}" "list line 10 with listsize 100"
|
||||
gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n4\[23\]\[ \t\]+\}" "list line 10 with listsize 100"
|
||||
}
|
||||
|
||||
# Try listsize of 0 which suppresses printing.
|
||||
@ -168,12 +170,12 @@ proc test_list_include_file {} {
|
||||
setup_xfail "a29k-*-udi"
|
||||
setup_xfail_format "DWARF 1"
|
||||
setup_xfail_format "COFF"
|
||||
gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*5\[ \t\]+foo \[(\]+x\[)\]+" "list line 1 in include file"
|
||||
gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*4\[ \t\]+.*foo \(.*x.*\).*" "list line 1 in include file"
|
||||
|
||||
setup_xfail "a29k-*-udi"
|
||||
setup_xfail_format "DWARF 1"
|
||||
setup_xfail_format "COFF"
|
||||
gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 36 lines." "list message for lines past EOF"
|
||||
gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 3\[67\] lines." "list message for lines past EOF"
|
||||
}
|
||||
|
||||
#
|
||||
@ -203,7 +205,7 @@ proc test_list_filename_and_number {} {
|
||||
}
|
||||
send_gdb "list list1.c:1\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
|
||||
-re "1\[ \t\]+\#include.*4\[ \t\]+.*int oof\[ \t\]*\(.*\);\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:1" ; gdb_suppress_tests }
|
||||
@ -211,7 +213,7 @@ proc test_list_filename_and_number {} {
|
||||
}
|
||||
send_gdb "list list1.c:12\n"
|
||||
gdb_expect {
|
||||
-re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
-re "12\[ \t\]+long_line \[(\]+.*\[)\]+;.*13\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:12" ; gdb_suppress_tests }
|
||||
@ -237,7 +239,7 @@ proc test_list_function {} {
|
||||
|
||||
# Ultrix gdb takes the second case below; it's also correct.
|
||||
# SunPRO cc is the third case.
|
||||
gdb_test "list bar" "(1\[ \t\]+void.*7\[ \t\]*long_line ..;.*9\[ \t\]*|1\[ \t\]+void.*8\[ \t\]+\}|1\[ \t\]+void.*7\[ \t\]*long_line ..;)" "list function in source file 2"
|
||||
gdb_test "list bar" "(4\[ \t\]+void.*\[ \t\]*long_line.*;.*bar.*9\[ \t\]*.*|1\[ \t\]+void.*8\[ \t\]+\}|1\[ \t\]+void.*7\[ \t\]*long_line ..;|7\[ \t\]+void.*14\[ \t\]+\})" "list function in source file 2"
|
||||
|
||||
# Test "list function" for C include file
|
||||
# Ultrix gdb is the second case, still correct.
|
||||
@ -275,7 +277,7 @@ proc test_list_forward {} {
|
||||
|
||||
send_gdb "list\n"
|
||||
gdb_expect {
|
||||
-re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re "35\[ \t\]+foo \\(.*\\);.*42\[ \t\]+.*\}\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 35-42" ; gdb_suppress_tests }
|
||||
timeout { fail "list 35-42 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
@ -291,7 +293,7 @@ proc test_list_backwards {} {
|
||||
|
||||
send_gdb "list list0.c:33\n"
|
||||
gdb_expect {
|
||||
-re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re "28\[ \t\]+foo \\(.*\\);.*37\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list list0.c:33" ; gdb_suppress_tests }
|
||||
timeout { fail "list list0.c:33 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
@ -328,17 +330,17 @@ proc test_list_backwards {} {
|
||||
proc test_list_range {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "list list0.c:2,list0.c:5" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+.*5\[ \t\]+int x;" "list range; filename:line1,filename:line2"
|
||||
gdb_test "list list0.c:2,list0.c:5" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+.*5\[ \t\]+int x;" "list range; filename:line1,filename:line2"
|
||||
|
||||
gdb_test "list 2,5" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+.*5\[ \t\]+int x;" "list range; line1,line2"
|
||||
gdb_test "list 2,5" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+.*5\[ \t\]+int x;" "list range; line1,line2"
|
||||
|
||||
# gdb_test "list -1,6" "Line number 0 out of range; .*list0.c has 39 lines." "list range; lower bound negative"
|
||||
|
||||
# gdb_test "list -100,-40" "Line number -60 out of range; .*list0.c has 39 lines." "list range; both bounds negative"
|
||||
|
||||
gdb_test "list 30,43" "30\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}" "list range; upper bound past EOF"
|
||||
gdb_test "list 30,45" "30\[ \t\]+foo \(.*\);.*43\[ \t\]+\}" "list range; upper bound past EOF"
|
||||
|
||||
gdb_test "list 43,100" "Line number 43 out of range; .*list0.c has 42 lines." "list range; both bounds past EOF"
|
||||
gdb_test "list 45,100" "Line number 45 out of range; .*list0.c has 43 lines." "list range; both bounds past EOF"
|
||||
|
||||
gdb_test "list list0.c:2,list1.c:17" "Specified start and end are in different files." "list range, must be same files"
|
||||
}
|
||||
@ -375,7 +377,7 @@ proc test_list_filename_and_function {} {
|
||||
setup_xfail "rs6000-*-aix*"
|
||||
send_gdb "list list0.c:unused\n"
|
||||
gdb_expect {
|
||||
-re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
-re "40\[ \t\]+unused.*43\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "37.*42\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
@ -417,13 +419,13 @@ proc test_list_filename_and_function {} {
|
||||
# a29k-amd-udi is the third case.
|
||||
send_gdb "list list1.c:bar\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
-re "4\[ \t\]+void.*13\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "1\[ \t\]+void.*7\[ \t\]*long_line ..;\r\n$gdb_prompt $" {
|
||||
-re "4\[ \t\]+void.*12\[ \t\]*long_line ..;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "1\[ \t\]+void.*9\[ \t\]*\r\n$gdb_prompt $" {
|
||||
-re "4\[ \t\]+void.*11\[ \t\]*\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:bar" }
|
||||
@ -437,10 +439,10 @@ proc test_list_filename_and_function {} {
|
||||
setup_xfail "rs6000-*-aix*"
|
||||
send_gdb "list list1.c:unused\n"
|
||||
gdb_expect {
|
||||
-re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
-re "12\[ \t\]+long_line \[(\]\[)\];.*13\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "9.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
-re "14.*19\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:unused" }
|
||||
@ -463,10 +465,10 @@ proc test_list_filename_and_function {} {
|
||||
|
||||
gdb_test "list list0.c:foo" "Function \"foo\" not defined in .*list0.c" "list filename:function; wrong filename rejected"
|
||||
|
||||
gdb_test "list foobar.c:main" "No source file named foobar.c." "list filename:function; nonexistant file"
|
||||
gdb_test "list foobar.c:main" "No source file named foobar.c.|Location not found" "list filename:function; nonexistant file"
|
||||
|
||||
setup_xfail_format "DWARF 1"
|
||||
gdb_test "list list0.h:foobar" "Function \"foobar\" not defined." "list filename:function; nonexistant function"
|
||||
gdb_test "list list0.h:foobar" "Function \"foobar\" not defined.|Location not found" "list filename:function; nonexistant function"
|
||||
|
||||
}
|
||||
|
||||
@ -478,11 +480,11 @@ proc test_forward_search {} {
|
||||
# lines 20-23. This depends on whether the line number of a function
|
||||
# is considered to be the openbrace or the first statement--either one
|
||||
# is acceptable.
|
||||
gdb_test "list long_line" "20\[ \t\]+long_line .*"
|
||||
gdb_test "list long_line" "24\[ \t\]+long_line .*"
|
||||
|
||||
gdb_test "search 4321" " not found"
|
||||
|
||||
gdb_test "search 6789" "24\[ \t\]+oof .6789.;"
|
||||
gdb_test "search 6789" "28\[ \t\]+oof .6789.;"
|
||||
|
||||
# Test that GDB won't crash if the line being searched is extremely long.
|
||||
|
||||
@ -519,3 +521,5 @@ if [ set_listsize 10 ] then {
|
||||
test_list_filename_and_function
|
||||
test_forward_search
|
||||
}
|
||||
|
||||
remote_exec build "rm -f list0.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "list0.h"
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
int x;
|
||||
#ifdef usestubs
|
||||
@ -33,6 +33,7 @@ main ()
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
File diff suppressed because one or more lines are too long
@ -44,7 +44,9 @@ 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."
|
||||
}
|
||||
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
@ -102,7 +104,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
@ -113,7 +115,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
@ -122,7 +124,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !x\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x>y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y" }
|
||||
@ -133,7 +135,7 @@ gdb_test "set variable y=1" "" "set variable y=1"
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
@ -144,7 +146,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
@ -155,7 +157,7 @@ gdb_test "set variable x=1" "" "set variable x=1"
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
@ -166,7 +168,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
@ -175,7 +177,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !x\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x>y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y" }
|
||||
@ -186,7 +188,7 @@ gdb_test "set variable y=0" "" "set variable y=0"
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
@ -197,7 +199,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
@ -216,7 +218,7 @@ gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (000)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (000) " }
|
||||
@ -225,7 +227,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (000)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (000)" }
|
||||
@ -234,7 +236,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !!x\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of !!x (0)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !!x (0)" }
|
||||
@ -246,7 +248,7 @@ gdb_test "set variable y=1" "" "set variable y=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (010)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (010) " }
|
||||
@ -255,7 +257,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (010)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (010)" }
|
||||
@ -267,7 +269,7 @@ gdb_test "set variable z=1" "" "set variable z=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (011)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (011) " }
|
||||
@ -276,7 +278,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (011)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (011)" }
|
||||
@ -288,7 +290,7 @@ gdb_test "set variable x=1" "" "set variable x=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (111)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (111) " }
|
||||
@ -297,7 +299,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (111)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (111)" }
|
||||
@ -306,7 +308,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !!x\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of !!x (1)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !!x (1)" }
|
||||
@ -318,7 +320,7 @@ gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (110)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (110) " }
|
||||
@ -327,7 +329,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (110)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (110)" }
|
||||
@ -341,7 +343,7 @@ gdb_test "set variable y=0" "" "set variable y=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (100)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (100) " }
|
||||
@ -350,7 +352,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (100)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (100)" }
|
||||
@ -364,7 +366,7 @@ gdb_test "set variable z=1" "" "set variable z=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (101)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (101) " }
|
||||
@ -373,7 +375,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (101)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (101)" }
|
||||
@ -385,7 +387,7 @@ gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (001)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (001) " }
|
||||
@ -394,7 +396,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (001)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (001)" }
|
||||
@ -409,7 +411,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of !x && y (00)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x && y (00)" }
|
||||
@ -422,7 +424,7 @@ gdb_test "set variable x=1" "" "set variable x=1"
|
||||
|
||||
send_gdb "print !x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of !x && y (10)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x && y (10)" }
|
||||
@ -436,7 +438,7 @@ gdb_test "set variable y=1" "" "set variable y=1"
|
||||
|
||||
send_gdb "print !x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of !x || y (11)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x || y (11)" }
|
||||
@ -449,7 +451,7 @@ gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
send_gdb "print !x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of !x || y (01)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x || y (01)" }
|
||||
@ -463,7 +465,7 @@ gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x || y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y && z (110)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y && z (110)" }
|
||||
@ -476,7 +478,7 @@ gdb_test "set variable y=0" "" "set variable y=0"
|
||||
|
||||
send_gdb "print x || y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || y && z (100)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y && z (100)" }
|
||||
@ -489,12 +491,12 @@ gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
send_gdb "print x || !y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
send_gdb "print x || !y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x || !y && z "
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || !y && z" }
|
||||
@ -517,7 +519,7 @@ gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
send_gdb "print x > y || w == z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x > y || w == z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x > y || w == z" }
|
||||
@ -533,7 +535,7 @@ gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
send_gdb "print x >= y && w != z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x >= y || w != z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x >= y || w != z" }
|
||||
@ -550,7 +552,7 @@ gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
send_gdb "print ! x > y || w + z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x > y || w != z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x > y || w != z" }
|
||||
|
@ -7,8 +7,12 @@
|
||||
* cc +e +DA2.0 -g -o long_long long_long.c
|
||||
*/
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
long long callee(long long i)
|
||||
#else
|
||||
long long callee( i )
|
||||
long long i;
|
||||
#endif
|
||||
{
|
||||
register long long result;
|
||||
|
||||
@ -32,6 +36,8 @@ int known_types()
|
||||
/* Stop here and look!
|
||||
*/
|
||||
hex = bin - dec | oct;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
@ -35,20 +35,14 @@ if [get_compiler_info ${binfile}] {
|
||||
return -1
|
||||
}
|
||||
|
||||
if {$gcc_compiled == 0} {
|
||||
if [istarget "hppa*-hp-hpux*"] then {
|
||||
### FIXME +e only works with HP's compiler
|
||||
set additional_flags "additional_flags=+e -w"
|
||||
} else {
|
||||
# don't know what the compiler is, hope it supports long long!
|
||||
set additional_flags "additional_flags=-w"
|
||||
}
|
||||
if {$hp_cc_compiler} {
|
||||
set flag "+e"
|
||||
} else {
|
||||
set additional_flags "additional_flags=-w"
|
||||
set flag ""
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
if { [gdb_compile "${srcfile}" "${binfile}" executable [concat debug "additional_flags=$flag -w"]] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
# use this to debug:
|
||||
@ -64,35 +58,40 @@ if { ![runto known_types] } then {
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "n 4" ".*34.*" "get to known place"
|
||||
gdb_test "n 4" ".*38.*" "get to known place"
|
||||
|
||||
# Check the hack for long long prints.
|
||||
#
|
||||
gdb_test "p/x hex" ".*0x0.*" "default print hex"
|
||||
gdb_test "p/x dec" ".*0xab54a98ceb1f0ad2.*" "default print dec"
|
||||
gdb_test "p/x bin" ".*0x123456789abcdef.*" "default print bin"
|
||||
gdb_test "p/x oct" ".*0xa72ee53977053977.*" "default print oct"
|
||||
gdb_test "p/x hex" ".*0x0*0.*" "hex print p/x"
|
||||
gdb_test "p/x dec" ".*0xab54a98ceb1f0ad2.*" "decimal print p/x"
|
||||
# see if 'p/<code>' is handled same as 'p /<code>'
|
||||
#
|
||||
gdb_test "p /x dec" ".*0xab54a98ceb1f0ad2.*" "default print dec"
|
||||
gdb_test "p /x bin" ".*0x0*123456789abcdef.*" "default print bin"
|
||||
gdb_test "p /x oct" ".*0xa72ee53977053977.*" "default print oct"
|
||||
gdb_test "p hex" ".*= 0*x*0*0.*" "default print hex"
|
||||
|
||||
gdb_test "p/x hex" ".*0x0.*" "hex print"
|
||||
gdb_test "p/u dec" ".*12345678901234567890.*" "decimal print"
|
||||
gdb_test "p/t bin" ".*100100011010001010110011110001001101010111100110111101111.*" "binary print"
|
||||
gdb_test "p/u dec" ".*12345678901234567890.*" "decimal print p/u"
|
||||
gdb_test "p/t bin" ".*0*100100011010001010110011110001001101010111100110111101111.*" "binary print"
|
||||
gdb_test "p/o oct" ".*01234567123456701234567.*" "octal print"
|
||||
gdb_test "p /d bin" ".*81985529216486895.*" "print +ve long long"
|
||||
gdb_test "p/d dec" ".*-6101065172474983726.*" "decimal print p/d"
|
||||
|
||||
# Try all the combinations to bump up coverage.
|
||||
#
|
||||
gdb_test "p/d oct" ".*12046818088235383159.*" ""
|
||||
gdb_test "p/u oct" ".*0xa72ee53977053977.*" ""
|
||||
gdb_test "p/u oct" ".*12046818088235383159.*" ""
|
||||
gdb_test "p/o oct" ".*.*" ""
|
||||
gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*" ""
|
||||
gdb_test "p/a oct" ".*That operation is not available.*" ""
|
||||
gdb_test "p/c oct" ".*0xa72ee53977053977.*" ""
|
||||
gdb_test "p/a oct" ".*0x.*77053977.*" ""
|
||||
gdb_test "p/c oct" ".*'w'.*" ""
|
||||
gdb_test "p/f oct" ".*-5.9822653797615723e-120.*" ""
|
||||
|
||||
gdb_test "p/d *(int *)&oct" ".*-1490098887.*" ""
|
||||
gdb_test "p/u *(int *)&oct" ".*2804868409.*" ""
|
||||
gdb_test "p/o *(int *)&oct" ".*024713562471.*" ""
|
||||
gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*" ""
|
||||
gdb_test "p/a *(int *)&oct" ".*0xa72ee539.*" ""
|
||||
gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*" ""
|
||||
gdb_test "p/c *(int *)&oct" ".*57 '9'.*" ""
|
||||
gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*" ""
|
||||
|
||||
@ -100,9 +99,9 @@ gdb_test "p/d *(short *)&oct" ".*-22738.*" ""
|
||||
gdb_test "p/u *(short *)&oct" ".*42798.*" ""
|
||||
gdb_test "p/o *(short *)&oct" ".*0123456.*" ""
|
||||
gdb_test "p/t *(short *)&oct" ".*1010011100101110.*" ""
|
||||
gdb_test "p/a *(short *)&oct" ".*0xffffa72e.*" ""
|
||||
gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" ""
|
||||
gdb_test "p/c *(short *)&oct" ".* 46 '.'.*" ""
|
||||
gdb_test "p/a **short *)&oct" ".*0xffffa72e <.*" ""
|
||||
gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" ""
|
||||
gdb_test "p/f *(short *)&oct" ".*-22738.*" ""
|
||||
|
||||
gdb_test "x/x &oct" ".*0xa72ee539.*" ""
|
||||
@ -110,8 +109,8 @@ gdb_test "x/d &oct" ".*.-1490098887*" ""
|
||||
gdb_test "x/u &oct" ".*2804868409.*" ""
|
||||
gdb_test "x/o &oct" ".*024713562471.*" ""
|
||||
gdb_test "x/t &oct" ".*10100111001011101110010100111001.*" ""
|
||||
gdb_test "x/a &oct" ".*0xa72ee539 <.*" ""
|
||||
gdb_test "x/c &oct" ".*-89 'M-''.*" ""
|
||||
gdb_test "x/a &oct" ".*0xa72ee539.*" ""
|
||||
gdb_test "x/c &oct" ".*-89 '\\\\247'.*" ""
|
||||
gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*" ""
|
||||
|
||||
gdb_test "x/2x &oct" ".*.*" ""
|
||||
|
@ -1,15 +1,25 @@
|
||||
/* Tests regarding examination of prologues. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
inner (int z)
|
||||
#else
|
||||
int
|
||||
inner (z)
|
||||
int z;
|
||||
#endif
|
||||
{
|
||||
return 2 * z;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
middle (int x)
|
||||
#else
|
||||
int
|
||||
middle (x)
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
if (x == 0)
|
||||
return inner (5);
|
||||
@ -17,15 +27,27 @@ middle (x)
|
||||
return inner (6);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
top (int y)
|
||||
#else
|
||||
int
|
||||
top (y)
|
||||
int y;
|
||||
#endif
|
||||
{
|
||||
return middle (y + 1);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
#else
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
#endif
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
|
@ -55,7 +55,7 @@ gdb_load ${binfile}
|
||||
if [runto middle] then {
|
||||
# PR 3016
|
||||
if {$gcc_compiled} then {
|
||||
setup_xfail "mips*-sgi-irix4*" "mips64*-*-elf"
|
||||
setup_xfail "hppa*-*-*" "mips*-sgi-irix4*" "mips64*-*-elf"
|
||||
}
|
||||
gdb_test "backtrace" "#0.*middle.*#1.*top.*#2.*main.*"
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
@ -90,6 +93,9 @@ gdb_expect {
|
||||
-re ".\[0-9\]* = $hex \"\".*$gdb_prompt $" {
|
||||
pass "print value of &cbig.c\[0\]"
|
||||
}
|
||||
-re ".\[0-9\]* = $hex \"*\".*$gdb_prompt $" {
|
||||
pass "print value of &cbig.c\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &cbig.c\[0\]" }
|
||||
timeout { fail "(timeout) print value of &cbig.c\[0\]" }
|
||||
}
|
||||
@ -158,7 +164,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !ibig.i\[100\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
-re ".\[0-9\]* = $false.*$gdb_prompt $" {
|
||||
pass "print value of !ibig.i\[100\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
|
||||
@ -167,7 +173,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !sbig.s\[90\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
-re ".\[0-9\]* = $false.*$gdb_prompt $" {
|
||||
pass "print value of !sbig.s\[90\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !sbig.s\[90\]" }
|
||||
@ -177,7 +183,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !fbig.f\[100\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
-re ".\[0-9\]* = $false.*$gdb_prompt $" {
|
||||
pass "print value of !ibig.i\[100\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
|
||||
@ -186,7 +192,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !dbig.d\[202\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
-re ".\[0-9\]* = $false.*$gdb_prompt $" {
|
||||
pass "print value of !ibig.i\[100\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
|
||||
@ -224,7 +230,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print !(sbig.s\[90\] * 2)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
-re ".\[0-9\]* = $false.*$gdb_prompt $" {
|
||||
pass "print value of !(sbig.s\[90\] * 2)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !(sbig.s\[90\] * 2)" }
|
||||
@ -252,6 +258,18 @@ gdb_expect {
|
||||
}
|
||||
|
||||
|
||||
if [istarget "hppa2.0w*-*-*"] then {
|
||||
send_gdb "print sizeof(lbig)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 7200.*$gdb_prompt $" {
|
||||
pass "print value of sizeof(lbig)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of sizeof(lbig)" }
|
||||
timeout { fail "(timeout) print value of sizeof(lbig)" }
|
||||
}
|
||||
}
|
||||
|
||||
if ![istarget "hppa2.0w*-*-*"] then {
|
||||
send_gdb "print sizeof(lbig)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 3600.*$gdb_prompt $" {
|
||||
@ -260,6 +278,7 @@ gdb_expect {
|
||||
-re ".*$gdb_prompt $" { fail "print value of sizeof(lbig)" }
|
||||
timeout { fail "(timeout) print value of sizeof(lbig)" }
|
||||
}
|
||||
}
|
||||
|
||||
send_gdb "print ibig.i\[100\] << 2\n"
|
||||
gdb_expect {
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
/* Test that things still (sort of) work when compiled without -g. */
|
||||
|
||||
int dataglobal = 3; /* Should go in global data */
|
||||
@ -5,31 +6,51 @@ static int datalocal = 4; /* Should go in local data */
|
||||
int bssglobal; /* Should go in global bss */
|
||||
static int bsslocal; /* Should go in local bss */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
inner (int x)
|
||||
#else
|
||||
int
|
||||
inner (x)
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
return x + dataglobal + datalocal + bssglobal + bsslocal;
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
static short
|
||||
middle (int x)
|
||||
#else
|
||||
static short
|
||||
middle (x)
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
return 2 * inner (x);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
short
|
||||
top (int x)
|
||||
#else
|
||||
short
|
||||
top (x)
|
||||
int x;
|
||||
#endif
|
||||
{
|
||||
return 2 * middle (x);
|
||||
}
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
#else
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
#endif
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
@ -38,14 +59,16 @@ main (argc, argv)
|
||||
return top (argc);
|
||||
}
|
||||
|
||||
char *malloc ();
|
||||
|
||||
int *x;
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
int array_index (char *arr, int i)
|
||||
#else
|
||||
int
|
||||
array_index (arr, i)
|
||||
char *arr;
|
||||
int i;
|
||||
#endif
|
||||
{
|
||||
/* The basic concept is just "return arr[i];". But call malloc so that gdb
|
||||
will be able to call functions. */
|
||||
|
@ -72,28 +72,28 @@ if [runto inner] then {
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
|
||||
gdb_test "p top" \
|
||||
"{(<(text variable|function), no debug info>|short \\(\\))} \[0-9a-fx]* <top>"
|
||||
"\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <top(\\(int\\)|)>"
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
|
||||
gdb_test "whatis top" \
|
||||
"(<(text variable|function), no debug info>|short \\(\\))"
|
||||
"(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "ptype top" "(short|int) \\((|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
|
||||
gdb_test "ptype top" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
|
||||
setup_xfail "mips-sgi-irix6*"
|
||||
gdb_test "p middle" \
|
||||
"{(<(text variable|function), no debug info>|short \\(\\))} \[0-9a-fx]* <middle>"
|
||||
"\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <middle(\\(int\\)|)>"
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
|
||||
setup_xfail "mips-sgi-irix6*"
|
||||
gdb_test "whatis middle" \
|
||||
"(<(text variable|function), no debug info>|short \\(\\))"
|
||||
"(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
|
||||
setup_xfail "mips-sgi-irix6*"
|
||||
gdb_test "ptype middle" "(short|int) \\((|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
|
||||
gdb_test "ptype middle" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
|
||||
|
||||
gdb_test "p dataglobal" "= 3"
|
||||
gdb_test "whatis dataglobal" \
|
||||
"<(data variable|variable), no debug info>"
|
||||
gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>"
|
||||
"<(data variable|variable), no debug info>|int"
|
||||
gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>|int"
|
||||
|
||||
# The only symbol xcoff puts out for statics is for the TOC entry.
|
||||
# Possible, but hairy, for gdb to deal. Right now it doesn't, it
|
||||
@ -115,8 +115,8 @@ if [runto inner] then {
|
||||
gdb_test "ptype datalocal" "<(data variable|variable), no debug info>"
|
||||
|
||||
gdb_test "p bssglobal" "= 0"
|
||||
gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>"
|
||||
gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>"
|
||||
gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>|int"
|
||||
gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>|int"
|
||||
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
@ -145,12 +145,27 @@ if [runto inner] then {
|
||||
|
||||
# This test is not as obscure as it might look. `p getenv ("TERM")'
|
||||
# is a real-world example, at least on many systems.
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" "mips-sgi-irix6*" }
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "p/c array_index(\"abcdef\",2)"
|
||||
} else {
|
||||
gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
|
||||
#
|
||||
# On HP-UX, a support function (__d_plt_call) necessary to
|
||||
# implement an inferior call is normally only available when
|
||||
# the inferior was compiled with -g. Thus, we expect this
|
||||
# testpoint to fail on HP-UX.
|
||||
if { [istarget "hppa*-hpux*"] } {
|
||||
send_gdb "p/c array_index(\"abcdef\",2)\n"
|
||||
gdb_expect {
|
||||
-re ".*Suggest linking executable with -g.*$gdb_prompt $" { pass "p/c array_index(\"abcdef\",2)" }
|
||||
-re ".*Cannot find __wdb_call_dummy in.*end.o.*" { pass "p/c array_index(\"abcdef\",2)" }
|
||||
-re ".*99 'c'.*" { pass "p/c array_index(\"abcdef\",2)" }
|
||||
timeout { fail "(timeout) p/c array_index" }
|
||||
}
|
||||
} else {
|
||||
gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
|
||||
}
|
||||
}
|
||||
|
||||
# Now, try that we can give names of file-local symbols which happen
|
||||
|
@ -106,7 +106,7 @@ gdb_test "whatis foop" \
|
||||
# Ensure that we know the form of the structure that foop points to.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "hppa*-*-hpux*" }
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (statically)"
|
||||
@ -167,7 +167,7 @@ gdb_test "whatis foop" \
|
||||
# Ensure that we know the form of the thing foop points to.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "hppa*-*-hpux*" }
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (dynamically) 1"
|
||||
@ -181,7 +181,7 @@ gdb_test "whatis afoo" \
|
||||
|
||||
gdb_test "ptype afoo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct instance (dynamically) 1"
|
||||
"ptype on opaque struct instance (dynamically) xyz 1"
|
||||
|
||||
|
||||
# Ensure that we know the form of an explicit struct foo.
|
||||
@ -220,7 +220,29 @@ gdb_test "whatis foop" \
|
||||
# Ensure that we know the form of the thing foop points to.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "hppa*-*-hpux*" }
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (dynamically) 2"
|
||||
|
||||
gdb_test "whatis afoo" \
|
||||
"type = struct foo" \
|
||||
"whatis on opaque struct instance (dynamically) 1"
|
||||
|
||||
|
||||
# Ensure that we know the form of afoo, an instance of a struct foo.
|
||||
|
||||
gdb_test "ptype afoo" \
|
||||
"type = struct foo \{\r\n int a;\r\n int b;\r\n\}" \
|
||||
"ptype on opaque struct instance (dynamically) 1"
|
||||
|
||||
gdb_test "ptype afoo" \
|
||||
"type = struct foo \{\[\r\n\]*.*int a;\[\r\n\]*.*int b;\[\r\n\]*}\[\r\n\]*" \
|
||||
"ptype on opaque struct instance (dynamically) pqr 1"
|
||||
|
||||
|
||||
# Ensure that we know the form of an explicit struct foo.
|
||||
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (dynamically) 2"
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
struct foo *foop;
|
||||
extern struct foo *getfoo ();
|
||||
#ifdef PROTOTYPES
|
||||
extern void putfoo (struct foo *foop);
|
||||
#endif
|
||||
|
||||
int main ()
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ struct foo *getfoo ()
|
||||
return (&afoo);
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
#ifdef PROTOTYPES
|
||||
void putfoo (struct foo *foop)
|
||||
#else
|
||||
void putfoo (foop)
|
||||
|
@ -43,6 +43,9 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
@ -153,7 +156,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int_pointer == v_int_pointer2\n"
|
||||
gdb_expect {
|
||||
-re ".*= 0.*$gdb_prompt $" {
|
||||
-re ".*= $false.*$gdb_prompt $" {
|
||||
pass "pointer1==pointer2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "pointer1==pointer2" }
|
||||
@ -162,7 +165,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int_pointer != v_int_pointer2\n"
|
||||
gdb_expect {
|
||||
-re ".*= 1.*$gdb_prompt $" {
|
||||
-re ".*= $true.*$gdb_prompt $" {
|
||||
pass "pointer1!=pointer2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "pointer1!=pointer2" }
|
||||
@ -172,7 +175,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int_pointer <= v_int_pointer2\n"
|
||||
gdb_expect {
|
||||
-re ".*= 1.*$gdb_prompt $" {
|
||||
-re ".*= $true.*$gdb_prompt $" {
|
||||
pass "pointer1<=pointer2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "pointer1<=pointer2" }
|
||||
@ -182,7 +185,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int_pointer >= v_int_pointer2\n"
|
||||
gdb_expect {
|
||||
-re ".*= 0.*$gdb_prompt $" {
|
||||
-re ".*= $false.*$gdb_prompt $" {
|
||||
pass "pointer1>=pointer2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "pointer1>=pointer2" }
|
||||
@ -192,7 +195,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int_pointer < v_int_pointer2\n"
|
||||
gdb_expect {
|
||||
-re ".*= 1.*$gdb_prompt $" {
|
||||
-re ".*= $true.*$gdb_prompt $" {
|
||||
pass "pointer1<pointer2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "pointer1<pointer2" }
|
||||
@ -201,7 +204,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print v_int_pointer > v_int_pointer2\n"
|
||||
gdb_expect {
|
||||
-re ".*= 0.*$gdb_prompt $" {
|
||||
-re ".*= $false.*$gdb_prompt $" {
|
||||
pass "pointer1>pointer2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "pointer1>pointer2" }
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* This table is used as a source for every ascii character.
|
||||
It is explicitly unsigned to avoid differences due to native characters
|
||||
being either signed or unsigned. */
|
||||
|
||||
#include <stdlib.h>
|
||||
unsigned char ctable1[256] = {
|
||||
0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
|
||||
0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
|
||||
@ -64,7 +64,7 @@ int int2dim[3][4] = {{0,1,2,3},{4,5,6,7},{8,9,10,11}};
|
||||
int int3dim[2][3][2] = {{{0,1},{2,3},{4,5}},{{6,7},{8,9},{10,11}}};
|
||||
int int4dim[1][2][3][2] = {{{{0,1},{2,3},{4,5}},{{6,7},{8,9},{10,11}}}};
|
||||
|
||||
char *teststring = "teststring contents";
|
||||
char *teststring = (char*)"teststring contents";
|
||||
|
||||
/* Test printing of a struct containing character arrays. */
|
||||
|
||||
@ -86,7 +86,7 @@ struct some_arrays *parrays = &arrays;
|
||||
|
||||
/* -- */
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
|
@ -6,6 +6,7 @@
|
||||
/*
|
||||
* First the basic C types.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined (__STDC__) && !defined (_AIX)
|
||||
#define signed /**/
|
||||
@ -213,21 +214,22 @@ enum cars {bmw, porsche} sportscar;
|
||||
|
||||
typedef enum {FALSE, TRUE} boolean;
|
||||
boolean v_boolean;
|
||||
typedef enum bvals {false, true} boolean2;
|
||||
/*note: aCC has bool type predefined with 'false' and 'true'*/
|
||||
typedef enum bvals {my_false, my_true} boolean2;
|
||||
boolean2 v_boolean2;
|
||||
|
||||
enum misordered {two = 2, one = 1, zero = 0, three = 3};
|
||||
|
||||
/* Seems like we need a variable of this type to get the type to be put
|
||||
in the executable, at least for AIX xlc. */
|
||||
enum misordered v_misordered = three;
|
||||
|
||||
/***********/
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
/* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */
|
||||
extern char *malloc();
|
||||
|
||||
/* Seems like we need a variable of this type to get the type to be put
|
||||
in the executable, at least for AIX xlc. */
|
||||
enum misordered v_misordered = three;
|
||||
/* extern char *malloc();*/
|
||||
|
||||
/* Some of the tests in ptype.exp require invoking malloc, so make
|
||||
sure it is linked in to this program. */
|
||||
@ -309,5 +311,6 @@ main ()
|
||||
v_t_struct_p = 0;
|
||||
|
||||
v_boolean = FALSE;
|
||||
v_boolean2 = false;
|
||||
v_boolean2 = my_false;
|
||||
return 0;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then {
|
||||
# IBM's xlc puts out bogus stabs--the stuff field is type 42,
|
||||
# which isn't defined.
|
||||
|
||||
gdb_test "ptype struct link" "type = struct link \{.*\[\r\n\] struct link \[*\]next;.*\[\r\n\] struct link \[*(\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.*\[\r\n\] struct t_struct stuff.1..2..3.;.*\[\r\n\]\}.*" "ptype linked list structure"
|
||||
gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure"
|
||||
|
||||
#
|
||||
# test ptype command with unions
|
||||
@ -103,7 +103,7 @@ gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\] (unsigned |
|
||||
|
||||
# IBM's xlc puts out bogus stabs--the stuff field is type 42,
|
||||
# which isn't defined.
|
||||
gdb_test "ptype union tu_link" "type = union tu_link .*\[\r\n\] struct link \[*\]next;.*\[\r\n\] struct link \[(\*\]+linkfunc\[)(\]+(struct link \[*\], int\[)\]|);.*\[\r\n\] struct t_struct stuff.1..2..3.;.*\[\r\n\]\}.*" "ptype linked list union"
|
||||
gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union"
|
||||
|
||||
#
|
||||
# test ptype command with enums
|
||||
@ -117,7 +117,7 @@ gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "pt
|
||||
#
|
||||
# test ptype command with enums as typedef
|
||||
#
|
||||
gdb_test "ptype boolean" "type = enum \{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
|
||||
gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
|
||||
|
||||
# And check that whatis shows the name, not "enum {...}".
|
||||
# This probably fails for all DWARF 1 cases, so assume so for now. -fnf
|
||||
@ -128,21 +128,23 @@ gdb_test "ptype boolean" "type = enum \{FALSE, TRUE\}.*" "ptype unnamed typedef'
|
||||
# GDB's behavior is correct; the type which the variable is defined
|
||||
# as (51) doesn't have a name. Only 55 has a name.
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
|
||||
if {!$gcc_compiled && !$hp_aCC_compiler} {
|
||||
setup_xfail "rs6000-*-*" "i*86-*-sysv4*" "hppa*-*-*" # CLLbs14773
|
||||
}
|
||||
setup_xfail_format "DWARF 1"
|
||||
gdb_test "whatis v_boolean" "type = boolean" \
|
||||
gdb_test "whatis v_boolean" "type = (enum |)boolean" \
|
||||
"whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
|
||||
|
||||
# Same thing with struct and union.
|
||||
gdb_test "ptype t_struct3" "type = struct \{.*
|
||||
gdb_test "ptype t_struct3" "type = struct (t_struct3 |)\{.*
|
||||
*double v_double_member;.*
|
||||
*int v_int_member;.*\}" "printing typedef'd struct"
|
||||
|
||||
gdb_test "ptype t_union3" "type = union \{.*
|
||||
gdb_test "ptype t_union3" "type = union (t_union3 |)\{.*
|
||||
*double v_double_member;.*
|
||||
*int v_int_member;.*\}" "printing typedef'd union"
|
||||
|
||||
gdb_test "ptype enum bvals" "type = enum bvals \{false, true\}.*" "ptype named typedef'd enumf'd enum"
|
||||
gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype named typedef'd enumf'd enum"
|
||||
|
||||
#
|
||||
# test ptype command with out-of-order enum values
|
||||
@ -365,6 +367,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
|
||||
setup_xfail_format "DWARF 1"
|
||||
if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
|
||||
gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
|
||||
|
||||
#
|
||||
@ -489,21 +492,34 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
|
||||
#
|
||||
# test ptype command with nested structure and union
|
||||
#
|
||||
gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] struct inner_struct inner_struct_instance;.*\[\r\n\] union inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
|
||||
if {$hp_aCC_compiler} {
|
||||
set outer "outer_struct::"
|
||||
set struct ""
|
||||
set union ""
|
||||
} else {
|
||||
set outer ""
|
||||
set struct "struct"
|
||||
set union "union"
|
||||
}
|
||||
gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\]+\
|
||||
.*int outer_int;.*\[\r\n\]+\
|
||||
.*(struct|) ${outer}inner_struct inner_struct_instance;.*\[\r\n\]+\
|
||||
.*(union|) ${outer}inner_union inner_union_instance;.*\[\r\n\]+\
|
||||
.*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
|
||||
|
||||
gdb_test "ptype struct inner_struct" "type = struct inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype inner structure"
|
||||
gdb_test "ptype ${struct} ${outer}inner_struct" "type = struct ${outer}inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype inner structure"
|
||||
|
||||
gdb_test "ptype union inner_union" "type = union inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype inner union"
|
||||
gdb_test "ptype ${union} ${outer}inner_union" "type = union ${outer}inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype inner union"
|
||||
|
||||
gdb_test "ptype nested_su" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] struct inner_struct inner_struct_instance;.*\[\r\n\] union inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure"
|
||||
gdb_test "ptype nested_su" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] (struct |)${outer}inner_struct inner_struct_instance;.*\[\r\n\] (union |)${outer}inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure"
|
||||
|
||||
gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int"
|
||||
|
||||
gdb_test "ptype nested_su.inner_struct_instance" "type = struct inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype nested structure #2"
|
||||
gdb_test "ptype nested_su.inner_struct_instance" "type = struct ${outer}inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype nested structure #2"
|
||||
|
||||
gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int"
|
||||
|
||||
gdb_test "ptype nested_su.inner_union_instance" "type = union inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype nested union"
|
||||
gdb_test "ptype nested_su.inner_union_instance" "type = union ${outer}inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype nested union"
|
||||
|
||||
# Test printing type of string constants and array constants, but
|
||||
# requires a running process. These call malloc, and can take a long
|
||||
|
@ -1,9 +1,14 @@
|
||||
/* Trivial code used to test watchpoints in recursive code and
|
||||
auto-deletion of watchpoints as they go out of scope. */
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
static int
|
||||
recurse (int a)
|
||||
#else
|
||||
static int
|
||||
recurse (a)
|
||||
int a;
|
||||
#endif
|
||||
{
|
||||
int b = 0;
|
||||
|
||||
@ -15,11 +20,12 @@ recurse (a)
|
||||
return b;
|
||||
}
|
||||
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
recurse (10);
|
||||
return 0;
|
||||
}
|
||||
|
@ -42,6 +42,9 @@ 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."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
@ -108,7 +111,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x < y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
@ -117,7 +120,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x <= y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
@ -126,7 +129,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x > y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x>y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y" }
|
||||
@ -135,7 +138,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x >= y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x>=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=y" }
|
||||
@ -144,7 +147,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x == y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x==y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x==y" }
|
||||
@ -153,7 +156,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x != y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x!=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x!=y" }
|
||||
@ -172,7 +175,7 @@ gdb_test "set variable z=2" "" "set variable z"
|
||||
|
||||
send_gdb "print x < y < z\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true.*\r\n$gdb_prompt $" {
|
||||
pass "print value of x<y<z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y<z" }
|
||||
@ -181,7 +184,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x <= y <= z\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of x<=y<=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y<=z" }
|
||||
@ -190,7 +193,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x > y > z\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false.*\r\n$gdb_prompt $" {
|
||||
pass "print value of x>y>z"
|
||||
}
|
||||
-re 8".*$gdb_prompt $" { fail "print value of x>y>z" }
|
||||
@ -199,7 +202,7 @@ gdb_expect {
|
||||
|
||||
send_gdb "print x >= y >= z\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false.*\r\n$gdb_prompt $" {
|
||||
pass "print value of x>=y>=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=y>=z" }
|
||||
@ -213,7 +216,7 @@ gdb_test "set variable z=1" "" "set variable z"
|
||||
|
||||
send_gdb "print x == y == z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x==y==z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x==y==z" }
|
||||
@ -225,7 +228,7 @@ gdb_test "set variable z=0" "" "set variable z"
|
||||
|
||||
send_gdb "print x != y != z\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false\r\n$gdb_prompt $" {
|
||||
pass "print value of x!=y!=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x!=y!=z" }
|
||||
@ -242,7 +245,7 @@ gdb_test "set variable z=2" "" "set variable z"
|
||||
|
||||
send_gdb "print x < y == z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x<y==z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y==z" }
|
||||
@ -252,7 +255,7 @@ gdb_expect {
|
||||
# 0 2 2
|
||||
send_gdb "print x < y != z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<y!=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y!=z" }
|
||||
@ -267,7 +270,7 @@ gdb_test "set variable z=1" "" "set variable z"
|
||||
# 2 3 1
|
||||
send_gdb "print x < y <= z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<y<=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y<=z" }
|
||||
@ -278,7 +281,7 @@ gdb_expect {
|
||||
# 2 3 1
|
||||
send_gdb "print x < y >= z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<y>=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y>=z" }
|
||||
@ -292,7 +295,7 @@ gdb_test "set variable z=0" "" " set variable z"
|
||||
# 2 3 0
|
||||
send_gdb "print x < y > z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x<y>z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y>z" }
|
||||
@ -305,7 +308,7 @@ gdb_test "set variable x=1" "" " set variable x"
|
||||
# 1 3 0
|
||||
send_gdb "print x > y >= z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
-re ".*$true.*$gdb_prompt $" {
|
||||
pass "print value of x>y>=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y>=z" }
|
||||
@ -318,7 +321,7 @@ gdb_test "set variable z=2" "" " set variable z"
|
||||
# 1 3 2
|
||||
send_gdb "print x > y == z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x>y==z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y==z" }
|
||||
@ -332,7 +335,7 @@ gdb_test "set variable z=0" "" " set variable z"
|
||||
# 2 3 0
|
||||
send_gdb "print x > y != z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x>y!=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y!=z" }
|
||||
@ -345,7 +348,7 @@ gdb_test "set variable x=4" "" "set x to 4"
|
||||
# 4 3 0
|
||||
send_gdb "print x > y <= z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
-re ".*$false.*$gdb_prompt $" {
|
||||
pass "print value of x>y<=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y<=z" }
|
||||
@ -355,7 +358,7 @@ gdb_expect {
|
||||
# 4 3 0
|
||||
send_gdb "print x >= y == z\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false\r\n$gdb_prompt $" {
|
||||
pass "print value of x>=y==z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=y==z" }
|
||||
@ -368,7 +371,7 @@ gdb_test "set variable x=2" "" " set variable x"
|
||||
# 2 3 0
|
||||
send_gdb "print x >= y != z\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false\r\n$gdb_prompt $" {
|
||||
pass "print value of x>=y!=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=y!=z" }
|
||||
@ -382,7 +385,7 @@ gdb_test "set variable z=4" "" " set variable z"
|
||||
# 0 3 4
|
||||
send_gdb "print x >= y <= z\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of x>=y<=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=y<=z" }
|
||||
@ -392,7 +395,7 @@ gdb_expect {
|
||||
# 0 3 4
|
||||
send_gdb "print x <= y == z\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false\r\n$gdb_prompt $" {
|
||||
pass "print value of x<=y==z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y==z" }
|
||||
@ -404,7 +407,7 @@ gdb_test "set variable x=2" "" " set variable x"
|
||||
# 2 3 4
|
||||
send_gdb "print x <= y != z\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of x<=y!=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y!=z" }
|
||||
@ -415,7 +418,7 @@ gdb_expect {
|
||||
# 2 3 4
|
||||
send_gdb "print x == y != z\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of x==y!=z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x==y!=z" }
|
||||
@ -432,7 +435,7 @@ gdb_test "set variable z=0" "" " set variable z"
|
||||
# 2 3 0
|
||||
send_gdb "print x >= (y < z)\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of x>=(y<z)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=(y<z)" }
|
||||
@ -443,7 +446,7 @@ gdb_expect {
|
||||
# 2 3 0
|
||||
send_gdb "print x >= (y != z)\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of x>=(y!=z)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>=(y*!=z)" }
|
||||
@ -453,7 +456,7 @@ gdb_expect {
|
||||
# 2 3 0
|
||||
send_gdb "print x == (y == z)\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
-re ".*$false\r\n$gdb_prompt $" {
|
||||
pass "print value of x==(y==z)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x==(y==z)" }
|
||||
@ -467,7 +470,7 @@ gdb_test "set variable z=4" "" " set variable z"
|
||||
# 1 3 4
|
||||
send_gdb "print (x == y) < z\n"
|
||||
gdb_expect {
|
||||
-re ".*1\r\n$gdb_prompt $" {
|
||||
-re ".*$true\r\n$gdb_prompt $" {
|
||||
pass "print value of (x==y)<z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (x==y)<z" }
|
||||
|
@ -248,7 +248,7 @@ driver (void)
|
||||
|
||||
/* generated code ends here */
|
||||
|
||||
main ()
|
||||
int main ()
|
||||
{
|
||||
register int local;
|
||||
#ifdef usestubs
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user