Misc cleanups from code review.
This commit is contained in:
parent
46f88c1138
commit
c2e4669f8c
7 changed files with 48 additions and 49 deletions
|
@ -1,3 +1,19 @@
|
||||||
|
Fri Mar 27 15:44:55 1992 John Gilmore (gnu at cygnus.com)
|
||||||
|
|
||||||
|
* buildsym.c (MAX_OF_C_TYPE, MIN_OF_C_TYPE): Unused, remove.
|
||||||
|
* copying.awk: Lint. Make stronger warning at top of copying.c.
|
||||||
|
* elfread.c (elf_symtab_read): Eliminate check of mainline.
|
||||||
|
* gdbtypes.c (smash_to_*): Remove FIXME comments.
|
||||||
|
(lookup_pointer_type): Add FIXME comment.
|
||||||
|
* main.c (set_history_size_command): Disallow negative size.
|
||||||
|
* partial-stab.h: Update copyright.
|
||||||
|
* rs6000-tdep.c (skip_trampoline_code): Better comments.
|
||||||
|
|
||||||
|
Wed Mar 25 10:45:38 1992 John Gilmore (gnu at cygnus.com)
|
||||||
|
|
||||||
|
* main.c (set_history_size_command): Negative size is error.
|
||||||
|
(Reported by Peggy Fieland.)
|
||||||
|
|
||||||
Thu Mar 26 17:01:18 1992 Fred Fish (fnf@cygnus.com)
|
Thu Mar 26 17:01:18 1992 Fred Fish (fnf@cygnus.com)
|
||||||
|
|
||||||
* coffread.c (coff_symfile_init): Update comment.
|
* coffread.c (coff_symfile_init): Update comment.
|
||||||
|
|
|
@ -3011,9 +3011,6 @@ read_huge_number (pp, end, valu, bits)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_OF_C_TYPE(t) ((1 << (sizeof (t)*8 - 1)) - 1)
|
|
||||||
#define MIN_OF_C_TYPE(t) (-(1 << (sizeof (t)*8 - 1)))
|
|
||||||
|
|
||||||
static struct type *
|
static struct type *
|
||||||
read_range_type (pp, typenums, objfile)
|
read_range_type (pp, typenums, objfile)
|
||||||
char **pp;
|
char **pp;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Read ELF (Executable and Linking Format) object files for GDB.
|
/* Read ELF (Executable and Linking Format) object files for GDB.
|
||||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
Copyright 1991, 1992 Free Software Foundation, Inc.
|
||||||
Written by Fred Fish at Cygnus Support.
|
Written by Fred Fish at Cygnus Support.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -24,7 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
* *
|
* *
|
||||||
* This file is still under construction. When it is complete, this *
|
* This file is still under construction. When it is complete, this *
|
||||||
* notice will be removed. Until then, direct any questions or changes *
|
* notice will be removed. Until then, direct any questions or changes *
|
||||||
* to Fred Fish at Cygnus Support (fnf@cygint) *
|
* to Fred Fish at Cygnus Support (fnf@cygnus.com) *
|
||||||
* *
|
* *
|
||||||
* FIXME Still needs support for shared libraries. *
|
* FIXME Still needs support for shared libraries. *
|
||||||
* FIXME Still needs support for core files. *
|
* FIXME Still needs support for core files. *
|
||||||
|
@ -219,10 +219,8 @@ elf_symtab_read (abfd, addr, mainline, objfile)
|
||||||
&& (sym -> section != NULL))
|
&& (sym -> section != NULL))
|
||||||
{
|
{
|
||||||
symaddr = sym -> value;
|
symaddr = sym -> value;
|
||||||
/* Relocate all non-absolute symbols by base address.
|
/* Relocate all non-absolute symbols by base address. */
|
||||||
FIXME: Can we eliminate the check for mainline now,
|
if (sym -> section != &bfd_abs_section)
|
||||||
since shouldn't addr be 0 in this case? */
|
|
||||||
if (!mainline && (sym -> section != &bfd_abs_section))
|
|
||||||
{
|
{
|
||||||
symaddr += addr;
|
symaddr += addr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ lookup_pointer_type (type)
|
||||||
TYPE_TARGET_TYPE (ptype) = type;
|
TYPE_TARGET_TYPE (ptype) = type;
|
||||||
TYPE_POINTER_TYPE (type) = ptype;
|
TYPE_POINTER_TYPE (type) = ptype;
|
||||||
|
|
||||||
/* We assume the machine has only one representation for pointers! */
|
/* FIXME, assume machine has only one representation for pointers! */
|
||||||
|
|
||||||
TYPE_LENGTH (ptype) = TARGET_PTR_BIT / TARGET_CHAR_BIT;
|
TYPE_LENGTH (ptype) = TARGET_PTR_BIT / TARGET_CHAR_BIT;
|
||||||
TYPE_CODE (ptype) = TYPE_CODE_PTR;
|
TYPE_CODE (ptype) = TYPE_CODE_PTR;
|
||||||
|
@ -236,10 +236,9 @@ create_array_type (element_type, number)
|
||||||
include the offset (that's the value of the MEMBER itself), but does
|
include the offset (that's the value of the MEMBER itself), but does
|
||||||
include the structure type into which it points (for some reason).
|
include the structure type into which it points (for some reason).
|
||||||
|
|
||||||
FIXME: When "smashing" the type, we preserve the objfile that the
|
When "smashing" the type, we preserve the objfile that the
|
||||||
old type pointed to, since we aren't changing where the type is actually
|
old type pointed to, since we aren't changing where the type is actually
|
||||||
allocated. If the two types aren't associated with the same objfile,
|
allocated. */
|
||||||
then we are in deep-s**t anyway... */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
smash_to_member_type (type, domain, to_type)
|
smash_to_member_type (type, domain, to_type)
|
||||||
|
@ -262,10 +261,9 @@ smash_to_member_type (type, domain, to_type)
|
||||||
/* Smash TYPE to be a type of method of DOMAIN with type TO_TYPE.
|
/* Smash TYPE to be a type of method of DOMAIN with type TO_TYPE.
|
||||||
METHOD just means `function that gets an extra "this" argument'.
|
METHOD just means `function that gets an extra "this" argument'.
|
||||||
|
|
||||||
FIXME: When "smashing" the type, we preserve the objfile that the
|
When "smashing" the type, we preserve the objfile that the
|
||||||
old type pointed to, since we aren't changing where the type is actually
|
old type pointed to, since we aren't changing where the type is actually
|
||||||
allocated. If the two types aren't associated with the same objfile,
|
allocated. */
|
||||||
then we are in deep-s**t anyway... */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
smash_to_method_type (type, domain, to_type, args)
|
smash_to_method_type (type, domain, to_type, args)
|
||||||
|
|
46
gdb/main.c
46
gdb/main.c
|
@ -1591,29 +1591,12 @@ validate_comname (comname)
|
||||||
p = comname;
|
p = comname;
|
||||||
while (*p)
|
while (*p)
|
||||||
{
|
{
|
||||||
if (!(*p >= 'A' && *p <= 'Z')
|
if (!isalnum(*p) && *p != '-')
|
||||||
&& !(*p >= 'a' && *p <= 'z')
|
|
||||||
&& !(*p >= '0' && *p <= '9')
|
|
||||||
&& *p != '-')
|
|
||||||
error ("Junk in argument list: \"%s\"", p);
|
error ("Junk in argument list: \"%s\"", p);
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IBM6000
|
|
||||||
|
|
||||||
lowercase (char *str)
|
|
||||||
{
|
|
||||||
while (*str) {
|
|
||||||
|
|
||||||
/* isupper(), tolower() are function calls in AIX. */
|
|
||||||
if ( *str >= 'A' && *str <= 'Z')
|
|
||||||
*str = *str + 'a' - 'A';
|
|
||||||
++str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
define_command (comname, from_tty)
|
define_command (comname, from_tty)
|
||||||
char *comname;
|
char *comname;
|
||||||
|
@ -1625,14 +1608,6 @@ define_command (comname, from_tty)
|
||||||
|
|
||||||
validate_comname (comname);
|
validate_comname (comname);
|
||||||
|
|
||||||
#ifdef IBM6000
|
|
||||||
|
|
||||||
/* If the rest of the commands will be case insensetive, this one
|
|
||||||
should behave in the same manner. */
|
|
||||||
|
|
||||||
lowercase (comname);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look it up, and verify that we got an exact match. */
|
/* Look it up, and verify that we got an exact match. */
|
||||||
c = lookup_cmd (&tem, cmdlist, "", -1, 1);
|
c = lookup_cmd (&tem, cmdlist, "", -1, 1);
|
||||||
if (c && 0 != strcmp (comname, c->name))
|
if (c && 0 != strcmp (comname, c->name))
|
||||||
|
@ -1644,17 +1619,23 @@ define_command (comname, from_tty)
|
||||||
tem = "Redefine command \"%s\"? ";
|
tem = "Redefine command \"%s\"? ";
|
||||||
else
|
else
|
||||||
tem = "Really redefine built-in command \"%s\"? ";
|
tem = "Really redefine built-in command \"%s\"? ";
|
||||||
if (!query (tem, comname))
|
if (!query (tem, c->name))
|
||||||
error ("Command \"%s\" not redefined.", comname);
|
error ("Command \"%s\" not redefined.", c->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
comname = savestring (comname, strlen (comname));
|
||||||
|
|
||||||
|
/* If the rest of the commands will be case insensetive, this one
|
||||||
|
should behave in the same manner. */
|
||||||
|
for (tem = comname; *tem; tem++)
|
||||||
|
if (isupper(*tem)) *tem = tolower(*tem);
|
||||||
|
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
{
|
{
|
||||||
printf ("Type commands for definition of \"%s\".\n\
|
printf ("Type commands for definition of \"%s\".\n\
|
||||||
End with a line saying just \"end\".\n", comname);
|
End with a line saying just \"end\".\n", comname);
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
}
|
}
|
||||||
comname = savestring (comname, strlen (comname));
|
|
||||||
|
|
||||||
cmds = read_command_lines ();
|
cmds = read_command_lines ();
|
||||||
|
|
||||||
|
@ -2028,8 +2009,13 @@ set_history_size_command (args, from_tty, c)
|
||||||
{
|
{
|
||||||
if (history_size == UINT_MAX)
|
if (history_size == UINT_MAX)
|
||||||
unstifle_history ();
|
unstifle_history ();
|
||||||
else
|
else if (history_size >= 0)
|
||||||
stifle_history (history_size);
|
stifle_history (history_size);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
history_size = UINT_MAX;
|
||||||
|
error ("History size must be non-negative");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Shared code to pre-read a stab (dbx-style), when building a psymtab.
|
/* Shared code to pre-read a stab (dbx-style), when building a psymtab.
|
||||||
Copyright (C) 1986-1991 Free Software Foundation, Inc.
|
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
|
|
@ -835,8 +835,11 @@ int fram;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Indirect function calls use a piece of trampoline code do co context switching,
|
/* Indirect function calls use a piece of trampoline code to do context
|
||||||
i.e. to set the new TOC table. Skip such code if exists. */
|
switching, i.e. to set the new TOC table. Skip such code if we are on
|
||||||
|
its first instruction (as when we have single-stepped to here).
|
||||||
|
Result is desired PC to step until, or NULL if we are not in
|
||||||
|
trampoline code. */
|
||||||
|
|
||||||
skip_trampoline_code (pc)
|
skip_trampoline_code (pc)
|
||||||
int pc;
|
int pc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue