/* Perform non-arithmetic operations on values, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#include "defs.h"
#include "symtab.h"
#endif
int overload_resolution = 0;
+static void
+show_overload_resolution (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("\
+Overload resolution in evaluating C++ functions is %s.\n"),
+ value);
+}
/* Find the address of function name NAME in the inferior. */
case lval_memory:
{
- const bfd_byte *dest_buffer;
+ const gdb_byte *dest_buffer;
CORE_ADDR changed_addr;
int changed_len;
- char buffer[sizeof (LONGEST)];
+ gdb_byte buffer[sizeof (LONGEST)];
if (value_bitsize (toval))
{
modify it, and copy it back in. */
int amount_copied;
int amount_to_copy;
- char *buffer;
+ gdb_byte *buffer;
int reg_offset;
int byte_offset;
int regno;
amount_to_copy = byte_offset + TYPE_LENGTH (type);
/* And a bounce buffer. Be slightly over generous. */
- buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE);
+ buffer = alloca (amount_to_copy + MAX_REGISTER_SIZE);
/* Copy it in. */
for (regno = reg_offset, amount_copied = 0;
return 0; /* For lint -- never reached */
}
\f
-/* Pushing small parts of stack frames. */
-
-/* Push one word (the size of object that a register holds). */
-
-CORE_ADDR
-push_word (CORE_ADDR sp, ULONGEST word)
-{
- int len = DEPRECATED_REGISTER_SIZE;
- char buffer[MAX_REGISTER_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
-/* Push LEN bytes with data at BUFFER. */
-
-CORE_ADDR
-push_bytes (CORE_ADDR sp, char *buffer, int len)
-{
- if (INNER_THAN (1, 2))
- {
- /* stack grows downward */
- sp -= len;
- write_memory (sp, buffer, len);
- }
- else
- {
- /* stack grows upward */
- write_memory (sp, buffer, len);
- sp += len;
- }
-
- return sp;
-}
-
/* Create a value for an array by allocating space in the inferior, copying
the data into that space, and then setting up an array value.
copy LEN bytes from PTR in gdb to that address in the inferior. */
addr = allocate_space_in_inferior (len);
- write_memory (addr, ptr, len);
+ write_memory (addr, (gdb_byte *) ptr, len);
val = value_at_lazy (stringtype, addr);
return (val);
int i;
if (t2 == 0)
- internal_error (__FILE__, __LINE__, "typecmp: no argument list");
+ internal_error (__FILE__, __LINE__, _("typecmp: no argument list"));
/* Skip ``this'' argument if applicable. T2 will always include THIS. */
if (staticp)
void
find_rt_vbase_offset (struct type *type, struct type *basetype,
- const bfd_byte *valaddr, int offset, int *boffset_p,
+ const gdb_byte *valaddr, int offset, int *boffset_p,
int *skip_p)
{
int boffset; /* offset of virtual base */
else
{
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
- const bfd_byte *base_valaddr;
+ const gdb_byte *base_valaddr;
/* The virtual base class pointer might have been clobbered by the
user program. Make sure that it still points to a valid memory
if (offset < 0 || offset >= TYPE_LENGTH (type))
{
- bfd_byte *tmp = alloca (TYPE_LENGTH (baseclass));
+ gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass));
if (target_read_memory (VALUE_ADDRESS (*arg1p)
+ value_offset (*arg1p) + offset,
tmp, TYPE_LENGTH (baseclass)) != 0)
v = search_struct_method (name, argp, args, 0, static_memfuncp, t);
if (v == (struct value *) - 1)
- error (_("Cannot take address of a method"));
+ error (_("Cannot take address of method %s."), name);
else if (v == 0)
{
if (TYPE_NFN_FIELDS (t))
return value_namespace_elt (curtype, name, noside);
default:
internal_error (__FILE__, __LINE__,
- "non-aggregate type in value_aggregate_elt");
+ _("non-aggregate type in value_aggregate_elt"));
}
}
void
_initialize_valops (void)
{
-#if 0
- deprecated_add_show_from_set
- (add_set_cmd ("abandon", class_support, var_boolean, (char *) &auto_abandon,
- "Set automatic abandonment of expressions upon failure.",
- &setlist),
- &showlist);
-#endif
-
- deprecated_add_show_from_set
- (add_set_cmd ("overload-resolution", class_support, var_boolean, (char *) &overload_resolution,
- "Set overload resolution in evaluating C++ functions.",
- &setlist),
- &showlist);
+ add_setshow_boolean_cmd ("overload-resolution", class_support,
+ &overload_resolution, _("\
+Set overload resolution in evaluating C++ functions."), _("\
+Show overload resolution in evaluating C++ functions."), NULL,
+ NULL,
+ show_overload_resolution,
+ &setlist, &showlist);
overload_resolution = 1;
}