* source.c: #if defined => #ifdef.

* main.c (main):  Only try to attach "corefile" argument if
        it starts with a digit.
This commit is contained in:
John Gilmore 1991-08-14 00:11:20 +00:00
parent 715d2e0649
commit e522fb52bf
3 changed files with 143 additions and 45 deletions

View File

@ -1,6 +1,90 @@
Tue Aug 13 16:17:56 1991 John Gilmore (gnu at cygint.cygnus.com)
* blockframe.c (frameless_look_for_prologue): Speed up by
calling SKIP_PROLOGUE_FRAMELESS_P if it's defined.
* tm-sparc.h (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P):
Define two variants, one faster.
* sparc-tdep.c (sparc_frame_chain): Use target_read_memory
and return zero, rather than giving an error.
(setup_arbitrary_frame): Initialize the PC in the new frame.
(skip_prologue): Add a second arg saying whether we're just
checking for a frameless function or not.
* core.c (core_open, core_close, core_xfer_memory): Move
section table pointers and bfd* into the target_ops.
(core_open): Allow errors in shared lib reading, etc.
(core_files_info): Describe shared library sections.
* exec.c (exec_open, exec_close, exec_xfer_memory, xfer_memory,
exec_files_info, set_section_command): Move section table
pointers and bfd* into the target_ops.
(add_to_section_table): Add BFD to section table.
* target.c (target_xfer_memory, target_info): Pass target to
xfer_memory and target_info functions.
* target.h: ''
* gdbcore.h: Move struct section_table.
* target.h: New home of struct section_table.
* solib.c (solib_add): New argument is the target_ops whose
section list is to be added to, if any. Reallocate the
sections in that target to add any that come from shared libs.
(throughout) so_sections renamed to sections.
(solib_xfer_memory): Deleted.
* tm-sunos.h (SOLIB_ADD): Add target argument.
(SOLIB_XFER_MEMORY): Delete.
* core.c, exec.c, inftarg.c, remote-eb.c, remote-nindy.c,
remote-vx.c, remote.c, target.c, target.h: Remove add_syms vector
from target_ops. It's the same on all targets. Add two section
pointers to target_ops.
* stack.c (find_relative_frame): Dump ancient algorithm for
"down", just use handy "next" pointers.
(frame_command): Don't error if there is no stack; let user
set one.
* inflow.c (new_tty_prefork, new_tty): New prefork routine
modifies static state in the parent process; new_tty itself
runs in the child and modifies the child's file descriptors
to match the saved static state.
* infrun.c (child_create_inferior): Call new_tty_prefork,
fork, then new_tty.
* infptrace.c (child_xfer_memory): Add ignored target arg.
* remote-eb.c (eb_xfer_inferior_memory): ''
* remote-nindy.c (nindy_xfer_inferior_memory): ''
* remote-vx.c (vx_xfer_memory): ''
* remote.c (remote_xfer_memory): ''. Rename from
remote_xfer_inferior_memory.
* main.c (main): Only try to attach "corefile" argument if
it starts with a digit.
* symfile.c (symbol_reloading): New "set/show" variable.
(symbol_file_add): Shorten message about symbol reading.
(add_symbol_file_command): Merge with add_syms_addr_command,
since this should work on all targets now.
(stop_whining): Default to zero, to shut up complaints
about bad symbol tables on many systems.
(free_named_symtabs): Just exit unless symbol_reloading.
* xm-sun3os4.h, xm-sun4os4.h: Define BROKEN_LARGE_ALLOCA,
and add comment explaining shared library screw.
* source.c: #if defined => #ifdef.
Thu Aug 8 12:23:19 1991 John Gilmore (gnu at cygint.cygnus.com)
* doc/gdbint.texinfo: Improve doc on porting to new OS's.
Tue Aug 6 17:16:15 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
* Makefile: use doc/Makefile for doc targets
* doc/rdl-apps.texinfo: provide default readline-appendix finder
(doc/Makefile knows how to make one for local config)
* Makefile.in: use doc/Makefile for doc targets
* doc/Makefile: GDB documentation now has its own Makefile
doc/refcard.tex: renamed from "gdbrc.tex"

View File

@ -3,19 +3,19 @@
This file is part of GDB.
GDB is free software; you can redistribute it and/or modify
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 1, or (at your option)
any later version.
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GDB is distributed in the hope that it will be useful,
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 GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
int fclose ();
@ -28,9 +28,11 @@ int fclose ();
#include "target.h"
#include "breakpoint.h"
#include <getopt.h>
#include <readline/readline.h>
#include <readline/history.h>
#include "getopt.h"
/* readline include files */
#include "readline.h"
#include "history.h"
/* readline defines this. */
#undef savestring
@ -45,11 +47,11 @@ int fclose ();
#include <setjmp.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <ctype.h>
#ifdef SET_STACK_LIMIT_HUGE
#include <sys/time.h>
#include <sys/resource.h>
#include <ctype.h>
int original_stack_limit;
#endif
@ -581,7 +583,7 @@ GDB manual (available as on-line info or a printed manual).\n", stderr);
if (corearg != NULL)
if (!setjmp (to_top_level))
core_file_command (corearg, !batch);
else if (!setjmp (to_top_level))
else if (isdigit (corearg[0]) && !setjmp (to_top_level))
attach_command (corearg, !batch);
do_cleanups (ALL_CLEANUPS);
@ -1157,6 +1159,13 @@ command_line_input (prrompt, repeat)
while (1)
{
/* Reports are that some Sys V's don't flush stdout/err on reads
from stdin, when stdin/out are sockets rather than ttys. So we
have to do it ourselves, to make emacs-gdb and xxgdb work.
On other machines, doing this once per input should be a cheap nop. */
fflush (stdout);
fflush (stderr);
/* Don't use fancy stuff if not talking to stdin. */
if (command_editing_p && instream == stdin
&& ISATTY (instream))

View File

@ -3,19 +3,19 @@
This file is part of GDB.
GDB is free software; you can redistribute it and/or modify
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 1, or (at your option)
any later version.
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GDB is distributed in the hope that it will be useful,
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 GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include "defs.h"
@ -34,13 +34,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/stat.h>
#include <fcntl.h>
#include "gdbcore.h"
#include "regex.h"
extern char *strstr();
extern void set_next_address ();
void mod_path ();
/* Path of directories to search for source files.
Same format as the PATH environment variable's value. */
@ -97,25 +96,27 @@ select_source_symtab (s)
free (sals.sals);
current_source_symtab = sal.symtab;
current_source_line = max (sal.line - (lines_to_list () - 1), 1);
return;
if (current_source_symtab)
return;
}
/* All right; find the last file in the symtab list (ignoring .h's). */
if (s = symtab_list)
current_source_line = 1;
for (s = symtab_list; s; s = s->next)
{
do
{
char *name = s->filename;
int len = strlen (name);
if (! (len > 2 && !strcmp (&name[len - 2], ".h")))
current_source_symtab = s;
s = s->next;
}
while (s);
current_source_line = 1;
char *name = s->filename;
int len = strlen (name);
if (! (len > 2 && !strcmp (&name[len - 2], ".h")))
current_source_symtab = s;
}
else if (partial_symtab_list)
if (current_source_symtab)
return;
/* Howabout the partial symtab list? */
if (partial_symtab_list)
{
ps = partial_symtab_list;
while (ps)
@ -131,10 +132,11 @@ select_source_symtab (s)
fatal ("Internal: select_source_symtab: readin pst found and no symtabs.");
else
current_source_symtab = PSYMTAB_TO_SYMTAB (cs_pst);
else
current_source_symtab = 0;
current_source_line = 1;
}
if (current_source_symtab)
return;
error ("Can't find a default source file");
}
static void
@ -193,7 +195,7 @@ directory_command (dirname, from_tty)
}
}
else
mod_path (dirname, from_tty, &source_path);
mod_path (dirname, &source_path);
if (from_tty)
show_directories ();
forget_cached_source_info ();
@ -202,9 +204,8 @@ directory_command (dirname, from_tty)
/* Add zero or more directories to the front of an arbitrary path. */
void
mod_path (dirname, from_tty, which_path)
mod_path (dirname, which_path)
char *dirname;
int from_tty;
char **which_path;
{
char *old = *which_path;
@ -541,7 +542,7 @@ find_source_lines (s, desc)
if (exec_bfd && bfd_get_mtime(exec_bfd) < st.st_mtime)
printf ("Source file is more recent than executable.\n");
#if defined (BROKEN_LARGE_ALLOCA)
#ifdef BROKEN_LARGE_ALLOCA
data = (char *) xmalloc (st.st_size);
make_cleanup (free, data);
#else
@ -773,7 +774,7 @@ list_command (arg, from_tty)
char *p;
if (symtab_list == 0 && partial_symtab_list == 0)
error ("No symbol table is loaded. Use the \"symbol-file\" command.");
error ("No symbol table is loaded. Use the \"file\" command.");
/* Pull in a current source symtab if necessary */
if (current_source_symtab == 0 &&
@ -982,6 +983,7 @@ line_info (arg, from_tty)
/* Commands to search the source file for a regexp. */
/* ARGSUSED */
static void
forward_search_command (regex, from_tty)
char *regex;
@ -1024,15 +1026,16 @@ forward_search_command (regex, from_tty)
stream = fdopen (desc, "r");
clearerr (stream);
while (1) {
/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
char buf[4096]; /* Should be reasonable??? */
register char *p = buf;
c = fgetc (stream);
c = getc (stream);
if (c == EOF)
break;
do {
*p++ = c;
} while (c != '\n' && (c = fgetc (stream)) >= 0);
} while (c != '\n' && (c = getc (stream)) >= 0);
/* we now have a source line in buf, null terminate and match */
*p = 0;
@ -1052,6 +1055,7 @@ forward_search_command (regex, from_tty)
fclose (stream);
}
/* ARGSUSED */
static void
reverse_search_command (regex, from_tty)
char *regex;
@ -1095,15 +1099,16 @@ reverse_search_command (regex, from_tty)
clearerr (stream);
while (line > 1)
{
/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
char buf[4096]; /* Should be reasonable??? */
register char *p = buf;
c = fgetc (stream);
c = getc (stream);
if (c == EOF)
break;
do {
*p++ = c;
} while (c != '\n' && (c = fgetc (stream)) >= 0);
} while (c != '\n' && (c = getc (stream)) >= 0);
/* We now have a source line in buf; null terminate and match. */
*p = 0;