* scm-exp.c: White space.
* scm-lang.c: White space.
* scm-valprint.c: White space.
* sentinel-frame.c: White space.
* ser-base.c: White space.
* ser-go32.c: White space.
* serial.c: White space.
* ser-mingw.c: White space.
* ser-pipe.c: White space.
* ser-tcp.c: White space.
* ser-unix.c: White space.
* solib.c: White space.
* solib-darwin.c: White space.
* solib-frv.c: White space.
* solib-irix.c: White space.
* solib-osf.c: White space.
* solib-pa64.c: White space.
* solib-som.c: White space.
* solib-spu.c: White space.
* solib-svr4.c: White space.
* solib-target.c: White space.
* source.c: White space.
* stabsread.c: White space.
* stack.c: White space.
* std-regs.c: White space.
* symfile.c: White space.
* symmisc.c: White space.
* symtab.c: White space.
+2010-05-16 Michael Snyder <msnyder@vmware.com>
+
+ * scm-exp.c: White space.
+ * scm-lang.c: White space.
+ * scm-valprint.c: White space.
+ * sentinel-frame.c: White space.
+ * ser-base.c: White space.
+ * ser-go32.c: White space.
+ * serial.c: White space.
+ * ser-mingw.c: White space.
+ * ser-pipe.c: White space.
+ * ser-tcp.c: White space.
+ * ser-unix.c: White space.
+ * solib.c: White space.
+ * solib-darwin.c: White space.
+ * solib-frv.c: White space.
+ * solib-irix.c: White space.
+ * solib-osf.c: White space.
+ * solib-pa64.c: White space.
+ * solib-som.c: White space.
+ * solib-spu.c: White space.
+ * solib-svr4.c: White space.
+ * solib-target.c: White space.
+ * source.c: White space.
+ * stabsread.c: White space.
+ * stack.c: White space.
+ * std-regs.c: White space.
+ * symfile.c: White space.
+ * symmisc.c: White space.
+ * symtab.c: White space.
+
2010-05-16 Michael Snyder <msnyder@vmware.com>
* source.c (_initialize_source): Add "rev" as an abbreviation
#if 0
SCM res;
#endif
+
if (len == 1)
if (*str == '+' || *str == '-') /* Catches lone `+' and `-' for speed */
return SCM_BOOL_F;
scm_skip_ws (void)
{
int c;
+
while (1)
switch ((c = *lexptr++))
{
for (;;)
{
int c = scm_skip_ws ();
+
if (')' == c || ']' == c)
return;
--lexptr;
int c, j;
struct stoken str;
LONGEST svalue = 0;
+
tryagain:
c = *lexptr++;
switch (c)
if (!skipping)
{
struct value *val = scm_evaluate_string (str.ptr, lexptr - str.ptr);
+
if (!is_scmvalue_type (value_type (val)))
error ("quoted scm form yields non-SCM value");
svalue = extract_signed_integer (value_contents (val),
scm_parse (void)
{
char *start;
+
while (*lexptr == ' ')
lexptr++;
start = lexptr;
enum bfd_endian byte_order)
{
gdb_byte buffer[20];
+
read_memory (SCM2PTR (svalue) + index * size, buffer, size);
return extract_signed_integer (buffer, size, byte_order);
}
{
char *filename = cursal.symtab->filename;
int len = strlen (filename);
+
if (len >= 6 && strcmp (filename + len - 6, "eval.c") == 0)
return 1;
}
struct value *func;
struct value *addr = value_allocate_space_in_inferior (len + 1);
LONGEST iaddr = value_as_long (addr);
+
write_memory (iaddr, (gdb_byte *) str, len);
/* FIXME - should find and pass env */
write_memory (iaddr + len, (gdb_byte *) "", 1);
enum exp_opcode op = exp->elts[*pos].opcode;
int len, pc;
char *str;
+
switch (op)
{
case OP_NAME:
#define SCM_SIZE (TYPE_LENGTH (type))
#define SCM_BYTE_ORDER (gdbarch_byte_order (get_type_arch (type)))
unsigned int more = options->print_max;
+
if (recurse > 6)
{
fputs_filtered ("...", stream);
#if 0
SCM name;
#endif
+
fputs_filtered ("#<latte ", stream);
#if 1
fputs_filtered ("???", stream);
int i;
LONGEST elements = SCM_CDR (svalue);
LONGEST val;
+
fputs_filtered ("#(", stream);
for (i = 0; i < len; ++i)
{
{
SCM result;
SCM hook;
+
hook = scm_get_lvector_hook (exp, LV_PRINT_FN);
if (hook == BOOL_F)
{
#define SCM_CHARS(x) ((char *)(SCM_CDR(x)))
char *str = CHARS (SNAME (exp));
#endif
+
fprintf_filtered (stream, "#<primitive-procedure %s>",
str);
}
const struct value_print_options *options)
{
struct value_print_options opts = *options;
+
opts.deref_ref = 1;
return (common_val_print (val, stream, 0, &opts, current_language));
}
{
struct frame_unwind_cache *cache =
FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache);
+
cache->regcache = regcache;
return cache;
}
void **this_prologue_cache)
{
struct frame_unwind_cache *cache = *this_prologue_cache;
+
return get_regcache_arch (cache->regcache);
}
if (serial_is_async_p (scb))
{
int next_state;
+
switch (scb->async_state)
{
case FD_SCHEDULED:
push_event (void *context)
{
struct serial *scb = context;
+
scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */
scb->async_handler (scb, scb->async_context);
/* re-schedule */
dos_flush_input (struct serial *scb)
{
struct dos_ttystate *port = &ports[scb->fd];
+
disable ();
port->first = port->count = 0;
if (port->fifo)
if (isatty (scb->fd))
{
struct ser_console_ttystate *state;
+
state = (struct ser_console_ttystate *) xmalloc (sizeof *state);
state->is_a_tty = 1;
return state;
HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD numBytes;
BOOL r = PeekNamedPipe (h, NULL, 0, NULL, &numBytes, NULL);
+
if (r == FALSE)
numBytes = 0;
return numBytes;
int pdes[2];
int err_pdes[2];
int pid;
+
if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
return -1;
if (socketpair (AF_UNIX, SOCK_STREAM, 0, err_pdes) < 0)
pipe_close (struct serial *scb)
{
struct pipe_state *state = scb->state;
+
if (state != NULL)
{
int pid = state->pid;
_initialize_ser_pipe (void)
{
struct serial_ops *ops = XMALLOC (struct serial_ops);
+
memset (ops, 0, sizeof (struct serial_ops));
ops->name = "pipe";
ops->next = 0;
if (scb)
{
fd_set rset, wset, eset;
+
FD_ZERO (&rset);
FD_SET (scb->fd, &rset);
wset = rset;
{
int res, err;
socklen_t len;
+
len = sizeof (err);
/* On Windows, the fourth parameter to getsockopt is a "char *";
on UNIX systems it is generally "void *". The cast to "void *"
ser-mingw.c. */
#else
struct serial_ops *ops;
+
ops = XMALLOC (struct serial_ops);
memset (ops, 0, sizeof (struct serial_ops));
ops->name = "tcp";
to be discarded. */
{
struct hardwire_ttystate state;
+
if (get_tty_state (scb, &state))
{
return (-1);
_initialize_ser_hardwire (void)
{
struct serial_ops *ops = XMALLOC (struct serial_ops);
+
memset (ops, 0, sizeof (struct serial_ops));
ops->name = "hardwire";
ops->next = 0;
void *context)
{
int changed = ((scb->async_handler == NULL) != (handler == NULL));
+
scb->async_handler = handler;
scb->async_context = context;
/* Only change mode if there is a need. */
for (i = 0; i < number_of_symbols; i++)
{
asymbol *sym = symbol_table[i];
+
if (strcmp (sym->name, symname) == 0
&& (sym->section->flags & (SEC_CODE | SEC_DATA)) != 0)
{
if (dyld_bfd)
{
bfd *sub;
+
sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object,
gdbarch_bfd_arch_info (target_gdbarch));
if (sub)
&& sec->addr < map->segs[seg].p_vaddr + map->segs[seg].p_memsz)
{
CORE_ADDR displ = map->segs[seg].addr - map->segs[seg].p_vaddr;
+
sec->addr += displ;
sec->endaddr += displ;
break;
CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data,
sizeof (buf.ol32.data),
byte_order);
+
li.next = extract_mips_address (&buf.ol32.next,
sizeof (buf.ol32.next), byte_order);
{
int status = 1;
-
/* Note that breakpoint address and original contents are in our address
space, so we just need to write the original contents back. */
lm_sec_cmp (const void *p1, const void *p2)
{
const struct lm_sec *lms1 = p1, *lms2 = p2;
+
return strcmp (lms1->name, lms2->name);
}
#ifdef SOLIB_PA64_DBG
{
struct load_module_desc *d = &new->lm_info->desc;
+
printf ("\n+ library \"%s\" is described at index %d\n", new->so_name,
dll_index);
printf (" text_base = %s\n", hex_string (d->text_base));
void pa64_solib_select (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- set_solib_ops (gdbarch, &pa64_so_ops);
+ set_solib_ops (gdbarch, &pa64_so_ops);
tdep->solib_thread_start_addr = pa64_solib_thread_start_addr;
tdep->solib_get_got_by_pc = pa64_solib_get_got_by_pc;
tdep->solib_get_solib_by_pc = pa64_solib_get_solib_by_pc;
som_solib_select (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- set_solib_ops (gdbarch, &som_so_ops);
+ set_solib_ops (gdbarch, &som_so_ops);
tdep->solib_thread_start_addr = som_solib_thread_start_addr;
tdep->solib_get_got_by_pc = som_solib_get_got_by_pc;
tdep->solib_get_solib_by_pc = som_solib_get_solib_by_pc;
if (size == 4)
{
int fd = extract_unsigned_integer (buf, 4, byte_order);
+
spu_relocate_main_executable (fd);
/* Re-enable breakpoints after main SPU context was established;
if (spu_name)
{
int sect_size = bfd_section_size (abfd, spu_name);
+
if (sect_size > 20)
{
char *buf = alloca (sect_size - 20 + strlen (original_name) + 1);
+
bfd_get_section_contents (abfd, spu_name, buf, 20, sect_size - 20);
buf[sect_size - 20] = '\0';
if (spe_event_sym)
{
CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (spe_event_sym);
+
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, addr,
¤t_target);
create_solib_event_breakpoint (target_gdbarch, addr);
if (arch_size == 32)
{
Elf32_External_Dyn *dynp = (Elf32_External_Dyn *) buf;
+
dyn_tag = extract_unsigned_integer ((gdb_byte *) dynp->d_tag,
4, byte_order);
dyn_ptr = extract_unsigned_integer ((gdb_byte *) dynp->d_un.d_ptr,
else
{
Elf64_External_Dyn *dynp = (Elf64_External_Dyn *) buf;
+
dyn_tag = extract_unsigned_integer ((gdb_byte *) dynp->d_tag,
8, byte_order);
dyn_ptr = extract_unsigned_integer ((gdb_byte *) dynp->d_un.d_ptr,
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
gdb_byte *pbuf;
int pbuf_size = TYPE_LENGTH (ptr_type);
+
pbuf = alloca (pbuf_size);
/* DT_MIPS_RLD_MAP contains a pointer to the address
of the dynamic link structure. */
{
struct regcache *regcache
= get_thread_arch_regcache (inferior_ptid, target_gdbarch);
+
load_addr = (regcache_read_pc (regcache)
- exec_entry_point (tmp_bfd, tmp_bfd_target));
}
svr4_have_link_map_offsets (void)
{
struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data);
+
return (ops->fetch_link_map_offsets != NULL);
}
\f
{
VEC(lm_info_p) **list = user_data;
struct lm_info *lm_info = VEC_last (lm_info_p, *list);
+
if (lm_info->segment_bases == NULL
&& lm_info->section_bases == NULL)
gdb_xml_error (parser,
int bases_index = 0;
int found_range = 0;
CORE_ADDR *section_bases;
+
section_bases = VEC_address (CORE_ADDR,
so->lm_info->section_bases);
if (bfd_section_size (so->abfd, sect) > 0)
{
CORE_ADDR low, high;
+
low = section_bases[i];
high = low + bfd_section_size (so->abfd, sect) - 1;
else if (so->lm_info->segment_bases)
{
struct symfile_segment_data *data;
+
data = get_symfile_segment_data (so->abfd);
if (data == NULL)
warning (_("\
solib_ops (struct gdbarch *gdbarch)
{
struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data);
+
return *ops;
}
set_solib_ops (struct gdbarch *gdbarch, struct target_so_ops *new_ops)
{
struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data);
+
*ops = new_ops;
}
\f
if (solib_symbols_extension)
{
char *p = in_pathname + strlen (in_pathname);
+
while (p > in_pathname && *p != '.')
p--;
while (so_list_head)
{
struct so_list *so = so_list_head;
+
so_list_head = so->next;
observer_notify_solib_unloaded (so);
if (so->abfd)
solib_create_inferior_hook (int from_tty)
{
struct target_so_ops *ops = solib_ops (target_gdbarch);
+
ops->solib_create_inferior_hook (from_tty);
}
in_solib_dynsym_resolve_code (CORE_ADDR pc)
{
struct target_so_ops *ops = solib_ops (target_gdbarch);
+
return ops->in_dynsym_resolve_code (pc);
}
{
const char *name = s->filename;
int len = strlen (name);
+
if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
|| strcmp (name, "<<C++-namespaces>>") == 0)))
{
if (stat (name, &st) < 0)
{
int save_errno = errno;
+
fprintf_unfiltered (gdb_stderr, "Warning: ");
print_sys_errmsg (name, save_errno);
}
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
? "" : SLASH_STRING,
filename, (char *)NULL);
+
*filename_opened = xfullpath (f);
xfree (f);
}
_initialize_source (void)
{
struct cmd_list_element *c;
+
current_source_symtab = 0;
init_source_path ();
if (stabs)
{
-
/* for all the stab entries, find their corresponding symbols and
patch their types! */
read_type_number (char **pp, int *typenums)
{
int nbits;
+
if (**pp == '(')
{
(*pp)++;
{
int new_slots = ref_count - ref_chunk * MAX_CHUNK_REFS;
int new_chunks = new_slots / MAX_CHUNK_REFS + 1;
+
ref_map = (struct ref_map *)
xrealloc (ref_map, REF_MAP_SIZE (ref_chunk + new_chunks));
- memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0, new_chunks * REF_CHUNK_SIZE);
+ memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0,
+ new_chunks * REF_CHUNK_SIZE);
ref_chunk += new_chunks;
}
ref_map[refnum].stabs = stabs;
if (SYMBOL_LANGUAGE (sym) == language_cplus)
{
char *name = alloca (p - string + 1);
+
memcpy (name, string, p - string);
name[p - string] = '\0';
new_name = cp_canonicalize_string (name);
&& gdbarch_stabs_argument_has_addr (gdbarch, SYMBOL_TYPE (sym)))
{
struct symbol *prev_sym;
+
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG)
!= SYMBOL_LINKAGE_NAME (sym))
{
struct minimal_symbol *msym;
+
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile);
if (msym != NULL)
{
char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
+
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
}
&& TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)))
{
int j;
+
for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--)
if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0)
TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) =
{
/* Clone the sym and then modify it. */
struct symbol *typedef_sym = (struct symbol *)
- obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
+
*typedef_sym = *sym;
SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
SYMBOL_VALUE (typedef_sym) = valu;
!= SYMBOL_LINKAGE_NAME (sym))
{
struct minimal_symbol *msym;
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile);
+
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
+ NULL, objfile);
if (msym != NULL)
{
char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
+
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
}
if (q1 && p > q1 && p[1] == ':')
{
int nesting_level = 0;
+
for (q2 = q1; *q2; q2++)
{
if (*q2 == '<')
if (current_subfile->language == language_cplus)
{
char *new_name, *name = alloca (p - *pp + 1);
+
memcpy (name, *pp, p - *pp);
name[p - *pp] = '\0';
new_name = cp_canonicalize_string (name);
TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
{
struct type *xtype = read_type (pp, objfile);
+
if (type == xtype)
{
/* It's being defined as itself. That means it is "void". */
/* type attribute */
{
char *attr = *pp;
+
/* Skip to the semicolon. */
while (**pp != ';' && **pp != '\0')
++(*pp);
{
char dem_opname[256];
int ret;
+
ret = cplus_demangle_opname (new_fnlist->fn_fieldlist.name,
dem_opname, DMGL_ANSI);
if (!ret)
case 'f': /* $vf -- a virtual function table pointer */
name = type_name_no_tag (context);
if (name == NULL)
- {
- name = "";
- }
+ {
+ name = "";
+ }
fip->list->field.name = obconcat (&objfile->objfile_obstack,
vptr_name, name, (char *) NULL);
break;
{
int nbits;
+
FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ';', &nbits,
0);
if (nbits != 0)
{
int nbits;
+
FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ',', &nbits, 0);
if (nbits != 0)
{
ALLOCATE_CPLUS_STRUCT_TYPE (type);
{
int nbits;
+
TYPE_N_BASECLASSES (type) = read_huge_number (pp, ',', &nbits, 0);
if (nbits != 0)
return 0;
--i)
{
char *name = TYPE_FIELD_NAME (t, i);
+
if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
&& is_cplus_marker (name[sizeof (vptr_name) - 2]))
{
{
int nbits;
+
TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
{
int last = syms == osyms ? o_nsyms : 0;
int j = syms->nsyms;
+
for (; --j >= last; --n)
{
struct symbol *xsym = syms->symbol[j];
+
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
size_t len;
char *p1 = p;
+
while ((c = *p1) >= '0' && c < '8')
p1++;
if (n == 0)
{
long sn = c - '0' - ((2 * (c - '0')) | (2 << sign_bit));
+
n = -sn;
}
else
{
struct type *complex_type =
init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile);
+
TYPE_TARGET_TYPE (complex_type) = float_type;
return complex_type;
}
else if (n2 == 0 && n3 == -1)
{
int bits = type_size;
+
if (bits <= 0)
{
/* We don't know its size. It is unsigned int or unsigned
fix_common_block (struct symbol *sym, int valu)
{
struct pending *next = (struct pending *) SYMBOL_TYPE (sym);
+
for (; next; next = next->next)
{
int j;
+
for (j = next->nsyms - 1; j >= 0; j--)
SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu;
}
find_name_end (char *name)
{
char *s = name;
+
if (s[0] == '-' || *s == '+')
{
/* Must be an ObjC method symbol. */
if (*SYMBOL_LINKAGE_NAME (sym))
{
struct symbol *nsym;
+
nsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
b, VAR_DOMAIN, NULL);
gdb_assert (nsym != NULL);
else
{
struct value_print_options opts;
+
get_user_print_options (&opts);
/* We used to do this earlier, but that is clearly
wrong. This function is used by many different
with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */
char *func_only = cp_remove_params (*funname);
+
if (func_only)
{
*funname = func_only;
{
struct print_args_args args;
struct cleanup *args_list_chain;
+
args.frame = frame;
args.func = find_pc_function (get_frame_address_in_block (frame));
args.stream = gdb_stdout;
if (ui_out_is_mi_like_p (uiout))
{
const char *fullname = symtab_to_fullname (sal.symtab);
+
if (fullname != NULL)
ui_out_field_string (uiout, "fullname", fullname);
}
{
struct frame_info *fid;
int level = value_as_long (args[0]);
+
fid = find_relative_frame (get_current_frame (), &level);
if (level == 0)
/* find_relative_frame was successful */
/* Convert each value into a corresponding address. */
{
int i;
+
for (i = 0; i < numargs; i++)
addrs[i] = value_as_address (args[i]);
}
with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */
char *func_only = cp_remove_params (funname);
+
if (func_only)
{
funname = func_only;
int sp_size = register_size (gdbarch, gdbarch_sp_regnum (gdbarch));
gdb_byte value[MAX_REGISTER_SIZE];
CORE_ADDR sp;
+
frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch),
&optimized, &lval, &addr,
&realnum, value);
for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi))
{
CORE_ADDR pc;
+
QUIT;
pc = get_frame_address_in_block (fi);
find_pc_sect_symtab_via_partial (pc, find_pc_mapped_section (pc));
{
struct symtab_and_line sal;
struct value_print_options opts;
+
sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
values_printed = 1;
fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
while (*level_offset_ptr > 0)
{
struct frame_info *prev = get_prev_frame (frame);
+
if (!prev)
break;
(*level_offset_ptr)--;
while (*level_offset_ptr < 0)
{
struct frame_info *next = get_next_frame (frame);
+
if (!next)
break;
(*level_offset_ptr)++;
if (from_tty)
{
int confirmed;
+
if (thisfun == NULL)
confirmed = query (_("%sMake selected stack frame return now? "),
query_prefix);
value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+
if (gdbarch_deprecated_fp_regnum (gdbarch) >= 0)
/* NOTE: cagney/2003-04-24: Since the mere presence of "fp" in the
register name table overrides this built-in $fp register, there
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
struct value *val = allocate_value (data_ptr_type);
gdb_byte *buf = value_contents_raw (val);
+
if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val)));
else
value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+
if (gdbarch_pc_regnum (gdbarch) >= 0)
return value_of_register (gdbarch_pc_regnum (gdbarch), frame);
else
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
struct value *val = allocate_value (func_ptr_type);
gdb_byte *buf = value_contents_raw (val);
+
if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val)));
else
value_of_builtin_frame_sp_reg (struct frame_info *frame, const void *baton)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+
if (gdbarch_sp_regnum (gdbarch) >= 0)
return value_of_register (gdbarch_sp_regnum (gdbarch), frame);
error (_("Standard register ``$sp'' is not available for this target"));
value_of_builtin_frame_ps_reg (struct frame_info *frame, const void *baton)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+
if (gdbarch_ps_regnum (gdbarch) >= 0)
return value_of_register (gdbarch_ps_regnum (gdbarch), frame);
error (_("Standard register ``$ps'' is not available for this target"));
const char *p1 = ptr;
char *p2 = p;
const char *end = ptr + size;
+
while (p1 != end)
*p2++ = *p1++;
}
void
new_symfile_objfile (struct objfile *objfile, int add_flags)
{
-
/* If this is the main symbol file we have to clean up all users of the
old main symbol file. Otherwise it is sufficient to fixup all the
breakpoints that may have been redefined by this symbol file. */
if (desc < 0)
{
char *exename = alloca (strlen (name) + 5);
+
strcat (strcpy (exename, name), ".exe");
desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename,
O_RDONLY | O_BINARY, &absolute_name);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
struct print_symbol_args s;
+
s.gdbarch = gdbarch;
s.symbol = sym;
s.depth = depth + 1;
{
unsigned i;
struct type *type = check_typedef (SYMBOL_TYPE (symbol));
+
fprintf_filtered (outfile, "const %u hex bytes:",
TYPE_LENGTH (type));
for (i = 0; i < TYPE_LENGTH (type); i++)
block_depth (struct block *block)
{
int i = 0;
+
while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
{
i++;
if (full_path != NULL)
{
const char *fp = symtab_to_fullname (s);
+
if (fp != NULL && FILENAME_CMP (full_path, fp) == 0)
{
return s;
if (real_path != NULL)
{
char *fullname = symtab_to_fullname (s);
+
if (fullname != NULL)
{
char *rp = gdb_realpath (fullname);
+
make_cleanup (xfree, rp);
if (FILENAME_CMP (real_path, rp) == 0)
{
mangled_name_len = ((is_constructor ? 0 : strlen (field_name))
+ strlen (buf) + len + strlen (physname) + 1);
- {
- mangled_name = (char *) xmalloc (mangled_name_len);
- if (is_constructor)
- mangled_name[0] = '\0';
- else
- strcpy (mangled_name, field_name);
- }
+ mangled_name = (char *) xmalloc (mangled_name_len);
+ if (is_constructor)
+ mangled_name[0] = '\0';
+ else
+ strcpy (mangled_name, field_name);
+
strcat (mangled_name, buf);
/* If the class doesn't have a name, i.e. newname NULL, then we just
mangle it using 0 for the length of the class. Thus it gets mangled
hash_demangled_name_entry (const void *data)
{
const struct demangled_name_entry *e = data;
+
return htab_hash_string (e->mangled);
}
{
const struct demangled_name_entry *da = a;
const struct demangled_name_entry *db = b;
+
return strcmp (da->mangled, db->mangled) == 0;
}
if (gsymbol->language == language_java)
{
char *alloc_name;
- lookup_len = len + JAVA_PREFIX_LEN;
+ lookup_len = len + JAVA_PREFIX_LEN;
alloc_name = alloca (lookup_len + 1);
memcpy (alloc_name, JAVA_PREFIX, JAVA_PREFIX_LEN);
memcpy (alloc_name + JAVA_PREFIX_LEN, linkage_name, len);
else if (linkage_name[len] != '\0')
{
char *alloc_name;
- lookup_len = len;
+ lookup_len = len;
alloc_name = alloca (lookup_len + 1);
memcpy (alloc_name, linkage_name, len);
alloc_name[lookup_len] = '\0';
ALL_OBJFILES (objfile)
{
struct symtab *result = NULL;
+
if (objfile->sf)
result = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol,
pc, section, 0);
a search of the section table. */
struct obj_section *s;
+
ALL_OBJFILE_OSECTIONS (objfile, s)
{
int idx = s->the_bfd_section->index;
modified_name = name;
- /* If we are using C++, D, or Java, demangle the name before doing a lookup, so
- we can always binary search. */
+ /* If we are using C++, D, or Java, demangle the name before doing a
+ lookup, so we can always binary search. */
if (lang == language_cplus)
{
demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
{
struct symbol *sym = NULL;
const struct block *function_block = block;
+
/* 'this' is only defined in the function's block, so find the
enclosing function block. */
for (; function_block && !BLOCK_FUNCTION (function_block);
if ((objfile->flags & OBJF_REORDERED) && objfile->sf)
{
struct symtab *result;
+
result
= objfile->sf->qf->find_pc_sect_symtab (objfile,
msymbol,
ALL_OBJFILES (objfile)
{
struct symtab *result;
+
if (!objfile->sf)
continue;
result = objfile->sf->qf->find_pc_sect_symtab (objfile,
If not found, return NULL. */
struct symtab *
-find_line_symtab (struct symtab *symtab, int line, int *index, int *exact_match)
+find_line_symtab (struct symtab *symtab, int line,
+ int *index, int *exact_match)
{
int exact = 0; /* Initialized here to avoid a compiler warning. */
find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
{
struct symtab_and_line sal;
+
sal = find_pc_line (pc, 0);
*startptr = sal.pc;
*endptr = sal.end;
{
struct minimal_symbol *msymbol
= lookup_minimal_symbol_by_pc_section (sal->pc, sal->section);
+
if (msymbol == NULL)
{
do_cleanups (old_chain);
if (isalpha (*p) || *p == '_' || *p == '$')
{
char *q = p + 1;
+
while (isalnum (*q) || *q == '_' || *q == '$')
q++;
*end = q;
ALL_SYMTABS (objfile, s)
{
const char *fullname = symtab_to_fullname (s);
+
output_source_filename (fullname ? fullname : s->filename, &first);
}
printf_filtered ("\n\n");
search_symbols_file_matches (const char *filename, void *user_data)
{
struct search_symbols_data *data = user_data;
+
return file_matches (filename, data->files, data->nfiles);
}
search_symbols_name_matches (const char *symname, void *user_data)
{
struct search_symbols_data *data = user_data;
+
return data->regexp == NULL || re_exec (symname);
}
char *val;
int found_misc = 0;
static enum minimal_symbol_type types[]
- =
- {mst_data, mst_text, mst_abs, mst_unknown};
+ = {mst_data, mst_text, mst_abs, mst_unknown};
static enum minimal_symbol_type types2[]
- =
- {mst_bss, mst_file_text, mst_abs, mst_unknown};
+ = {mst_bss, mst_file_text, mst_abs, mst_unknown};
static enum minimal_symbol_type types3[]
- =
- {mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown};
+ = {mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown};
static enum minimal_symbol_type types4[]
- =
- {mst_file_bss, mst_text, mst_abs, mst_unknown};
+ = {mst_file_bss, mst_text, mst_abs, mst_unknown};
enum minimal_symbol_type ourtype;
enum minimal_symbol_type ourtype2;
enum minimal_symbol_type ourtype3;
and <TYPENAME> or <OPERATOR>. */
char *opend;
char *opname = operator_chars (regexp, &opend);
+
if (*opname)
{
int fix = -1; /* -1 means ok; otherwise number of spaces needed. */
+
if (isalpha (*opname) || *opname == '_' || *opname == '$')
{
/* There should 1 space between 'operator' and 'TYPENAME'. */
if (fix >= 0)
{
char *tmp = (char *) alloca (8 + fix + strlen (opname) + 1);
+
sprintf (tmp, "operator%.*s%s", fix, " ", opname);
regexp = tmp;
}
{
struct symbol_search *prevtail = tail;
int nfound = 0;
+
b = BLOCKVECTOR_BLOCK (bv, i);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
struct symtab *real_symtab = SYMBOL_SYMTAB (sym);
+
QUIT;
if (file_matches (real_symtab->filename, files, nfiles)
static void
symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
{
- static char *classnames[]
- =
- {"variable", "function", "type", "method"};
+ static char *classnames[] = {"variable", "function", "type", "method"};
struct symbol_search *symbols;
struct symbol_search *p;
struct cleanup *old_chain;
if (regexp)
{
char *colon = strchr (regexp, ':');
+
if (colon && *(colon + 1) != ':')
{
int colon_index;
int newlen = (strlen (p->symtab->filename)
+ strlen (SYMBOL_LINKAGE_NAME (p->symbol))
+ 4);
+
if (newlen > len)
{
string = xrealloc (string, newlen);
}
else
{
- int newlen = (strlen (SYMBOL_LINKAGE_NAME (p->msymbol))
- + 3);
+ int newlen = (strlen (SYMBOL_LINKAGE_NAME (p->msymbol)) + 3);
+
if (newlen > len)
{
string = xrealloc (string, newlen);
{
char *new;
+
if (word == sym_text)
{
new = xmalloc (strlen (symname) + 5);
void *user_data)
{
struct add_name_data *datum = (struct add_name_data *) user_data;
+
completion_list_add_name ((char *) name,
datum->sym_text, datum->sym_text_len,
datum->text, datum->word);
add_partial_symbol_name (const char *name, void *user_data)
{
struct add_name_data *datum = (struct add_name_data *) user_data;
+
completion_list_add_name ((char *) name,
datum->sym_text, datum->sym_text_len,
datum->text, datum->word);
else
{
const char *base_name = lbasename (filename);
+
if (base_name != filename
&& !filename_seen (base_name, 1, data->first)
#if HAVE_DOS_BASED_FILE_SYSTEM
{
struct linetable *l;
int len;
+
if (fullname != NULL
&& symtab_to_fullname (symtab) != NULL
&& FILENAME_CMP (fullname, symtab->fullname) != 0)