1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid possible nested-if confusion. * breakpoint.c (breakpoint_here_p): Ditto. (breakpoint_inserted_here_p): Ditto. (breakpoint_thread_match): Ditto. * gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined. * gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability prototypes. * symtab.h: Add prototype for _initialize_source. * value.h: Add prototype for _initialize_value. * defs.h: Include sys/types.h or stddef.h to get size_t. (make_cleanup): Add make_cleanup_func typedef and switch to using a prototype for this function. (mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't using mmalloc. * ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c: Cast parameters passed to make_cleanup to use the new make_cleanup_func typedef. More warning cleanups. There are still a bunch of places where the first argument to make_cleanup is not cast to (make_cleanup_func); these are either due to the function fitting the make_cleanup_func specification already (e.g. free()) or they are in files that weren't compiled when I did my make on a Linux native system. Bwahahaha. You can see them like this: grep make_cleanup\ * | grep -v make_cleanup_func I'll surely go back and clean up the remaining suspicious calls in GDB one of these days. :-)
This commit is contained in:
parent
9a3d6f4eef
commit
ad3b8c4a1a
23 changed files with 354 additions and 187 deletions
|
@ -1,3 +1,31 @@
|
||||||
|
1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||||
|
|
||||||
|
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid
|
||||||
|
possible nested-if confusion.
|
||||||
|
* breakpoint.c (breakpoint_here_p): Ditto.
|
||||||
|
(breakpoint_inserted_here_p): Ditto.
|
||||||
|
(breakpoint_thread_match): Ditto.
|
||||||
|
|
||||||
|
* gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
|
||||||
|
* gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
|
||||||
|
prototypes.
|
||||||
|
|
||||||
|
* symtab.h: Add prototype for _initialize_source.
|
||||||
|
* value.h: Add prototype for _initialize_value.
|
||||||
|
|
||||||
|
* defs.h: Include sys/types.h or stddef.h to get size_t.
|
||||||
|
(make_cleanup): Add make_cleanup_func typedef and switch to using
|
||||||
|
a prototype for this function.
|
||||||
|
(mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
|
||||||
|
using mmalloc.
|
||||||
|
|
||||||
|
* ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c
|
||||||
|
dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c
|
||||||
|
infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
|
||||||
|
symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c:
|
||||||
|
Cast parameters passed to make_cleanup to use the new
|
||||||
|
make_cleanup_func typedef.
|
||||||
|
|
||||||
Tue Oct 13 00:51:48 1998 Felix Lee <flee@cygnus.com>
|
Tue Oct 13 00:51:48 1998 Felix Lee <flee@cygnus.com>
|
||||||
|
|
||||||
* sol-thread.c (ps_pstop, etc): different solaris versions have
|
* sol-thread.c (ps_pstop, etc): different solaris versions have
|
||||||
|
|
10
gdb/ax-gdb.c
10
gdb/ax-gdb.c
|
@ -1155,7 +1155,7 @@ gen_deref (ax, value)
|
||||||
actually emit any code; we just change the type from "Pointer to
|
actually emit any code; we just change the type from "Pointer to
|
||||||
T" to "T", and mark the value as an lvalue in memory. Leave it
|
T" to "T", and mark the value as an lvalue in memory. Leave it
|
||||||
to the consumer to actually dereference it. */
|
to the consumer to actually dereference it. */
|
||||||
value->type = TYPE_TARGET_TYPE (value->type);
|
value->type = check_typedef (TYPE_TARGET_TYPE (value->type));
|
||||||
value->kind = ((value->type->code == TYPE_CODE_FUNC)
|
value->kind = ((value->type->code == TYPE_CODE_FUNC)
|
||||||
? axs_rvalue : axs_lvalue_memory);
|
? axs_rvalue : axs_lvalue_memory);
|
||||||
}
|
}
|
||||||
|
@ -1782,7 +1782,7 @@ expr_to_agent (expr, value)
|
||||||
struct agent_expr *ax = new_agent_expr ();
|
struct agent_expr *ax = new_agent_expr ();
|
||||||
union exp_element *pc;
|
union exp_element *pc;
|
||||||
|
|
||||||
old_chain = make_cleanup (free_agent_expr, ax);
|
old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax);
|
||||||
|
|
||||||
pc = expr->elts;
|
pc = expr->elts;
|
||||||
trace_kludge = 0;
|
trace_kludge = 0;
|
||||||
|
@ -1836,7 +1836,7 @@ gen_trace_for_expr (expr)
|
||||||
union exp_element *pc;
|
union exp_element *pc;
|
||||||
struct axs_value value;
|
struct axs_value value;
|
||||||
|
|
||||||
old_chain = make_cleanup (free_agent_expr, ax);
|
old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax);
|
||||||
|
|
||||||
pc = expr->elts;
|
pc = expr->elts;
|
||||||
trace_kludge = 1;
|
trace_kludge = 1;
|
||||||
|
@ -1905,9 +1905,9 @@ agent_command (exp, from_tty)
|
||||||
error_no_arg ("expression to translate");
|
error_no_arg ("expression to translate");
|
||||||
|
|
||||||
expr = parse_expression (exp);
|
expr = parse_expression (exp);
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
agent = gen_trace_for_expr (expr);
|
agent = gen_trace_for_expr (expr);
|
||||||
make_cleanup (free_agent_expr, agent);
|
make_cleanup ((make_cleanup_func) free_agent_expr, agent);
|
||||||
ax_print (gdb_stdout, agent);
|
ax_print (gdb_stdout, agent);
|
||||||
ax_reqs (agent, &reqs);
|
ax_reqs (agent, &reqs);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Get info from stack frames;
|
/* Get info from stack frames;
|
||||||
convert between frames, blocks, functions and pc values.
|
convert between frames, blocks, functions and pc values.
|
||||||
Copyright 1986, 1987, 1988, 1989, 1991, 1994, 1995, 1996, 1997
|
Copyright 1986, 87, 88, 89, 91, 94, 95, 96, 97, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -807,14 +807,19 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
|
||||||
cache_pc_function_name = SYMBOL_NAME (msymbol);
|
cache_pc_function_name = SYMBOL_NAME (msymbol);
|
||||||
cache_pc_function_section = section;
|
cache_pc_function_section = section;
|
||||||
|
|
||||||
/* Use the lesser of the next minimal symbol in the same section, or the end
|
/* Use the lesser of the next minimal symbol in the same section, or
|
||||||
of the section, as the end of the function. Step over other symbols at
|
the end of the section, as the end of the function. */
|
||||||
this same address to find the next one. */
|
|
||||||
|
/* Step over other symbols at this same address, and symbols in
|
||||||
|
other sections, to find the next symbol in this section with
|
||||||
|
a different address. */
|
||||||
|
|
||||||
for (i=1; SYMBOL_NAME (msymbol+i) != NULL
|
for (i=1; SYMBOL_NAME (msymbol+i) != NULL; i++)
|
||||||
&& (SYMBOL_VALUE_ADDRESS(msymbol+i) == SYMBOL_VALUE_ADDRESS (msymbol)
|
{
|
||||||
|| SYMBOL_BFD_SECTION(msymbol+i) != section);
|
if (SYMBOL_VALUE_ADDRESS (msymbol+i) != SYMBOL_VALUE_ADDRESS (msymbol)
|
||||||
i++) /* empty */;
|
&& SYMBOL_BFD_SECTION (msymbol+i) == SYMBOL_BFD_SECTION (msymbol))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (SYMBOL_NAME (msymbol + i) != NULL
|
if (SYMBOL_NAME (msymbol + i) != NULL
|
||||||
&& SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr)
|
&& SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr)
|
||||||
|
@ -827,27 +832,31 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
|
||||||
return_cached_value:
|
return_cached_value:
|
||||||
|
|
||||||
if (address)
|
if (address)
|
||||||
if (pc_in_unmapped_range (pc, section))
|
{
|
||||||
*address = overlay_unmapped_address (cache_pc_function_low, section);
|
if (pc_in_unmapped_range (pc, section))
|
||||||
else
|
*address = overlay_unmapped_address (cache_pc_function_low, section);
|
||||||
*address = cache_pc_function_low;
|
else
|
||||||
|
*address = cache_pc_function_low;
|
||||||
|
}
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
*name = cache_pc_function_name;
|
*name = cache_pc_function_name;
|
||||||
|
|
||||||
if (endaddr)
|
if (endaddr)
|
||||||
if (pc_in_unmapped_range (pc, section))
|
{
|
||||||
{
|
if (pc_in_unmapped_range (pc, section))
|
||||||
/* Because the high address is actually beyond the end of
|
{
|
||||||
the function (and therefore possibly beyond the end of
|
/* Because the high address is actually beyond the end of
|
||||||
the overlay), we must actually convert (high - 1)
|
the function (and therefore possibly beyond the end of
|
||||||
and then add one to that. */
|
the overlay), we must actually convert (high - 1)
|
||||||
|
and then add one to that. */
|
||||||
|
|
||||||
*endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1,
|
*endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1,
|
||||||
section);
|
section);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*endaddr = cache_pc_function_high;
|
*endaddr = cache_pc_function_high;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,12 +850,14 @@ breakpoint_here_p (pc)
|
||||||
ALL_BREAKPOINTS (b)
|
ALL_BREAKPOINTS (b)
|
||||||
if (b->enable == enabled
|
if (b->enable == enabled
|
||||||
&& b->address == pc) /* bp is enabled and matches pc */
|
&& b->address == pc) /* bp is enabled and matches pc */
|
||||||
if (overlay_debugging &&
|
{
|
||||||
section_is_overlay (b->section) &&
|
if (overlay_debugging &&
|
||||||
!section_is_mapped (b->section))
|
section_is_overlay (b->section) &&
|
||||||
continue; /* unmapped overlay -- can't be a match */
|
!section_is_mapped (b->section))
|
||||||
else
|
continue; /* unmapped overlay -- can't be a match */
|
||||||
return 1;
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -872,12 +874,14 @@ breakpoint_inserted_here_p (pc)
|
||||||
ALL_BREAKPOINTS (b)
|
ALL_BREAKPOINTS (b)
|
||||||
if (b->inserted
|
if (b->inserted
|
||||||
&& b->address == pc) /* bp is inserted and matches pc */
|
&& b->address == pc) /* bp is inserted and matches pc */
|
||||||
if (overlay_debugging &&
|
{
|
||||||
section_is_overlay (b->section) &&
|
if (overlay_debugging &&
|
||||||
!section_is_mapped (b->section))
|
section_is_overlay (b->section) &&
|
||||||
continue; /* unmapped overlay -- can't be a match */
|
!section_is_mapped (b->section))
|
||||||
else
|
continue; /* unmapped overlay -- can't be a match */
|
||||||
return 1;
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -935,12 +939,14 @@ breakpoint_thread_match (pc, pid)
|
||||||
&& b->enable != shlib_disabled
|
&& b->enable != shlib_disabled
|
||||||
&& b->address == pc
|
&& b->address == pc
|
||||||
&& (b->thread == -1 || b->thread == thread))
|
&& (b->thread == -1 || b->thread == thread))
|
||||||
if (overlay_debugging &&
|
{
|
||||||
section_is_overlay (b->section) &&
|
if (overlay_debugging &&
|
||||||
!section_is_mapped (b->section))
|
section_is_overlay (b->section) &&
|
||||||
continue; /* unmapped overlay -- can't be a match */
|
!section_is_mapped (b->section))
|
||||||
else
|
continue; /* unmapped overlay -- can't be a match */
|
||||||
return 1;
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2937,7 +2943,7 @@ until_break_command (arg, from_tty)
|
||||||
|
|
||||||
breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
|
breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
|
||||||
|
|
||||||
old_chain = make_cleanup(delete_breakpoint, breakpoint);
|
old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
|
||||||
|
|
||||||
/* Keep within the current frame */
|
/* Keep within the current frame */
|
||||||
|
|
||||||
|
@ -2946,7 +2952,7 @@ until_break_command (arg, from_tty)
|
||||||
sal = find_pc_line (prev_frame->pc, 0);
|
sal = find_pc_line (prev_frame->pc, 0);
|
||||||
sal.pc = prev_frame->pc;
|
sal.pc = prev_frame->pc;
|
||||||
breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
|
breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
|
||||||
make_cleanup(delete_breakpoint, breakpoint);
|
make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
|
proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
|
||||||
|
@ -3929,6 +3935,8 @@ is valid is not currently in scope.\n", bpt->number);
|
||||||
int i = hw_watchpoint_used_count (bpt->type, &other_type_used);
|
int i = hw_watchpoint_used_count (bpt->type, &other_type_used);
|
||||||
int mem_cnt = can_use_hardware_watchpoint (bpt->val);
|
int mem_cnt = can_use_hardware_watchpoint (bpt->val);
|
||||||
|
|
||||||
|
/* Hack around 'unused var' error for some targets here */
|
||||||
|
(void) mem_cnt, i;
|
||||||
target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT(
|
target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT(
|
||||||
bpt->type, i + mem_cnt, other_type_used);
|
bpt->type, i + mem_cnt, other_type_used);
|
||||||
/* we can consider of type is bp_hardware_watchpoint, convert to
|
/* we can consider of type is bp_hardware_watchpoint, convert to
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Core dump and executable file functions below target vector, for GDB.
|
/* Core dump and executable file functions below target vector, for GDB.
|
||||||
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
|
Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -189,7 +189,7 @@ core_open (filename, from_tty)
|
||||||
/* FIXME: should be checking for errors from bfd_close (for one thing,
|
/* FIXME: should be checking for errors from bfd_close (for one thing,
|
||||||
on error it does not free all the storage associated with the
|
on error it does not free all the storage associated with the
|
||||||
bfd). */
|
bfd). */
|
||||||
make_cleanup (bfd_close, temp_bfd);
|
make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
|
||||||
error ("\"%s\" is not a core dump: %s",
|
error ("\"%s\" is not a core dump: %s",
|
||||||
filename, bfd_errmsg (bfd_get_error ()));
|
filename, bfd_errmsg (bfd_get_error ()));
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ core_open (filename, from_tty)
|
||||||
discard_cleanups (old_chain); /* Don't free filename any more */
|
discard_cleanups (old_chain); /* Don't free filename any more */
|
||||||
unpush_target (&core_ops);
|
unpush_target (&core_ops);
|
||||||
core_bfd = temp_bfd;
|
core_bfd = temp_bfd;
|
||||||
old_chain = make_cleanup (core_close, core_bfd);
|
old_chain = make_cleanup ((make_cleanup_func) core_close, core_bfd);
|
||||||
|
|
||||||
validate_files ();
|
validate_files ();
|
||||||
|
|
||||||
|
|
66
gdb/defs.h
66
gdb/defs.h
|
@ -1,5 +1,5 @@
|
||||||
/* Basic, host-specific, and target-specific definitions for GDB.
|
/* Basic, host-specific, and target-specific definitions for GDB.
|
||||||
Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995, 1996
|
Copyright (C) 1986, 89, 91, 92, 93, 94, 95, 1996, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -25,6 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h> /* System call error return status */
|
#include <errno.h> /* System call error return status */
|
||||||
|
|
||||||
|
#ifdef HAVE_STDDEF_H
|
||||||
|
# include <stddef.h>
|
||||||
|
#else
|
||||||
|
# include <sys/types.h> /* for size_t */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Just in case they're not defined in stdio.h. */
|
/* Just in case they're not defined in stdio.h. */
|
||||||
|
|
||||||
#ifndef SEEK_SET
|
#ifndef SEEK_SET
|
||||||
|
@ -52,7 +58,7 @@ extern char *strsignal PARAMS ((int));
|
||||||
|
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
|
|
||||||
#ifndef NO_MMALLOC
|
#ifdef USE_MMALLOC
|
||||||
#include "mmalloc.h"
|
#include "mmalloc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -134,7 +140,9 @@ enum language
|
||||||
language_auto, /* Placeholder for automatic setting */
|
language_auto, /* Placeholder for automatic setting */
|
||||||
language_c, /* C */
|
language_c, /* C */
|
||||||
language_cplus, /* C++ */
|
language_cplus, /* C++ */
|
||||||
|
/* start-sanitize-java */
|
||||||
language_java, /* Java */
|
language_java, /* Java */
|
||||||
|
/* end-sanitize-java */
|
||||||
language_chill, /* Chill */
|
language_chill, /* Chill */
|
||||||
language_fortran, /* Fortran */
|
language_fortran, /* Fortran */
|
||||||
language_m2, /* Modula-2 */
|
language_m2, /* Modula-2 */
|
||||||
|
@ -212,6 +220,8 @@ extern int inside_entry_file PARAMS ((CORE_ADDR addr));
|
||||||
|
|
||||||
extern int inside_main_func PARAMS ((CORE_ADDR pc));
|
extern int inside_main_func PARAMS ((CORE_ADDR pc));
|
||||||
|
|
||||||
|
extern void _initialize_blockframe PARAMS ((void));
|
||||||
|
|
||||||
/* From ch-lang.c, for the moment. (FIXME) */
|
/* From ch-lang.c, for the moment. (FIXME) */
|
||||||
|
|
||||||
extern char *chill_demangle PARAMS ((const char *));
|
extern char *chill_demangle PARAMS ((const char *));
|
||||||
|
@ -238,25 +248,20 @@ extern void discard_cleanups PARAMS ((struct cleanup *));
|
||||||
extern void discard_final_cleanups PARAMS ((struct cleanup *));
|
extern void discard_final_cleanups PARAMS ((struct cleanup *));
|
||||||
extern void discard_my_cleanups PARAMS ((struct cleanup **, struct cleanup *));
|
extern void discard_my_cleanups PARAMS ((struct cleanup **, struct cleanup *));
|
||||||
|
|
||||||
/* The bare make_cleanup function is one of those rare beasts that
|
typedef void (*make_cleanup_func) (void *);
|
||||||
takes almost any type of function as the first arg and anything that
|
|
||||||
will fit in a "void *" as the second arg.
|
|
||||||
|
|
||||||
Should be, once all calls and called-functions are cleaned up:
|
|
||||||
extern struct cleanup *
|
extern struct cleanup *
|
||||||
make_cleanup PARAMS ((void (*function) (void *), void *));
|
make_cleanup PARAMS ((make_cleanup_func, void *));
|
||||||
|
|
||||||
Until then, lint and/or various type-checking compiler options will
|
|
||||||
complain about make_cleanup calls. It'd be wrong to just cast things,
|
|
||||||
since the type actually passed when the function is called would be
|
|
||||||
wrong. */
|
|
||||||
|
|
||||||
extern struct cleanup *make_cleanup ();
|
|
||||||
extern struct cleanup *
|
extern struct cleanup *
|
||||||
make_final_cleanup PARAMS ((void (*function) (void *), void *));
|
make_final_cleanup PARAMS ((void (*function) (void *), void *));
|
||||||
|
|
||||||
extern struct cleanup *
|
extern struct cleanup *
|
||||||
make_my_cleanup PARAMS ((struct cleanup **, void (*function) (void *), void *));
|
make_my_cleanup PARAMS ((struct cleanup **, void (*function) (void *), void *));
|
||||||
|
|
||||||
|
extern struct cleanup *
|
||||||
|
make_run_cleanup PARAMS ((void (*function) (void *), void *));
|
||||||
|
|
||||||
extern struct cleanup *save_cleanups PARAMS ((void));
|
extern struct cleanup *save_cleanups PARAMS ((void));
|
||||||
extern struct cleanup *save_final_cleanups PARAMS ((void));
|
extern struct cleanup *save_final_cleanups PARAMS ((void));
|
||||||
extern struct cleanup *save_my_cleanups PARAMS ((struct cleanup **));
|
extern struct cleanup *save_my_cleanups PARAMS ((struct cleanup **));
|
||||||
|
@ -274,6 +279,12 @@ extern int myread PARAMS ((int, char *, int));
|
||||||
extern int query PARAMS((char *, ...))
|
extern int query PARAMS((char *, ...))
|
||||||
ATTR_FORMAT(printf, 1, 2);
|
ATTR_FORMAT(printf, 1, 2);
|
||||||
|
|
||||||
|
#if !defined (USE_MMALLOC)
|
||||||
|
extern PTR mmalloc PARAMS ((PTR, size_t));
|
||||||
|
extern PTR mrealloc PARAMS ((PTR, PTR, size_t));
|
||||||
|
extern void mfree PARAMS ((PTR, PTR));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* From demangle.c */
|
/* From demangle.c */
|
||||||
|
|
||||||
extern void set_demangling_style PARAMS ((char *));
|
extern void set_demangling_style PARAMS ((char *));
|
||||||
|
@ -301,6 +312,8 @@ extern void fputs_filtered PARAMS ((const char *, GDB_FILE *));
|
||||||
|
|
||||||
extern void fputs_unfiltered PARAMS ((const char *, GDB_FILE *));
|
extern void fputs_unfiltered PARAMS ((const char *, GDB_FILE *));
|
||||||
|
|
||||||
|
extern int fputc_filtered PARAMS ((int c, GDB_FILE *));
|
||||||
|
|
||||||
extern int fputc_unfiltered PARAMS ((int c, GDB_FILE *));
|
extern int fputc_unfiltered PARAMS ((int c, GDB_FILE *));
|
||||||
|
|
||||||
extern int putchar_unfiltered PARAMS ((int c));
|
extern int putchar_unfiltered PARAMS ((int c));
|
||||||
|
@ -368,6 +381,8 @@ extern NORETURN void perror_with_name PARAMS ((char *)) ATTR_NORETURN;
|
||||||
|
|
||||||
extern void print_sys_errmsg PARAMS ((char *, int));
|
extern void print_sys_errmsg PARAMS ((char *, int));
|
||||||
|
|
||||||
|
extern void _initialize_stack PARAMS ((void));
|
||||||
|
|
||||||
/* From regex.c or libc. BSD 4.4 declares this with the argument type as
|
/* From regex.c or libc. BSD 4.4 declares this with the argument type as
|
||||||
"const char *" in unistd.h, so we can't declare the argument
|
"const char *" in unistd.h, so we can't declare the argument
|
||||||
as "char *". */
|
as "char *". */
|
||||||
|
@ -403,6 +418,8 @@ extern void print_address_numeric PARAMS ((CORE_ADDR, int, GDB_FILE *));
|
||||||
|
|
||||||
extern void print_address PARAMS ((CORE_ADDR, GDB_FILE *));
|
extern void print_address PARAMS ((CORE_ADDR, GDB_FILE *));
|
||||||
|
|
||||||
|
extern void _initialize_printcmd PARAMS ((void));
|
||||||
|
|
||||||
/* From source.c */
|
/* From source.c */
|
||||||
|
|
||||||
extern int openp PARAMS ((char *, int, char *, int, int, char **));
|
extern int openp PARAMS ((char *, int, char *, int, int, char **));
|
||||||
|
@ -722,18 +739,23 @@ extern void free ();
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# define alloca __builtin_alloca
|
# define alloca __builtin_alloca
|
||||||
# else /* Not GNU C */
|
# else /* Not GNU C */
|
||||||
# ifdef sparc
|
# ifdef HAVE_ALLOCA_H
|
||||||
# include <alloca.h> /* NOTE: Doesn't declare alloca() */
|
# include <alloca.h>
|
||||||
# endif
|
# else
|
||||||
|
# ifdef _AIX
|
||||||
|
#pragma alloca
|
||||||
|
# else
|
||||||
|
|
||||||
/* We need to be careful not to declare this in a way which conflicts with
|
/* We need to be careful not to declare this in a way which conflicts with
|
||||||
bison. Bison never declares it as char *, but under various circumstances
|
bison. Bison never declares it as char *, but under various circumstances
|
||||||
(like __hpux) we need to use void *. */
|
(like __hpux) we need to use void *. */
|
||||||
# if defined (__STDC__) || defined (__hpux)
|
# if defined (__STDC__) || defined (__hpux)
|
||||||
extern void *alloca ();
|
extern void *alloca ();
|
||||||
# else /* Don't use void *. */
|
# else /* Don't use void *. */
|
||||||
extern char *alloca ();
|
extern char *alloca ();
|
||||||
# endif /* Don't use void *. */
|
# endif /* Don't use void *. */
|
||||||
|
# endif /* Not _AIX */
|
||||||
|
# endif /* Not HAVE_ALLOCA_H */
|
||||||
# endif /* Not GNU C */
|
# endif /* Not GNU C */
|
||||||
#endif /* alloca not defined */
|
#endif /* alloca not defined */
|
||||||
|
|
||||||
|
@ -1024,7 +1046,8 @@ extern void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer,
|
||||||
extern void (*print_frame_info_listing_hook) PARAMS ((struct symtab *s,
|
extern void (*print_frame_info_listing_hook) PARAMS ((struct symtab *s,
|
||||||
int line, int stopline,
|
int line, int stopline,
|
||||||
int noerror));
|
int noerror));
|
||||||
extern int (*query_hook) PARAMS ((const char *, va_list));
|
extern int (*query_hook) PARAMS ((const char *, va_list));
|
||||||
|
extern void (*warning_hook) PARAMS ((const char *, va_list));
|
||||||
extern void (*flush_hook) PARAMS ((FILE *stream));
|
extern void (*flush_hook) PARAMS ((FILE *stream));
|
||||||
extern void (*create_breakpoint_hook) PARAMS ((struct breakpoint *b));
|
extern void (*create_breakpoint_hook) PARAMS ((struct breakpoint *b));
|
||||||
extern void (*delete_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
|
extern void (*delete_breakpoint_hook) PARAMS ((struct breakpoint *bpt));
|
||||||
|
@ -1035,7 +1058,8 @@ extern void (*registers_changed_hook) PARAMS ((void));
|
||||||
extern void (*readline_begin_hook) PARAMS ((char *, ...));
|
extern void (*readline_begin_hook) PARAMS ((char *, ...));
|
||||||
extern char * (*readline_hook) PARAMS ((char *));
|
extern char * (*readline_hook) PARAMS ((char *));
|
||||||
extern void (*readline_end_hook) PARAMS ((void));
|
extern void (*readline_end_hook) PARAMS ((void));
|
||||||
|
extern void (*pc_changed_hook) PARAMS ((void));
|
||||||
|
extern void (*context_hook) PARAMS ((int));
|
||||||
extern int (*target_wait_hook) PARAMS ((int pid,
|
extern int (*target_wait_hook) PARAMS ((int pid,
|
||||||
struct target_waitstatus *status));
|
struct target_waitstatus *status));
|
||||||
|
|
||||||
|
|
|
@ -1304,7 +1304,7 @@ psymtab_to_symtab_1 (pst)
|
||||||
back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
|
back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
|
||||||
|
|
||||||
buildsym_init ();
|
buildsym_init ();
|
||||||
make_cleanup (really_free_pendings, NULL);
|
make_cleanup ((make_cleanup_func) really_free_pendings, NULL);
|
||||||
|
|
||||||
/* read in the comp_unit header */
|
/* read in the comp_unit header */
|
||||||
cu_header.length = read_4_bytes (abfd, info_ptr);
|
cu_header.length = read_4_bytes (abfd, info_ptr);
|
||||||
|
@ -1322,7 +1322,7 @@ psymtab_to_symtab_1 (pst)
|
||||||
|
|
||||||
dies = read_comp_unit (info_ptr, abfd);
|
dies = read_comp_unit (info_ptr, abfd);
|
||||||
|
|
||||||
make_cleanup (free_die_list, dies);
|
make_cleanup ((make_cleanup_func) free_die_list, dies);
|
||||||
|
|
||||||
/* Do line number decoding in read_file_scope () */
|
/* Do line number decoding in read_file_scope () */
|
||||||
process_die (dies, objfile);
|
process_die (dies, objfile);
|
||||||
|
@ -2070,7 +2070,8 @@ dwarf2_add_member_fn (fip, die, type, objfile)
|
||||||
(fip->nfnfields + DW_FIELD_ALLOC_CHUNK)
|
(fip->nfnfields + DW_FIELD_ALLOC_CHUNK)
|
||||||
* sizeof (struct fnfieldlist));
|
* sizeof (struct fnfieldlist));
|
||||||
if (fip->nfnfields == 0)
|
if (fip->nfnfields == 0)
|
||||||
make_cleanup (free_current_contents, &fip->fnfieldlists);
|
make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&fip->fnfieldlists);
|
||||||
}
|
}
|
||||||
flp = &fip->fnfieldlists[fip->nfnfields];
|
flp = &fip->fnfieldlists[fip->nfnfields];
|
||||||
flp->name = fieldname;
|
flp->name = fieldname;
|
||||||
|
@ -2576,7 +2577,8 @@ read_array_type (die, objfile)
|
||||||
xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK)
|
xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK)
|
||||||
* sizeof (struct type *));
|
* sizeof (struct type *));
|
||||||
if (ndim == 0)
|
if (ndim == 0)
|
||||||
make_cleanup (free_current_contents, &range_types);
|
make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&range_types);
|
||||||
}
|
}
|
||||||
range_types[ndim++] = create_range_type (NULL, index_type, low, high);
|
range_types[ndim++] = create_range_type (NULL, index_type, low, high);
|
||||||
}
|
}
|
||||||
|
@ -3828,7 +3830,8 @@ dwarf_decode_lines (offset, comp_dir, abfd)
|
||||||
line_ptr += 1;
|
line_ptr += 1;
|
||||||
lh.standard_opcode_lengths = (unsigned char *)
|
lh.standard_opcode_lengths = (unsigned char *)
|
||||||
xmalloc (lh.opcode_base * sizeof (unsigned char));
|
xmalloc (lh.opcode_base * sizeof (unsigned char));
|
||||||
back_to = make_cleanup (free_current_contents, &lh.standard_opcode_lengths);
|
back_to = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&lh.standard_opcode_lengths);
|
||||||
|
|
||||||
lh.standard_opcode_lengths[0] = 1;
|
lh.standard_opcode_lengths[0] = 1;
|
||||||
for (i = 1; i < lh.opcode_base; ++i)
|
for (i = 1; i < lh.opcode_base; ++i)
|
||||||
|
@ -3847,7 +3850,7 @@ dwarf_decode_lines (offset, comp_dir, abfd)
|
||||||
xrealloc (dirs.dirs,
|
xrealloc (dirs.dirs,
|
||||||
(dirs.num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
|
(dirs.num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
|
||||||
if (dirs.num_dirs == 0)
|
if (dirs.num_dirs == 0)
|
||||||
make_cleanup (free_current_contents, &dirs.dirs);
|
make_cleanup ((make_cleanup_func) free_current_contents, &dirs.dirs);
|
||||||
}
|
}
|
||||||
dirs.dirs[dirs.num_dirs++] = cur_dir;
|
dirs.dirs[dirs.num_dirs++] = cur_dir;
|
||||||
}
|
}
|
||||||
|
@ -3864,7 +3867,8 @@ dwarf_decode_lines (offset, comp_dir, abfd)
|
||||||
(files.num_files + FILE_ALLOC_CHUNK)
|
(files.num_files + FILE_ALLOC_CHUNK)
|
||||||
* sizeof (struct fileinfo));
|
* sizeof (struct fileinfo));
|
||||||
if (files.num_files == 0)
|
if (files.num_files == 0)
|
||||||
make_cleanup (free_current_contents, &files.files);
|
make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&files.files);
|
||||||
}
|
}
|
||||||
files.files[files.num_files].name = cur_file;
|
files.files[files.num_files].name = cur_file;
|
||||||
files.files[files.num_files].dir =
|
files.files[files.num_files].dir =
|
||||||
|
@ -3934,7 +3938,8 @@ dwarf_decode_lines (offset, comp_dir, abfd)
|
||||||
(files.num_files + FILE_ALLOC_CHUNK)
|
(files.num_files + FILE_ALLOC_CHUNK)
|
||||||
* sizeof (struct fileinfo));
|
* sizeof (struct fileinfo));
|
||||||
if (files.num_files == 0)
|
if (files.num_files == 0)
|
||||||
make_cleanup (free_current_contents, &files.files);
|
make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&files.files);
|
||||||
}
|
}
|
||||||
files.files[files.num_files].name = cur_file;
|
files.files[files.num_files].name = cur_file;
|
||||||
files.files[files.num_files].dir =
|
files.files[files.num_files].dir =
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* DWARF debugging format support for GDB.
|
/* DWARF debugging format support for GDB.
|
||||||
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996
|
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
Written by Fred Fish at Cygnus Support. Portions based on dbxread.c,
|
Written by Fred Fish at Cygnus Support. Portions based on dbxread.c,
|
||||||
mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
|
mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
|
||||||
|
@ -2452,7 +2452,8 @@ psymtab_to_symtab_1 (pst)
|
||||||
if (DBLENGTH (pst)) /* Otherwise it's a dummy */
|
if (DBLENGTH (pst)) /* Otherwise it's a dummy */
|
||||||
{
|
{
|
||||||
buildsym_init ();
|
buildsym_init ();
|
||||||
old_chain = make_cleanup (really_free_pendings, 0);
|
old_chain = make_cleanup ((make_cleanup_func)
|
||||||
|
really_free_pendings, 0);
|
||||||
read_ofile_symtab (pst);
|
read_ofile_symtab (pst);
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 1991, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
Copyright 1991, 92, 93, 94, 95, 96, 1998 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.
|
||||||
|
@ -591,7 +591,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
|
||||||
CORE_ADDR offset;
|
CORE_ADDR offset;
|
||||||
|
|
||||||
init_minimal_symbol_collection ();
|
init_minimal_symbol_collection ();
|
||||||
back_to = make_cleanup (discard_minimal_symbols, 0);
|
back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
|
||||||
|
|
||||||
memset ((char *) &ei, 0, sizeof (ei));
|
memset ((char *) &ei, 0, sizeof (ei));
|
||||||
|
|
||||||
|
|
|
@ -616,7 +616,7 @@ gdb_eval (clientData, interp, objc, objv)
|
||||||
|
|
||||||
expr = parse_expression (Tcl_GetStringFromObj (objv[1], NULL));
|
expr = parse_expression (Tcl_GetStringFromObj (objv[1], NULL));
|
||||||
|
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
|
|
||||||
val = evaluate_expression (expr);
|
val = evaluate_expression (expr);
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ gdb_load_info (clientData, interp, objc, objv)
|
||||||
Tcl_SetStringObj (result_ptr->obj_ptr, "Open failed", -1);
|
Tcl_SetStringObj (result_ptr->obj_ptr, "Open failed", -1);
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
old_cleanups = make_cleanup (bfd_close, loadfile_bfd);
|
old_cleanups = make_cleanup ((make_cleanup_func) bfd_close, loadfile_bfd);
|
||||||
|
|
||||||
if (!bfd_check_format (loadfile_bfd, bfd_object))
|
if (!bfd_check_format (loadfile_bfd, bfd_object))
|
||||||
{
|
{
|
||||||
|
@ -1370,7 +1370,7 @@ gdb_search (clientData, interp, objc, objv)
|
||||||
|
|
||||||
search_symbols (regexp, space, nfiles, files, &ss);
|
search_symbols (regexp, space, nfiles, files, &ss);
|
||||||
if (ss != NULL)
|
if (ss != NULL)
|
||||||
old_chain = make_cleanup (free_search_symbols, ss);
|
old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, ss);
|
||||||
|
|
||||||
Tcl_SetListObj(result_ptr->obj_ptr, 0, NULL);
|
Tcl_SetListObj(result_ptr->obj_ptr, 0, NULL);
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ gdbtk_init ( argv0 )
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
old_chain = make_cleanup (cleanup_init, 0);
|
old_chain = make_cleanup ((make_cleanup_func) cleanup_init, 0);
|
||||||
|
|
||||||
/* First init tcl and tk. */
|
/* First init tcl and tk. */
|
||||||
Tcl_FindExecutable (argv0);
|
Tcl_FindExecutable (argv0);
|
||||||
|
|
|
@ -142,8 +142,10 @@ char *realloc ();
|
||||||
/* How many characters in the character set. */
|
/* How many characters in the character set. */
|
||||||
# define CHAR_SET_SIZE 256
|
# define CHAR_SET_SIZE 256
|
||||||
|
|
||||||
/* CYGNUS LOCAL: define _REGEX_RE_COMP to get BSD style re_comp and re_exec */
|
/* GDB LOCAL: define _REGEX_RE_COMP to get BSD style re_comp and re_exec */
|
||||||
|
#ifndef _REGEX_RE_COMP
|
||||||
#define _REGEX_RE_COMP
|
#define _REGEX_RE_COMP
|
||||||
|
#endif
|
||||||
|
|
||||||
# ifdef SYNTAX_TABLE
|
# ifdef SYNTAX_TABLE
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,11 @@ extern "C" {
|
||||||
# include <stddef.h>
|
# include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* GDB LOCAL: define _REGEX_RE_COMP to get BSD style re_comp and re_exec */
|
||||||
|
#ifndef _REGEX_RE_COMP
|
||||||
|
#define _REGEX_RE_COMP
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The following two types have to be signed and unsigned integer type
|
/* The following two types have to be signed and unsigned integer type
|
||||||
wide enough to hold a value of a pointer. For most ANSI compilers
|
wide enough to hold a value of a pointer. For most ANSI compilers
|
||||||
ptrdiff_t and size_t should be likely OK. Still size of these two
|
ptrdiff_t and size_t should be likely OK. Still size of these two
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Read NLM (NetWare Loadable Module) format executable files for GDB.
|
/* Read NLM (NetWare Loadable Module) format executable files for GDB.
|
||||||
Copyright 1993, 1994 Free Software Foundation, Inc.
|
Copyright 1993, 1994, 1998 Free Software Foundation, Inc.
|
||||||
Written by Fred Fish at Cygnus Support (fnf@cygnus.com).
|
Written by Fred Fish at Cygnus Support (fnf@cygnus.com).
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -190,7 +190,7 @@ nlm_symfile_read (objfile, section_offsets, mainline)
|
||||||
struct symbol *mainsym;
|
struct symbol *mainsym;
|
||||||
|
|
||||||
init_minimal_symbol_collection ();
|
init_minimal_symbol_collection ();
|
||||||
back_to = make_cleanup (discard_minimal_symbols, 0);
|
back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
|
||||||
|
|
||||||
/* FIXME, should take a section_offsets param, not just an offset. */
|
/* FIXME, should take a section_offsets param, not just an offset. */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Read os9/os9k symbol tables and convert to internal format, for GDB.
|
/* Read os9/os9k symbol tables and convert to internal format, for GDB.
|
||||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996
|
Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 96, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -333,9 +333,9 @@ os9k_symfile_read (objfile, section_offsets, mainline)
|
||||||
init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
|
init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
|
||||||
|
|
||||||
free_pending_blocks ();
|
free_pending_blocks ();
|
||||||
back_to = make_cleanup (really_free_pendings, 0);
|
back_to = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
|
||||||
|
|
||||||
make_cleanup (discard_minimal_symbols, 0);
|
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
|
||||||
read_minimal_symbols (objfile, section_offsets);
|
read_minimal_symbols (objfile, section_offsets);
|
||||||
|
|
||||||
/* Now that the symbol table data of the executable file are all in core,
|
/* Now that the symbol table data of the executable file are all in core,
|
||||||
|
@ -1209,7 +1209,7 @@ os9k_psymtab_to_symtab_1 (pst)
|
||||||
/* Init stuff necessary for reading in symbols */
|
/* Init stuff necessary for reading in symbols */
|
||||||
stabsread_init ();
|
stabsread_init ();
|
||||||
buildsym_init ();
|
buildsym_init ();
|
||||||
old_chain = make_cleanup (really_free_pendings, 0);
|
old_chain = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
|
||||||
|
|
||||||
/* Read in this file's symbols */
|
/* Read in this file's symbols */
|
||||||
os9k_read_ofile_symtab (pst);
|
os9k_read_ofile_symtab (pst);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Parse expressions for GDB.
|
/* Parse expressions for GDB.
|
||||||
Copyright (C) 1986, 1989, 1990, 1991, 1994 Free Software Foundation, Inc.
|
Copyright (C) 1986, 89, 90, 91, 94, 1998 Free Software Foundation, Inc.
|
||||||
Modified from expread.y by the Department of Computer Science at the
|
Modified from expread.y by the Department of Computer Science at the
|
||||||
State University of New York at Buffalo, 1991.
|
State University of New York at Buffalo, 1991.
|
||||||
|
|
||||||
|
@ -886,7 +886,7 @@ parse_exp_1 (stringptr, block, comma)
|
||||||
if (lexptr == 0 || *lexptr == 0)
|
if (lexptr == 0 || *lexptr == 0)
|
||||||
error_no_arg ("expression to compute");
|
error_no_arg ("expression to compute");
|
||||||
|
|
||||||
old_chain = make_cleanup (free_funcalls, 0);
|
old_chain = make_cleanup ((make_cleanup_func) free_funcalls, 0);
|
||||||
funcall_chain = 0;
|
funcall_chain = 0;
|
||||||
|
|
||||||
expression_context_block = block ? block : get_selected_block ();
|
expression_context_block = block ? block : get_selected_block ();
|
||||||
|
@ -897,7 +897,7 @@ parse_exp_1 (stringptr, block, comma)
|
||||||
expout = (struct expression *)
|
expout = (struct expression *)
|
||||||
xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size));
|
xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size));
|
||||||
expout->language_defn = current_language;
|
expout->language_defn = current_language;
|
||||||
make_cleanup (free_current_contents, &expout);
|
make_cleanup ((make_cleanup_func) free_current_contents, &expout);
|
||||||
|
|
||||||
if (current_language->la_parser ())
|
if (current_language->la_parser ())
|
||||||
current_language->la_error (NULL);
|
current_language->la_error (NULL);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Print values for GNU debugger GDB.
|
/* Print values for GNU debugger GDB.
|
||||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1995
|
Copyright 1986, 87, 88, 89, 90, 91, 93, 94, 95, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -175,6 +175,8 @@ static struct format_data decode_format PARAMS ((char **, int, int));
|
||||||
|
|
||||||
static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
|
static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
|
||||||
|
|
||||||
|
static void sym_info PARAMS ((char *, int));
|
||||||
|
|
||||||
|
|
||||||
/* Decode a format specification. *STRING_PTR should point to it.
|
/* Decode a format specification. *STRING_PTR should point to it.
|
||||||
OFORMAT and OSIZE are used as defaults for the format and size
|
OFORMAT and OSIZE are used as defaults for the format and size
|
||||||
|
@ -830,7 +832,8 @@ print_command_1 (exp, inspect, voidprint)
|
||||||
extern int objectprint;
|
extern int objectprint;
|
||||||
struct type *type;
|
struct type *type;
|
||||||
expr = parse_expression (exp);
|
expr = parse_expression (exp);
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&expr);
|
||||||
cleanup = 1;
|
cleanup = 1;
|
||||||
val = evaluate_expression (expr);
|
val = evaluate_expression (expr);
|
||||||
|
|
||||||
|
@ -943,7 +946,7 @@ output_command (exp, from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
expr = parse_expression (exp);
|
expr = parse_expression (exp);
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
|
|
||||||
val = evaluate_expression (expr);
|
val = evaluate_expression (expr);
|
||||||
|
|
||||||
|
@ -964,7 +967,7 @@ set_command (exp, from_tty)
|
||||||
{
|
{
|
||||||
struct expression *expr = parse_expression (exp);
|
struct expression *expr = parse_expression (exp);
|
||||||
register struct cleanup *old_chain
|
register struct cleanup *old_chain
|
||||||
= make_cleanup (free_current_contents, &expr);
|
= make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
evaluate_expression (expr);
|
evaluate_expression (expr);
|
||||||
do_cleanups (old_chain);
|
do_cleanups (old_chain);
|
||||||
}
|
}
|
||||||
|
@ -1241,7 +1244,8 @@ x_command (exp, from_tty)
|
||||||
But don't clobber a user-defined command's definition. */
|
But don't clobber a user-defined command's definition. */
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
*exp = 0;
|
*exp = 0;
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&expr);
|
||||||
val = evaluate_expression (expr);
|
val = evaluate_expression (expr);
|
||||||
if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
|
if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
|
||||||
val = value_ind (val);
|
val = value_ind (val);
|
||||||
|
@ -1928,7 +1932,8 @@ printf_command (arg, from_tty)
|
||||||
struct cleanup *old_cleanups;
|
struct cleanup *old_cleanups;
|
||||||
|
|
||||||
val_args = (value_ptr *) xmalloc (allocated_args * sizeof (value_ptr));
|
val_args = (value_ptr *) xmalloc (allocated_args * sizeof (value_ptr));
|
||||||
old_cleanups = make_cleanup (free_current_contents, &val_args);
|
old_cleanups = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&val_args);
|
||||||
|
|
||||||
if (s == 0)
|
if (s == 0)
|
||||||
error_no_arg ("format-control string and values to print");
|
error_no_arg ("format-control string and values to print");
|
||||||
|
@ -2198,7 +2203,6 @@ disassemble_command (arg, from_tty)
|
||||||
char *name;
|
char *name;
|
||||||
CORE_ADDR pc, pc_masked;
|
CORE_ADDR pc, pc_masked;
|
||||||
char *space_index;
|
char *space_index;
|
||||||
asection *section;
|
|
||||||
|
|
||||||
name = NULL;
|
name = NULL;
|
||||||
if (!arg)
|
if (!arg)
|
||||||
|
|
151
gdb/symtab.h
151
gdb/symtab.h
|
@ -1,5 +1,6 @@
|
||||||
/* Symbol table definitions for GDB.
|
/* Symbol table definitions for GDB.
|
||||||
Copyright 1986, 1989, 1991, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 1998
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
@ -27,6 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#define obstack_chunk_free free
|
#define obstack_chunk_free free
|
||||||
#include "bcache.h"
|
#include "bcache.h"
|
||||||
|
|
||||||
|
#include "gnu-regex.h"
|
||||||
|
|
||||||
/* Don't do this; it means that if some .o's are compiled with GNU C
|
/* Don't do this; it means that if some .o's are compiled with GNU C
|
||||||
and some are not (easy to do accidentally the way we configure
|
and some are not (easy to do accidentally the way we configure
|
||||||
things; also it is a pain to have to "make clean" every time you
|
things; also it is a pain to have to "make clean" every time you
|
||||||
|
@ -84,7 +87,10 @@ struct general_symbol_info
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct cplus_specific /* For C++ and Java */
|
struct cplus_specific /* For C++ */
|
||||||
|
/* start-sanitize-java */
|
||||||
|
/* and Java */
|
||||||
|
/* end-sanitize-java */
|
||||||
{
|
{
|
||||||
char *demangled_name;
|
char *demangled_name;
|
||||||
} cplus_specific;
|
} cplus_specific;
|
||||||
|
@ -136,7 +142,10 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
|
||||||
do { \
|
do { \
|
||||||
SYMBOL_LANGUAGE (symbol) = language; \
|
SYMBOL_LANGUAGE (symbol) = language; \
|
||||||
if (SYMBOL_LANGUAGE (symbol) == language_cplus \
|
if (SYMBOL_LANGUAGE (symbol) == language_cplus \
|
||||||
|| SYMBOL_LANGUAGE (symbol) == language_java) \
|
/* start-sanitize-java */ \
|
||||||
|
|| SYMBOL_LANGUAGE (symbol) == language_java \
|
||||||
|
/* end-sanitize-java */ \
|
||||||
|
) \
|
||||||
{ \
|
{ \
|
||||||
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
|
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
|
||||||
} \
|
} \
|
||||||
|
@ -180,6 +189,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
|
||||||
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
|
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
/* start-sanitize-java */ \
|
||||||
if (SYMBOL_LANGUAGE (symbol) == language_java) \
|
if (SYMBOL_LANGUAGE (symbol) == language_java) \
|
||||||
{ \
|
{ \
|
||||||
demangled = \
|
demangled = \
|
||||||
|
@ -197,6 +207,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
|
||||||
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
|
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
/* end-sanitize-java */ \
|
||||||
if (demangled == NULL \
|
if (demangled == NULL \
|
||||||
&& (SYMBOL_LANGUAGE (symbol) == language_chill \
|
&& (SYMBOL_LANGUAGE (symbol) == language_chill \
|
||||||
|| SYMBOL_LANGUAGE (symbol) == language_auto)) \
|
|| SYMBOL_LANGUAGE (symbol) == language_auto)) \
|
||||||
|
@ -226,7 +237,9 @@ extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *));
|
||||||
|
|
||||||
#define SYMBOL_DEMANGLED_NAME(symbol) \
|
#define SYMBOL_DEMANGLED_NAME(symbol) \
|
||||||
(SYMBOL_LANGUAGE (symbol) == language_cplus \
|
(SYMBOL_LANGUAGE (symbol) == language_cplus \
|
||||||
|
/* start-sanitize-java */ \
|
||||||
|| SYMBOL_LANGUAGE (symbol) == language_java \
|
|| SYMBOL_LANGUAGE (symbol) == language_java \
|
||||||
|
/* end-sanitize-java */ \
|
||||||
? SYMBOL_CPLUS_DEMANGLED_NAME (symbol) \
|
? SYMBOL_CPLUS_DEMANGLED_NAME (symbol) \
|
||||||
: (SYMBOL_LANGUAGE (symbol) == language_chill \
|
: (SYMBOL_LANGUAGE (symbol) == language_chill \
|
||||||
? SYMBOL_CHILL_DEMANGLED_NAME (symbol) \
|
? SYMBOL_CHILL_DEMANGLED_NAME (symbol) \
|
||||||
|
@ -300,14 +313,17 @@ struct minimal_symbol
|
||||||
|
|
||||||
struct general_symbol_info ginfo;
|
struct general_symbol_info ginfo;
|
||||||
|
|
||||||
/* The info field is available for caching machine-specific information that
|
/* The info field is available for caching machine-specific information
|
||||||
The AMD 29000 tdep.c uses it to remember things it has decoded from the
|
so it doesn't have to rederive the info constantly (over a serial line).
|
||||||
instructions in the function header, so it doesn't have to rederive the
|
It is initialized to zero and stays that way until target-dependent code
|
||||||
info constantly (over a serial line). It is initialized to zero and
|
sets it. Storage for any data pointed to by this field should be allo-
|
||||||
stays that way until target-dependent code sets it. Storage for any data
|
cated on the symbol_obstack for the associated objfile.
|
||||||
pointed to by this field should be allocated on the symbol_obstack for
|
The type would be "void *" except for reasons of compatibility with older
|
||||||
the associated objfile. The type would be "void *" except for reasons
|
compilers. This field is optional.
|
||||||
of compatibility with older compilers. This field is optional. */
|
|
||||||
|
Currently, the AMD 29000 tdep.c uses it to remember things it has decoded
|
||||||
|
from the instructions in the function header, and the MIPS-16 code uses
|
||||||
|
it to identify 16-bit procedures. */
|
||||||
|
|
||||||
char *info;
|
char *info;
|
||||||
|
|
||||||
|
@ -481,7 +497,24 @@ typedef enum
|
||||||
/* LABEL_NAMESPACE may be used for names of labels (for gotos);
|
/* LABEL_NAMESPACE may be used for names of labels (for gotos);
|
||||||
currently it is not used and labels are not recorded at all. */
|
currently it is not used and labels are not recorded at all. */
|
||||||
|
|
||||||
LABEL_NAMESPACE
|
LABEL_NAMESPACE,
|
||||||
|
|
||||||
|
/* Searching namespaces. These overlap with VAR_NAMESPACE, providing
|
||||||
|
some granularity with the search_symbols function. */
|
||||||
|
|
||||||
|
/* Everything in VAR_NAMESPACE minus FUNCTIONS_-, TYPES_-, and
|
||||||
|
METHODS_NAMESPACE */
|
||||||
|
VARIABLES_NAMESPACE,
|
||||||
|
|
||||||
|
/* All functions -- for some reason not methods, though. */
|
||||||
|
FUNCTIONS_NAMESPACE,
|
||||||
|
|
||||||
|
/* All defined types */
|
||||||
|
TYPES_NAMESPACE,
|
||||||
|
|
||||||
|
/* All class methods -- why is this separated out? */
|
||||||
|
METHODS_NAMESPACE
|
||||||
|
|
||||||
} namespace_enum;
|
} namespace_enum;
|
||||||
|
|
||||||
/* An address-class says where to find the value of a symbol. */
|
/* An address-class says where to find the value of a symbol. */
|
||||||
|
@ -605,13 +638,20 @@ enum address_class
|
||||||
|
|
||||||
/* Linked list of symbol's live ranges. */
|
/* Linked list of symbol's live ranges. */
|
||||||
|
|
||||||
struct live_range
|
struct range_list
|
||||||
{
|
{
|
||||||
CORE_ADDR start;
|
CORE_ADDR start;
|
||||||
CORE_ADDR end;
|
CORE_ADDR end;
|
||||||
struct live_range *next;
|
struct range_list *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Linked list of aliases for a particular main/primary symbol. */
|
||||||
|
struct alias_list
|
||||||
|
{
|
||||||
|
struct symbol *sym;
|
||||||
|
struct alias_list *next;
|
||||||
|
};
|
||||||
|
|
||||||
struct symbol
|
struct symbol
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -652,34 +692,24 @@ struct symbol
|
||||||
}
|
}
|
||||||
aux_value;
|
aux_value;
|
||||||
|
|
||||||
/* Live range information (if present) for debugging of optimized code.
|
|
||||||
Gcc extensions were added to stabs to encode live range information.
|
/* Link to a list of aliases for this symbol.
|
||||||
The syntax for referencing (defining) symbol aliases is "#n" ("#n=")
|
Only a "primary/main symbol may have aliases. */
|
||||||
where n is a number. The syntax for specifying a range is "l(#<m>,#<n>)",
|
struct alias_list *aliases;
|
||||||
where m and n are numbers.
|
|
||||||
aliases - list of other symbols which are lexically the same symbol,
|
/* List of ranges where this symbol is active. This is only
|
||||||
but were optimized into different storage classes (eg. for the
|
used by alias symbols at the current time. */
|
||||||
local symbol "x", one symbol contains range information where x
|
struct range_list *ranges;
|
||||||
is on the stack, while an alias contains the live ranges where x
|
|
||||||
is in a register).
|
|
||||||
range - list of instruction ranges where the symbol is live. */
|
|
||||||
struct live_range_info
|
|
||||||
{
|
|
||||||
struct symbol *aliases; /* Link to other aliases for this symbol. */
|
|
||||||
struct live_range *range; /* Linked list of live ranges. */
|
|
||||||
} live;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define SYMBOL_NAMESPACE(symbol) (symbol)->namespace
|
#define SYMBOL_NAMESPACE(symbol) (symbol)->namespace
|
||||||
#define SYMBOL_CLASS(symbol) (symbol)->aclass
|
#define SYMBOL_CLASS(symbol) (symbol)->aclass
|
||||||
#define SYMBOL_TYPE(symbol) (symbol)->type
|
#define SYMBOL_TYPE(symbol) (symbol)->type
|
||||||
#define SYMBOL_LINE(symbol) (symbol)->line
|
#define SYMBOL_LINE(symbol) (symbol)->line
|
||||||
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
|
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
|
||||||
#define SYMBOL_ALIASES(symbol) (symbol)->live.aliases
|
#define SYMBOL_ALIASES(symbol) (symbol)->aliases
|
||||||
#define SYMBOL_RANGE(symbol) (symbol)->live.range
|
#define SYMBOL_RANGES(symbol) (symbol)->ranges
|
||||||
#define SYMBOL_RANGE_START(symbol) (symbol)->live.range->start
|
|
||||||
#define SYMBOL_RANGE_END(symbol) (symbol)->live.range->end
|
|
||||||
#define SYMBOL_RANGE_NEXT(symbol) (symbol)->live.range->next
|
|
||||||
|
|
||||||
/* A partial_symbol records the name, namespace, and address class of
|
/* A partial_symbol records the name, namespace, and address class of
|
||||||
symbols whose types we have not parsed yet. For functions, it also
|
symbols whose types we have not parsed yet. For functions, it also
|
||||||
|
@ -877,14 +907,6 @@ struct symtab
|
||||||
|
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
|
|
||||||
/* Anything extra for this symtab. This is for target machines
|
|
||||||
with special debugging info of some sort (which cannot just
|
|
||||||
be represented in a normal symtab). */
|
|
||||||
|
|
||||||
#if defined (EXTRA_SYMTAB_INFO)
|
|
||||||
EXTRA_SYMTAB_INFO
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BLOCKVECTOR(symtab) (symtab)->blockvector
|
#define BLOCKVECTOR(symtab) (symtab)->blockvector
|
||||||
|
@ -1098,12 +1120,17 @@ find_pc_sect_function PARAMS ((CORE_ADDR, asection *));
|
||||||
|
|
||||||
/* lookup function from address, return name, start addr and end addr */
|
/* lookup function from address, return name, start addr and end addr */
|
||||||
|
|
||||||
extern int find_pc_partial_function PARAMS ((CORE_ADDR, char **,
|
extern int
|
||||||
|
find_pc_partial_function PARAMS ((CORE_ADDR, char **,
|
||||||
CORE_ADDR *, CORE_ADDR *));
|
CORE_ADDR *, CORE_ADDR *));
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
clear_pc_function_cache PARAMS ((void));
|
clear_pc_function_cache PARAMS ((void));
|
||||||
|
|
||||||
|
extern int
|
||||||
|
find_pc_sect_partial_function PARAMS ((CORE_ADDR, asection *,
|
||||||
|
char **, CORE_ADDR *, CORE_ADDR *));
|
||||||
|
|
||||||
/* from symtab.c: */
|
/* from symtab.c: */
|
||||||
|
|
||||||
/* lookup partial symbol table by filename */
|
/* lookup partial symbol table by filename */
|
||||||
|
@ -1263,8 +1290,8 @@ find_addr_symbol PARAMS ((CORE_ADDR, struct symtab **, CORE_ADDR *));
|
||||||
|
|
||||||
/* Given a symtab and line number, return the pc there. */
|
/* Given a symtab and line number, return the pc there. */
|
||||||
|
|
||||||
extern CORE_ADDR
|
extern int
|
||||||
find_line_pc PARAMS ((struct symtab *, int));
|
find_line_pc PARAMS ((struct symtab *, int, CORE_ADDR *));
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
find_line_pc_range PARAMS ((struct symtab_and_line,
|
find_line_pc_range PARAMS ((struct symtab_and_line,
|
||||||
|
@ -1341,6 +1368,8 @@ select_source_symtab PARAMS ((struct symtab *));
|
||||||
|
|
||||||
extern char **make_symbol_completion_list PARAMS ((char *, char *));
|
extern char **make_symbol_completion_list PARAMS ((char *, char *));
|
||||||
|
|
||||||
|
extern void _initialize_source PARAMS ((void));
|
||||||
|
|
||||||
/* symtab.c */
|
/* symtab.c */
|
||||||
|
|
||||||
extern struct partial_symtab *
|
extern struct partial_symtab *
|
||||||
|
@ -1351,10 +1380,10 @@ find_main_psymtab PARAMS ((void));
|
||||||
extern struct blockvector *
|
extern struct blockvector *
|
||||||
blockvector_for_pc PARAMS ((CORE_ADDR, int *));
|
blockvector_for_pc PARAMS ((CORE_ADDR, int *));
|
||||||
|
|
||||||
|
|
||||||
extern struct blockvector *
|
extern struct blockvector *
|
||||||
blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *,
|
blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *,
|
||||||
struct symtab *));
|
struct symtab *));
|
||||||
|
|
||||||
/* symfile.c */
|
/* symfile.c */
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
|
@ -1371,4 +1400,32 @@ in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start));
|
||||||
extern struct symbol *
|
extern struct symbol *
|
||||||
fixup_symbol_section PARAMS ((struct symbol *, struct objfile *));
|
fixup_symbol_section PARAMS ((struct symbol *, struct objfile *));
|
||||||
|
|
||||||
|
/* Symbol searching */
|
||||||
|
|
||||||
|
/* When using search_symbols, a list of the following structs is returned.
|
||||||
|
Callers must free the search list using free_symbol_search! */
|
||||||
|
struct symbol_search
|
||||||
|
{
|
||||||
|
/* The block in which the match was found. Could be, for example,
|
||||||
|
STATIC_BLOCK or GLOBAL_BLOCK. */
|
||||||
|
int block;
|
||||||
|
|
||||||
|
/* Information describing what was found.
|
||||||
|
|
||||||
|
If symtab abd symbol are NOT NULL, then information was found
|
||||||
|
for this match. */
|
||||||
|
struct symtab *symtab;
|
||||||
|
struct symbol *symbol;
|
||||||
|
|
||||||
|
/* If msymbol is non-null, then a match was made on something for
|
||||||
|
which only minimal_symbols exist. */
|
||||||
|
struct minimal_symbol *msymbol;
|
||||||
|
|
||||||
|
/* A link to the next match, or NULL for the end. */
|
||||||
|
struct symbol_search *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void search_symbols PARAMS ((char *, namespace_enum, int, char **, struct symbol_search **));
|
||||||
|
extern void free_search_symbols PARAMS ((struct symbol_search *));
|
||||||
|
|
||||||
#endif /* !defined(SYMTAB_H) */
|
#endif /* !defined(SYMTAB_H) */
|
||||||
|
|
|
@ -417,7 +417,8 @@ thread_apply_all_command (cmd, from_tty)
|
||||||
if (cmd == NULL || *cmd == '\000')
|
if (cmd == NULL || *cmd == '\000')
|
||||||
error ("Please specify a command following the thread ID list");
|
error ("Please specify a command following the thread ID list");
|
||||||
|
|
||||||
old_chain = make_cleanup (restore_current_thread, inferior_pid);
|
old_chain = make_cleanup ((make_cleanup_func) restore_current_thread,
|
||||||
|
(void *) inferior_pid);
|
||||||
|
|
||||||
for (tp = thread_list; tp; tp = tp->next)
|
for (tp = thread_list; tp; tp = tp->next)
|
||||||
if (thread_alive (tp))
|
if (thread_alive (tp))
|
||||||
|
@ -446,7 +447,8 @@ thread_apply_command (tidlist, from_tty)
|
||||||
if (*cmd == '\000')
|
if (*cmd == '\000')
|
||||||
error ("Please specify a command following the thread ID list");
|
error ("Please specify a command following the thread ID list");
|
||||||
|
|
||||||
old_chain = make_cleanup (restore_current_thread, inferior_pid);
|
old_chain = make_cleanup ((make_cleanup_func) restore_current_thread,
|
||||||
|
(void *) inferior_pid);
|
||||||
|
|
||||||
while (tidlist < cmd)
|
while (tidlist < cmd)
|
||||||
{
|
{
|
||||||
|
|
28
gdb/top.c
28
gdb/top.c
|
@ -641,7 +641,7 @@ read_command_file (stream)
|
||||||
{
|
{
|
||||||
struct cleanup *cleanups;
|
struct cleanup *cleanups;
|
||||||
|
|
||||||
cleanups = make_cleanup (source_cleanup, instream);
|
cleanups = make_cleanup ((make_cleanup_func) source_cleanup, instream);
|
||||||
instream = stream;
|
instream = stream;
|
||||||
command_loop ();
|
command_loop ();
|
||||||
do_cleanups (cleanups);
|
do_cleanups (cleanups);
|
||||||
|
@ -722,7 +722,7 @@ get_command_line (type, arg)
|
||||||
/* Allocate and build a new command line structure. */
|
/* Allocate and build a new command line structure. */
|
||||||
cmd = build_command_line (type, arg);
|
cmd = build_command_line (type, arg);
|
||||||
|
|
||||||
old_chain = make_cleanup (free_command_lines, &cmd);
|
old_chain = make_cleanup ((make_cleanup_func) free_command_lines, &cmd);
|
||||||
|
|
||||||
/* Read in the body of this command. */
|
/* Read in the body of this command. */
|
||||||
if (recurse_read_control_structure (cmd) == invalid_control)
|
if (recurse_read_control_structure (cmd) == invalid_control)
|
||||||
|
@ -839,7 +839,8 @@ execute_control_command (cmd)
|
||||||
new_line = insert_args (cmd->line);
|
new_line = insert_args (cmd->line);
|
||||||
if (!new_line)
|
if (!new_line)
|
||||||
return invalid_control;
|
return invalid_control;
|
||||||
old_chain = make_cleanup (free_current_contents, &new_line);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&new_line);
|
||||||
execute_command (new_line, 0);
|
execute_command (new_line, 0);
|
||||||
ret = cmd->control_type;
|
ret = cmd->control_type;
|
||||||
break;
|
break;
|
||||||
|
@ -857,9 +858,10 @@ execute_control_command (cmd)
|
||||||
new_line = insert_args (cmd->line);
|
new_line = insert_args (cmd->line);
|
||||||
if (!new_line)
|
if (!new_line)
|
||||||
return invalid_control;
|
return invalid_control;
|
||||||
old_chain = make_cleanup (free_current_contents, &new_line);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&new_line);
|
||||||
expr = parse_expression (new_line);
|
expr = parse_expression (new_line);
|
||||||
make_cleanup (free_current_contents, &expr);
|
make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
|
|
||||||
ret = simple_control;
|
ret = simple_control;
|
||||||
loop = 1;
|
loop = 1;
|
||||||
|
@ -917,10 +919,11 @@ execute_control_command (cmd)
|
||||||
new_line = insert_args (cmd->line);
|
new_line = insert_args (cmd->line);
|
||||||
if (!new_line)
|
if (!new_line)
|
||||||
return invalid_control;
|
return invalid_control;
|
||||||
old_chain = make_cleanup (free_current_contents, &new_line);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&new_line);
|
||||||
/* Parse the conditional for the if statement. */
|
/* Parse the conditional for the if statement. */
|
||||||
expr = parse_expression (new_line);
|
expr = parse_expression (new_line);
|
||||||
make_cleanup (free_current_contents, &expr);
|
make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
|
|
||||||
current = NULL;
|
current = NULL;
|
||||||
ret = simple_control;
|
ret = simple_control;
|
||||||
|
@ -1033,7 +1036,7 @@ setup_user_args (p)
|
||||||
args->next = user_args;
|
args->next = user_args;
|
||||||
user_args = args;
|
user_args = args;
|
||||||
|
|
||||||
old_chain = make_cleanup (arg_cleanup, 0);
|
old_chain = make_cleanup ((make_cleanup_func) arg_cleanup, 0);
|
||||||
|
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return old_chain;
|
return old_chain;
|
||||||
|
@ -1197,7 +1200,7 @@ execute_user_command (c, args)
|
||||||
|
|
||||||
/* Set the instream to 0, indicating execution of a
|
/* Set the instream to 0, indicating execution of a
|
||||||
user-defined function. */
|
user-defined function. */
|
||||||
old_chain = make_cleanup (source_cleanup, instream);
|
old_chain = make_cleanup ((make_cleanup_func) source_cleanup, instream);
|
||||||
instream = (FILE *) 0;
|
instream = (FILE *) 0;
|
||||||
while (cmdlines)
|
while (cmdlines)
|
||||||
{
|
{
|
||||||
|
@ -1331,7 +1334,7 @@ command_loop ()
|
||||||
quit_flag = 0;
|
quit_flag = 0;
|
||||||
if (instream == stdin && stdin_is_tty)
|
if (instream == stdin && stdin_is_tty)
|
||||||
reinitialize_more_filter ();
|
reinitialize_more_filter ();
|
||||||
old_chain = make_cleanup (command_loop_marker, 0);
|
old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0);
|
||||||
command = command_line_input (instream == stdin ? prompt : (char *) NULL,
|
command = command_line_input (instream == stdin ? prompt : (char *) NULL,
|
||||||
instream == stdin, "prompt");
|
instream == stdin, "prompt");
|
||||||
if (command == 0)
|
if (command == 0)
|
||||||
|
@ -2502,7 +2505,8 @@ int from_tty;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
head = next;
|
head = next;
|
||||||
old_chain = make_cleanup (free_command_lines, &head);
|
old_chain = make_cleanup ((make_cleanup_func) free_command_lines,
|
||||||
|
&head);
|
||||||
}
|
}
|
||||||
tail = next;
|
tail = next;
|
||||||
}
|
}
|
||||||
|
@ -3110,7 +3114,7 @@ source_command (args, from_tty)
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
make_cleanup (fclose, stream);
|
make_cleanup ((make_cleanup_func) fclose, stream);
|
||||||
|
|
||||||
old_lines.old_line = source_line_number;
|
old_lines.old_line = source_line_number;
|
||||||
old_lines.old_file = source_file_name;
|
old_lines.old_file = source_file_name;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Tracing functionality for remote targets in custom GDB protocol
|
/* Tracing functionality for remote targets in custom GDB protocol
|
||||||
Copyright 1997 Free Software Foundation, Inc.
|
Copyright 1997, 1998 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
@ -847,7 +847,7 @@ read_actions (t)
|
||||||
if (job_control)
|
if (job_control)
|
||||||
signal (STOP_SIGNAL, stop_sig);
|
signal (STOP_SIGNAL, stop_sig);
|
||||||
#endif
|
#endif
|
||||||
old_chain = make_cleanup (free_actions, (void *) t);
|
old_chain = make_cleanup ((make_cleanup_func) free_actions, (void *) t);
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* Make sure that all output has been output. Some machines may let
|
/* Make sure that all output has been output. Some machines may let
|
||||||
|
@ -969,7 +969,8 @@ validate_actionline (line, t)
|
||||||
/* else fall thru, treat p as an expression and parse it! */
|
/* else fall thru, treat p as an expression and parse it! */
|
||||||
}
|
}
|
||||||
exp = parse_exp_1 (&p, block_for_pc (t->address), 1);
|
exp = parse_exp_1 (&p, block_for_pc (t->address), 1);
|
||||||
old_chain = make_cleanup (free_current_contents, &exp);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&exp);
|
||||||
|
|
||||||
if (exp->elts[0].opcode == OP_VAR_VALUE)
|
if (exp->elts[0].opcode == OP_VAR_VALUE)
|
||||||
if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
|
if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST)
|
||||||
|
@ -989,7 +990,7 @@ validate_actionline (line, t)
|
||||||
/* we have something to collect, make sure that the expr to
|
/* we have something to collect, make sure that the expr to
|
||||||
bytecode translator can handle it and that it's not too long */
|
bytecode translator can handle it and that it's not too long */
|
||||||
aexpr = gen_trace_for_expr(exp);
|
aexpr = gen_trace_for_expr(exp);
|
||||||
(void) make_cleanup (free_agent_expr, aexpr);
|
(void) make_cleanup ((make_cleanup_func) free_agent_expr, aexpr);
|
||||||
|
|
||||||
if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
if (aexpr->len > MAX_AGENT_EXPR_LEN)
|
||||||
error ("expression too complicated, try simplifying");
|
error ("expression too complicated, try simplifying");
|
||||||
|
@ -1522,7 +1523,8 @@ encode_actions (t, tdp_actions, stepping_actions)
|
||||||
struct agent_reqs areqs;
|
struct agent_reqs areqs;
|
||||||
|
|
||||||
exp = parse_exp_1 (&action_exp, block_for_pc (t->address), 1);
|
exp = parse_exp_1 (&action_exp, block_for_pc (t->address), 1);
|
||||||
old_chain = make_cleanup (free_current_contents, &exp);
|
old_chain = make_cleanup ((make_cleanup_func)
|
||||||
|
free_current_contents, &exp);
|
||||||
|
|
||||||
switch (exp->elts[0].opcode) {
|
switch (exp->elts[0].opcode) {
|
||||||
case OP_REGISTER:
|
case OP_REGISTER:
|
||||||
|
@ -1547,7 +1549,8 @@ encode_actions (t, tdp_actions, stepping_actions)
|
||||||
default: /* full-fledged expression */
|
default: /* full-fledged expression */
|
||||||
aexpr = gen_trace_for_expr (exp);
|
aexpr = gen_trace_for_expr (exp);
|
||||||
|
|
||||||
old_chain1 = make_cleanup (free_agent_expr, aexpr);
|
old_chain1 = make_cleanup ((make_cleanup_func)
|
||||||
|
free_agent_expr, aexpr);
|
||||||
|
|
||||||
ax_reqs (aexpr, &areqs);
|
ax_reqs (aexpr, &areqs);
|
||||||
if (areqs.flaw != agent_flaw_none)
|
if (areqs.flaw != agent_flaw_none)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Language independent support for printing types for GDB, the GNU debugger.
|
/* Language independent support for printing types for GDB, the GNU debugger.
|
||||||
Copyright 1986, 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright 1986, 88, 89, 91, 92, 93, 1998 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
@ -78,7 +78,8 @@ whatis_exp (exp, show)
|
||||||
if (exp)
|
if (exp)
|
||||||
{
|
{
|
||||||
expr = parse_expression (exp);
|
expr = parse_expression (exp);
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&expr);
|
||||||
val = evaluate_type (expr);
|
val = evaluate_type (expr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -140,7 +141,8 @@ ptype_command (typename, from_tty)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
expr = parse_expression (typename);
|
expr = parse_expression (typename);
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
|
||||||
|
&expr);
|
||||||
type = ptype_eval (expr);
|
type = ptype_eval (expr);
|
||||||
if (type != NULL)
|
if (type != NULL)
|
||||||
{
|
{
|
||||||
|
@ -262,7 +264,7 @@ maintenance_print_type (typename, from_tty)
|
||||||
if (typename != NULL)
|
if (typename != NULL)
|
||||||
{
|
{
|
||||||
expr = parse_expression (typename);
|
expr = parse_expression (typename);
|
||||||
old_chain = make_cleanup (free_current_contents, &expr);
|
old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
|
||||||
if (expr -> elts[0].opcode == OP_TYPE)
|
if (expr -> elts[0].opcode == OP_TYPE)
|
||||||
{
|
{
|
||||||
/* The user expression names a type directly, just use that type. */
|
/* The user expression names a type directly, just use that type. */
|
||||||
|
|
35
gdb/value.h
35
gdb/value.h
|
@ -101,6 +101,8 @@ struct value
|
||||||
/* If nonzero, this is the value of a variable which does not
|
/* If nonzero, this is the value of a variable which does not
|
||||||
actually exist in the program. */
|
actually exist in the program. */
|
||||||
char optimized_out;
|
char optimized_out;
|
||||||
|
/* The BFD section associated with this value. */
|
||||||
|
asection *bfd_section;
|
||||||
/* Actual contents of the value. For use of this value; setting
|
/* Actual contents of the value. For use of this value; setting
|
||||||
it uses the stuff above. Not valid if lazy is nonzero.
|
it uses the stuff above. Not valid if lazy is nonzero.
|
||||||
Target byte-order. We force it to be aligned properly for any
|
Target byte-order. We force it to be aligned properly for any
|
||||||
|
@ -111,7 +113,6 @@ struct value
|
||||||
LONGEST force_longlong_align;
|
LONGEST force_longlong_align;
|
||||||
char *literal_data;
|
char *literal_data;
|
||||||
} aligner;
|
} aligner;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct value *value_ptr;
|
typedef struct value *value_ptr;
|
||||||
|
@ -141,16 +142,18 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
|
||||||
#define VALUE_NEXT(val) (val)->next
|
#define VALUE_NEXT(val) (val)->next
|
||||||
#define VALUE_REGNO(val) (val)->regno
|
#define VALUE_REGNO(val) (val)->regno
|
||||||
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
|
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
|
||||||
|
#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
|
||||||
|
|
||||||
/* Convert a REF to the object referenced. */
|
/* Convert a REF to the object referenced. */
|
||||||
|
|
||||||
#define COERCE_REF(arg) \
|
#define COERCE_REF(arg) \
|
||||||
do { CHECK_TYPEDEF (VALUE_TYPE (arg)); \
|
do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\
|
||||||
if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_REF) \
|
if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
|
||||||
arg = value_at_lazy (TYPE_TARGET_TYPE (VALUE_TYPE (arg)), \
|
arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
|
||||||
unpack_long (VALUE_TYPE (arg), \
|
unpack_long (VALUE_TYPE (arg), \
|
||||||
VALUE_CONTENTS (arg))); \
|
VALUE_CONTENTS (arg)), \
|
||||||
} while (0)
|
VALUE_BFD_SECTION (arg)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/* If ARG is an array, convert it to a pointer.
|
/* If ARG is an array, convert it to a pointer.
|
||||||
If ARG is an enum, convert it to an integer.
|
If ARG is an enum, convert it to an integer.
|
||||||
|
@ -177,7 +180,7 @@ do { COERCE_REF(arg); \
|
||||||
/* If ARG is an enum, convert it to an integer. */
|
/* If ARG is an enum, convert it to an integer. */
|
||||||
|
|
||||||
#define COERCE_ENUM(arg) { \
|
#define COERCE_ENUM(arg) { \
|
||||||
if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ENUM) \
|
if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \
|
||||||
arg = value_cast (builtin_type_unsigned_int, arg); \
|
arg = value_cast (builtin_type_unsigned_int, arg); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,9 +233,9 @@ extern value_ptr value_from_longest PARAMS ((struct type *type, LONGEST num));
|
||||||
|
|
||||||
extern value_ptr value_from_double PARAMS ((struct type *type, DOUBLEST num));
|
extern value_ptr value_from_double PARAMS ((struct type *type, DOUBLEST num));
|
||||||
|
|
||||||
extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr));
|
extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
|
||||||
|
|
||||||
extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr));
|
extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
|
||||||
|
|
||||||
extern value_ptr value_from_register PARAMS ((struct type *type, int regnum,
|
extern value_ptr value_from_register PARAMS ((struct type *type, int regnum,
|
||||||
struct frame_info * frame));
|
struct frame_info * frame));
|
||||||
|
@ -297,6 +300,8 @@ extern value_ptr value_struct_elt_for_reference PARAMS ((struct type *domain,
|
||||||
char *name,
|
char *name,
|
||||||
struct type *intype));
|
struct type *intype));
|
||||||
|
|
||||||
|
extern value_ptr value_static_field PARAMS ((struct type *type, int fieldno));
|
||||||
|
|
||||||
extern value_ptr value_field PARAMS ((value_ptr arg1, int fieldno));
|
extern value_ptr value_field PARAMS ((value_ptr arg1, int fieldno));
|
||||||
|
|
||||||
extern value_ptr value_primitive_field PARAMS ((value_ptr arg1, int offset,
|
extern value_ptr value_primitive_field PARAMS ((value_ptr arg1, int offset,
|
||||||
|
@ -412,9 +417,15 @@ read_register_gen PARAMS ((int regno, char *myaddr));
|
||||||
extern CORE_ADDR
|
extern CORE_ADDR
|
||||||
read_register PARAMS ((int regno));
|
read_register PARAMS ((int regno));
|
||||||
|
|
||||||
|
extern CORE_ADDR
|
||||||
|
read_register_pid PARAMS ((int regno, int pid));
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
write_register PARAMS ((int regno, LONGEST val));
|
write_register PARAMS ((int regno, LONGEST val));
|
||||||
|
|
||||||
|
extern void
|
||||||
|
write_register_pid PARAMS ((int regno, LONGEST val, int pid));
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
supply_register PARAMS ((int regno, char *val));
|
supply_register PARAMS ((int regno, char *val));
|
||||||
|
|
||||||
|
@ -457,7 +468,7 @@ val_print PARAMS ((struct type *type, char *valaddr, CORE_ADDR address,
|
||||||
int recurse, enum val_prettyprint pretty));
|
int recurse, enum val_prettyprint pretty));
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
val_print_string PARAMS ((CORE_ADDR addr, unsigned int len, GDB_FILE *stream));
|
val_print_string PARAMS ((CORE_ADDR addr, int len, int width, GDB_FILE *stream));
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
print_variable_value PARAMS ((struct symbol *var, struct frame_info *frame,
|
print_variable_value PARAMS ((struct symbol *var, struct frame_info *frame,
|
||||||
|
@ -497,4 +508,6 @@ extern value_ptr find_function_in_inferior PARAMS ((char *));
|
||||||
|
|
||||||
extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
|
extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
|
||||||
|
|
||||||
|
extern void _initialize_values PARAMS ((void));
|
||||||
|
|
||||||
#endif /* !defined (VALUE_H) */
|
#endif /* !defined (VALUE_H) */
|
||||||
|
|
Loading…
Add table
Reference in a new issue