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.
This commit is contained in:
Michael Snyder
2010-05-16 23:49:58 +00:00
parent dd304d5382
commit 433759f709
29 changed files with 203 additions and 36 deletions

View File

@ -1,3 +1,34 @@
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> 2010-05-16 Michael Snyder <msnyder@vmware.com>
* source.c (_initialize_source): Add "rev" as an abbreviation * source.c (_initialize_source): Add "rev" as an abbreviation

View File

@ -112,6 +112,7 @@ scm_istring2number (char *str, int len, int radix)
#if 0 #if 0
SCM res; SCM res;
#endif #endif
if (len == 1) if (len == 1)
if (*str == '+' || *str == '-') /* Catches lone `+' and `-' for speed */ if (*str == '+' || *str == '-') /* Catches lone `+' and `-' for speed */
return SCM_BOOL_F; return SCM_BOOL_F;
@ -238,6 +239,7 @@ static int
scm_skip_ws (void) scm_skip_ws (void)
{ {
int c; int c;
while (1) while (1)
switch ((c = *lexptr++)) switch ((c = *lexptr++))
{ {
@ -272,6 +274,7 @@ scm_lreadparen (int skipping)
for (;;) for (;;)
{ {
int c = scm_skip_ws (); int c = scm_skip_ws ();
if (')' == c || ']' == c) if (')' == c || ']' == c)
return; return;
--lexptr; --lexptr;
@ -287,6 +290,7 @@ scm_lreadr (int skipping)
int c, j; int c, j;
struct stoken str; struct stoken str;
LONGEST svalue = 0; LONGEST svalue = 0;
tryagain: tryagain:
c = *lexptr++; c = *lexptr++;
switch (c) switch (c)
@ -309,6 +313,7 @@ tryagain:
if (!skipping) if (!skipping)
{ {
struct value *val = scm_evaluate_string (str.ptr, lexptr - str.ptr); struct value *val = scm_evaluate_string (str.ptr, lexptr - str.ptr);
if (!is_scmvalue_type (value_type (val))) if (!is_scmvalue_type (value_type (val)))
error ("quoted scm form yields non-SCM value"); error ("quoted scm form yields non-SCM value");
svalue = extract_signed_integer (value_contents (val), svalue = extract_signed_integer (value_contents (val),
@ -481,6 +486,7 @@ int
scm_parse (void) scm_parse (void)
{ {
char *start; char *start;
while (*lexptr == ' ') while (*lexptr == ' ')
lexptr++; lexptr++;
start = lexptr; start = lexptr;

View File

@ -70,6 +70,7 @@ scm_get_field (LONGEST svalue, int index, int size,
enum bfd_endian byte_order) enum bfd_endian byte_order)
{ {
gdb_byte buffer[20]; gdb_byte buffer[20];
read_memory (SCM2PTR (svalue) + index * size, buffer, size); read_memory (SCM2PTR (svalue) + index * size, buffer, size);
return extract_signed_integer (buffer, size, byte_order); return extract_signed_integer (buffer, size, byte_order);
} }
@ -135,6 +136,7 @@ in_eval_c (void)
{ {
char *filename = cursal.symtab->filename; char *filename = cursal.symtab->filename;
int len = strlen (filename); int len = strlen (filename);
if (len >= 6 && strcmp (filename + len - 6, "eval.c") == 0) if (len >= 6 && strcmp (filename + len - 6, "eval.c") == 0)
return 1; return 1;
} }
@ -188,6 +190,7 @@ scm_evaluate_string (char *str, int len)
struct value *func; struct value *func;
struct value *addr = value_allocate_space_in_inferior (len + 1); struct value *addr = value_allocate_space_in_inferior (len + 1);
LONGEST iaddr = value_as_long (addr); LONGEST iaddr = value_as_long (addr);
write_memory (iaddr, (gdb_byte *) str, len); write_memory (iaddr, (gdb_byte *) str, len);
/* FIXME - should find and pass env */ /* FIXME - should find and pass env */
write_memory (iaddr + len, (gdb_byte *) "", 1); write_memory (iaddr + len, (gdb_byte *) "", 1);
@ -202,6 +205,7 @@ evaluate_exp (struct type *expect_type, struct expression *exp,
enum exp_opcode op = exp->elts[*pos].opcode; enum exp_opcode op = exp->elts[*pos].opcode;
int len, pc; int len, pc;
char *str; char *str;
switch (op) switch (op)
{ {
case OP_NAME: case OP_NAME:

View File

@ -135,6 +135,7 @@ scm_scmlist_print (struct type *type, LONGEST svalue,
#define SCM_SIZE (TYPE_LENGTH (type)) #define SCM_SIZE (TYPE_LENGTH (type))
#define SCM_BYTE_ORDER (gdbarch_byte_order (get_type_arch (type))) #define SCM_BYTE_ORDER (gdbarch_byte_order (get_type_arch (type)))
unsigned int more = options->print_max; unsigned int more = options->print_max;
if (recurse > 6) if (recurse > 6)
{ {
fputs_filtered ("...", stream); fputs_filtered ("...", stream);
@ -240,6 +241,7 @@ taloop:
#if 0 #if 0
SCM name; SCM name;
#endif #endif
fputs_filtered ("#<latte ", stream); fputs_filtered ("#<latte ", stream);
#if 1 #if 1
fputs_filtered ("???", stream); fputs_filtered ("???", stream);
@ -313,6 +315,7 @@ taloop:
int i; int i;
LONGEST elements = SCM_CDR (svalue); LONGEST elements = SCM_CDR (svalue);
LONGEST val; LONGEST val;
fputs_filtered ("#(", stream); fputs_filtered ("#(", stream);
for (i = 0; i < len; ++i) for (i = 0; i < len; ++i)
{ {
@ -329,6 +332,7 @@ taloop:
{ {
SCM result; SCM result;
SCM hook; SCM hook;
hook = scm_get_lvector_hook (exp, LV_PRINT_FN); hook = scm_get_lvector_hook (exp, LV_PRINT_FN);
if (hook == BOOL_F) if (hook == BOOL_F)
{ {
@ -370,6 +374,7 @@ taloop:
#define SCM_CHARS(x) ((char *)(SCM_CDR(x))) #define SCM_CHARS(x) ((char *)(SCM_CDR(x)))
char *str = CHARS (SNAME (exp)); char *str = CHARS (SNAME (exp));
#endif #endif
fprintf_filtered (stream, "#<primitive-procedure %s>", fprintf_filtered (stream, "#<primitive-procedure %s>",
str); str);
} }
@ -447,6 +452,7 @@ scm_value_print (struct value *val, struct ui_file *stream,
const struct value_print_options *options) const struct value_print_options *options)
{ {
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.deref_ref = 1; opts.deref_ref = 1;
return (common_val_print (val, stream, 0, &opts, current_language)); return (common_val_print (val, stream, 0, &opts, current_language));
} }

View File

@ -36,6 +36,7 @@ sentinel_frame_cache (struct regcache *regcache)
{ {
struct frame_unwind_cache *cache = struct frame_unwind_cache *cache =
FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache); FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache);
cache->regcache = regcache; cache->regcache = regcache;
return cache; return cache;
} }
@ -81,6 +82,7 @@ sentinel_frame_prev_arch (struct frame_info *this_frame,
void **this_prologue_cache) void **this_prologue_cache)
{ {
struct frame_unwind_cache *cache = *this_prologue_cache; struct frame_unwind_cache *cache = *this_prologue_cache;
return get_regcache_arch (cache->regcache); return get_regcache_arch (cache->regcache);
} }

View File

@ -69,6 +69,7 @@ reschedule (struct serial *scb)
if (serial_is_async_p (scb)) if (serial_is_async_p (scb))
{ {
int next_state; int next_state;
switch (scb->async_state) switch (scb->async_state)
{ {
case FD_SCHEDULED: case FD_SCHEDULED:
@ -170,6 +171,7 @@ static void
push_event (void *context) push_event (void *context)
{ {
struct serial *scb = context; struct serial *scb = context;
scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */ scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */
scb->async_handler (scb, scb->async_context); scb->async_handler (scb, scb->async_context);
/* re-schedule */ /* re-schedule */

View File

@ -677,6 +677,7 @@ static int
dos_flush_input (struct serial *scb) dos_flush_input (struct serial *scb)
{ {
struct dos_ttystate *port = &ports[scb->fd]; struct dos_ttystate *port = &ports[scb->fd];
disable (); disable ();
port->first = port->count = 0; port->first = port->count = 0;
if (port->fifo) if (port->fifo)

View File

@ -751,6 +751,7 @@ ser_console_get_tty_state (struct serial *scb)
if (isatty (scb->fd)) if (isatty (scb->fd))
{ {
struct ser_console_ttystate *state; struct ser_console_ttystate *state;
state = (struct ser_console_ttystate *) xmalloc (sizeof *state); state = (struct ser_console_ttystate *) xmalloc (sizeof *state);
state->is_a_tty = 1; state->is_a_tty = 1;
return state; return state;
@ -985,6 +986,7 @@ pipe_avail (struct serial *scb, int fd)
HANDLE h = (HANDLE) _get_osfhandle (fd); HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD numBytes; DWORD numBytes;
BOOL r = PeekNamedPipe (h, NULL, 0, NULL, &numBytes, NULL); BOOL r = PeekNamedPipe (h, NULL, 0, NULL, &numBytes, NULL);
if (r == FALSE) if (r == FALSE)
numBytes = 0; numBytes = 0;
return numBytes; return numBytes;

View File

@ -63,6 +63,7 @@ pipe_open (struct serial *scb, const char *name)
int pdes[2]; int pdes[2];
int err_pdes[2]; int err_pdes[2];
int pid; int pid;
if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0) if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
return -1; return -1;
if (socketpair (AF_UNIX, SOCK_STREAM, 0, err_pdes) < 0) if (socketpair (AF_UNIX, SOCK_STREAM, 0, err_pdes) < 0)
@ -146,6 +147,7 @@ static void
pipe_close (struct serial *scb) pipe_close (struct serial *scb)
{ {
struct pipe_state *state = scb->state; struct pipe_state *state = scb->state;
if (state != NULL) if (state != NULL)
{ {
int pid = state->pid; int pid = state->pid;
@ -167,6 +169,7 @@ void
_initialize_ser_pipe (void) _initialize_ser_pipe (void)
{ {
struct serial_ops *ops = XMALLOC (struct serial_ops); struct serial_ops *ops = XMALLOC (struct serial_ops);
memset (ops, 0, sizeof (struct serial_ops)); memset (ops, 0, sizeof (struct serial_ops));
ops->name = "pipe"; ops->name = "pipe";
ops->next = 0; ops->next = 0;

View File

@ -119,6 +119,7 @@ wait_for_connect (struct serial *scb, int *polls)
if (scb) if (scb)
{ {
fd_set rset, wset, eset; fd_set rset, wset, eset;
FD_ZERO (&rset); FD_ZERO (&rset);
FD_SET (scb->fd, &rset); FD_SET (scb->fd, &rset);
wset = rset; wset = rset;
@ -272,6 +273,7 @@ net_open (struct serial *scb, const char *name)
{ {
int res, err; int res, err;
socklen_t len; socklen_t len;
len = sizeof (err); len = sizeof (err);
/* On Windows, the fourth parameter to getsockopt is a "char *"; /* On Windows, the fourth parameter to getsockopt is a "char *";
on UNIX systems it is generally "void *". The cast to "void *" on UNIX systems it is generally "void *". The cast to "void *"
@ -372,6 +374,7 @@ _initialize_ser_tcp (void)
ser-mingw.c. */ ser-mingw.c. */
#else #else
struct serial_ops *ops; struct serial_ops *ops;
ops = XMALLOC (struct serial_ops); ops = XMALLOC (struct serial_ops);
memset (ops, 0, sizeof (struct serial_ops)); memset (ops, 0, sizeof (struct serial_ops));
ops->name = "tcp"; ops->name = "tcp";

View File

@ -306,6 +306,7 @@ hardwire_drain_output (struct serial *scb)
to be discarded. */ to be discarded. */
{ {
struct hardwire_ttystate state; struct hardwire_ttystate state;
if (get_tty_state (scb, &state)) if (get_tty_state (scb, &state))
{ {
return (-1); return (-1);
@ -888,6 +889,7 @@ void
_initialize_ser_hardwire (void) _initialize_ser_hardwire (void)
{ {
struct serial_ops *ops = XMALLOC (struct serial_ops); struct serial_ops *ops = XMALLOC (struct serial_ops);
memset (ops, 0, sizeof (struct serial_ops)); memset (ops, 0, sizeof (struct serial_ops));
ops->name = "hardwire"; ops->name = "hardwire";
ops->next = 0; ops->next = 0;

View File

@ -528,6 +528,7 @@ serial_async (struct serial *scb,
void *context) void *context)
{ {
int changed = ((scb->async_handler == NULL) != (handler == NULL)); int changed = ((scb->async_handler == NULL) != (handler == NULL));
scb->async_handler = handler; scb->async_handler = handler;
scb->async_context = context; scb->async_context = context;
/* Only change mode if there is a need. */ /* Only change mode if there is a need. */

View File

@ -158,6 +158,7 @@ lookup_symbol_from_bfd (bfd *abfd, char *symname)
for (i = 0; i < number_of_symbols; i++) for (i = 0; i < number_of_symbols; i++)
{ {
asymbol *sym = symbol_table[i]; asymbol *sym = symbol_table[i];
if (strcmp (sym->name, symname) == 0 if (strcmp (sym->name, symname) == 0
&& (sym->section->flags & (SEC_CODE | SEC_DATA)) != 0) && (sym->section->flags & (SEC_CODE | SEC_DATA)) != 0)
{ {
@ -320,6 +321,7 @@ darwin_solib_create_inferior_hook (int from_tty)
if (dyld_bfd) if (dyld_bfd)
{ {
bfd *sub; bfd *sub;
sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object, sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object,
gdbarch_bfd_arch_info (target_gdbarch)); gdbarch_bfd_arch_info (target_gdbarch));
if (sub) if (sub)

View File

@ -1047,6 +1047,7 @@ frv_relocate_section_addresses (struct so_list *so,
&& sec->addr < map->segs[seg].p_vaddr + map->segs[seg].p_memsz) && sec->addr < map->segs[seg].p_vaddr + map->segs[seg].p_memsz)
{ {
CORE_ADDR displ = map->segs[seg].addr - map->segs[seg].p_vaddr; CORE_ADDR displ = map->segs[seg].addr - map->segs[seg].p_vaddr;
sec->addr += displ; sec->addr += displ;
sec->endaddr += displ; sec->endaddr += displ;
break; break;

View File

@ -163,6 +163,7 @@ fetch_lm_info (CORE_ADDR addr)
CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data, CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data,
sizeof (buf.ol32.data), sizeof (buf.ol32.data),
byte_order); byte_order);
li.next = extract_mips_address (&buf.ol32.next, li.next = extract_mips_address (&buf.ol32.next,
sizeof (buf.ol32.next), byte_order); sizeof (buf.ol32.next), byte_order);
@ -326,7 +327,6 @@ disable_break (void)
{ {
int status = 1; int status = 1;
/* Note that breakpoint address and original contents are in our address /* Note that breakpoint address and original contents are in our address
space, so we just need to write the original contents back. */ space, so we just need to write the original contents back. */

View File

@ -192,6 +192,7 @@ static int
lm_sec_cmp (const void *p1, const void *p2) lm_sec_cmp (const void *p1, const void *p2)
{ {
const struct lm_sec *lms1 = p1, *lms2 = p2; const struct lm_sec *lms1 = p1, *lms2 = p2;
return strcmp (lms1->name, lms2->name); return strcmp (lms1->name, lms2->name);
} }

View File

@ -491,6 +491,7 @@ pa64_current_sos (void)
#ifdef SOLIB_PA64_DBG #ifdef SOLIB_PA64_DBG
{ {
struct load_module_desc *d = &new->lm_info->desc; struct load_module_desc *d = &new->lm_info->desc;
printf ("\n+ library \"%s\" is described at index %d\n", new->so_name, printf ("\n+ library \"%s\" is described at index %d\n", new->so_name,
dll_index); dll_index);
printf (" text_base = %s\n", hex_string (d->text_base)); printf (" text_base = %s\n", hex_string (d->text_base));
@ -662,8 +663,8 @@ _initialize_pa64_solib (void)
void pa64_solib_select (struct gdbarch *gdbarch) void pa64_solib_select (struct gdbarch *gdbarch)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (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_thread_start_addr = pa64_solib_thread_start_addr;
tdep->solib_get_got_by_pc = pa64_solib_get_got_by_pc; tdep->solib_get_got_by_pc = pa64_solib_get_got_by_pc;
tdep->solib_get_solib_by_pc = pa64_solib_get_solib_by_pc; tdep->solib_get_solib_by_pc = pa64_solib_get_solib_by_pc;

View File

@ -816,8 +816,8 @@ void
som_solib_select (struct gdbarch *gdbarch) som_solib_select (struct gdbarch *gdbarch)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (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_thread_start_addr = som_solib_thread_start_addr;
tdep->solib_get_got_by_pc = som_solib_get_got_by_pc; tdep->solib_get_got_by_pc = som_solib_get_got_by_pc;
tdep->solib_get_solib_by_pc = som_solib_get_solib_by_pc; tdep->solib_get_solib_by_pc = som_solib_get_solib_by_pc;

View File

@ -124,6 +124,7 @@ spu_current_sos (void)
if (size == 4) if (size == 4)
{ {
int fd = extract_unsigned_integer (buf, 4, byte_order); int fd = extract_unsigned_integer (buf, 4, byte_order);
spu_relocate_main_executable (fd); spu_relocate_main_executable (fd);
/* Re-enable breakpoints after main SPU context was established; /* Re-enable breakpoints after main SPU context was established;
@ -307,9 +308,11 @@ spu_bfd_open (char *pathname)
if (spu_name) if (spu_name)
{ {
int sect_size = bfd_section_size (abfd, spu_name); int sect_size = bfd_section_size (abfd, spu_name);
if (sect_size > 20) if (sect_size > 20)
{ {
char *buf = alloca (sect_size - 20 + strlen (original_name) + 1); char *buf = alloca (sect_size - 20 + strlen (original_name) + 1);
bfd_get_section_contents (abfd, spu_name, buf, 20, sect_size - 20); bfd_get_section_contents (abfd, spu_name, buf, 20, sect_size - 20);
buf[sect_size - 20] = '\0'; buf[sect_size - 20] = '\0';
@ -352,6 +355,7 @@ spu_enable_break (struct objfile *objfile)
if (spe_event_sym) if (spe_event_sym)
{ {
CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (spe_event_sym); CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (spe_event_sym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, addr, addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, addr,
&current_target); &current_target);
create_solib_event_breakpoint (target_gdbarch, addr); create_solib_event_breakpoint (target_gdbarch, addr);

View File

@ -723,6 +723,7 @@ scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr)
if (arch_size == 32) if (arch_size == 32)
{ {
Elf32_External_Dyn *dynp = (Elf32_External_Dyn *) buf; Elf32_External_Dyn *dynp = (Elf32_External_Dyn *) buf;
dyn_tag = extract_unsigned_integer ((gdb_byte *) dynp->d_tag, dyn_tag = extract_unsigned_integer ((gdb_byte *) dynp->d_tag,
4, byte_order); 4, byte_order);
dyn_ptr = extract_unsigned_integer ((gdb_byte *) dynp->d_un.d_ptr, dyn_ptr = extract_unsigned_integer ((gdb_byte *) dynp->d_un.d_ptr,
@ -731,6 +732,7 @@ scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr)
else else
{ {
Elf64_External_Dyn *dynp = (Elf64_External_Dyn *) buf; Elf64_External_Dyn *dynp = (Elf64_External_Dyn *) buf;
dyn_tag = extract_unsigned_integer ((gdb_byte *) dynp->d_tag, dyn_tag = extract_unsigned_integer ((gdb_byte *) dynp->d_tag,
8, byte_order); 8, byte_order);
dyn_ptr = extract_unsigned_integer ((gdb_byte *) dynp->d_un.d_ptr, dyn_ptr = extract_unsigned_integer ((gdb_byte *) dynp->d_un.d_ptr,
@ -793,6 +795,7 @@ elf_locate_base (void)
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
gdb_byte *pbuf; gdb_byte *pbuf;
int pbuf_size = TYPE_LENGTH (ptr_type); int pbuf_size = TYPE_LENGTH (ptr_type);
pbuf = alloca (pbuf_size); pbuf = alloca (pbuf_size);
/* DT_MIPS_RLD_MAP contains a pointer to the address /* DT_MIPS_RLD_MAP contains a pointer to the address
of the dynamic link structure. */ of the dynamic link structure. */
@ -1519,6 +1522,7 @@ enable_break (struct svr4_info *info, int from_tty)
{ {
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (inferior_ptid, target_gdbarch); = get_thread_arch_regcache (inferior_ptid, target_gdbarch);
load_addr = (regcache_read_pc (regcache) load_addr = (regcache_read_pc (regcache)
- exec_entry_point (tmp_bfd, tmp_bfd_target)); - exec_entry_point (tmp_bfd, tmp_bfd_target));
} }
@ -2065,6 +2069,7 @@ static int
svr4_have_link_map_offsets (void) svr4_have_link_map_offsets (void)
{ {
struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data); struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data);
return (ops->fetch_link_map_offsets != NULL); return (ops->fetch_link_map_offsets != NULL);
} }

View File

@ -135,6 +135,7 @@ library_list_end_library (struct gdb_xml_parser *parser,
{ {
VEC(lm_info_p) **list = user_data; VEC(lm_info_p) **list = user_data;
struct lm_info *lm_info = VEC_last (lm_info_p, *list); struct lm_info *lm_info = VEC_last (lm_info_p, *list);
if (lm_info->segment_bases == NULL if (lm_info->segment_bases == NULL
&& lm_info->section_bases == NULL) && lm_info->section_bases == NULL)
gdb_xml_error (parser, gdb_xml_error (parser,
@ -364,6 +365,7 @@ Could not relocate shared library \"%s\": wrong number of ALLOC sections"),
int bases_index = 0; int bases_index = 0;
int found_range = 0; int found_range = 0;
CORE_ADDR *section_bases; CORE_ADDR *section_bases;
section_bases = VEC_address (CORE_ADDR, section_bases = VEC_address (CORE_ADDR,
so->lm_info->section_bases); so->lm_info->section_bases);
@ -378,6 +380,7 @@ Could not relocate shared library \"%s\": wrong number of ALLOC sections"),
if (bfd_section_size (so->abfd, sect) > 0) if (bfd_section_size (so->abfd, sect) > 0)
{ {
CORE_ADDR low, high; CORE_ADDR low, high;
low = section_bases[i]; low = section_bases[i];
high = low + bfd_section_size (so->abfd, sect) - 1; high = low + bfd_section_size (so->abfd, sect) - 1;
@ -399,6 +402,7 @@ Could not relocate shared library \"%s\": wrong number of ALLOC sections"),
else if (so->lm_info->segment_bases) else if (so->lm_info->segment_bases)
{ {
struct symfile_segment_data *data; struct symfile_segment_data *data;
data = get_symfile_segment_data (so->abfd); data = get_symfile_segment_data (so->abfd);
if (data == NULL) if (data == NULL)
warning (_("\ warning (_("\

View File

@ -68,6 +68,7 @@ static struct target_so_ops *
solib_ops (struct gdbarch *gdbarch) solib_ops (struct gdbarch *gdbarch)
{ {
struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data); struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data);
return *ops; return *ops;
} }
@ -77,6 +78,7 @@ void
set_solib_ops (struct gdbarch *gdbarch, struct target_so_ops *new_ops) set_solib_ops (struct gdbarch *gdbarch, struct target_so_ops *new_ops)
{ {
struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data); struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data);
*ops = new_ops; *ops = new_ops;
} }
@ -169,6 +171,7 @@ solib_find (char *in_pathname, int *fd)
if (solib_symbols_extension) if (solib_symbols_extension)
{ {
char *p = in_pathname + strlen (in_pathname); char *p = in_pathname + strlen (in_pathname);
while (p > in_pathname && *p != '.') while (p > in_pathname && *p != '.')
p--; p--;
@ -1200,6 +1203,7 @@ clear_solib (void)
while (so_list_head) while (so_list_head)
{ {
struct so_list *so = so_list_head; struct so_list *so = so_list_head;
so_list_head = so->next; so_list_head = so->next;
observer_notify_solib_unloaded (so); observer_notify_solib_unloaded (so);
if (so->abfd) if (so->abfd)
@ -1229,6 +1233,7 @@ void
solib_create_inferior_hook (int from_tty) solib_create_inferior_hook (int from_tty)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch);
ops->solib_create_inferior_hook (from_tty); ops->solib_create_inferior_hook (from_tty);
} }
@ -1252,6 +1257,7 @@ int
in_solib_dynsym_resolve_code (CORE_ADDR pc) in_solib_dynsym_resolve_code (CORE_ADDR pc)
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch);
return ops->in_dynsym_resolve_code (pc); return ops->in_dynsym_resolve_code (pc);
} }

View File

@ -267,6 +267,7 @@ select_source_symtab (struct symtab *s)
{ {
const char *name = s->filename; const char *name = s->filename;
int len = strlen (name); int len = strlen (name);
if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0 if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
|| strcmp (name, "<<C++-namespaces>>") == 0))) || strcmp (name, "<<C++-namespaces>>") == 0)))
{ {
@ -519,6 +520,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
if (stat (name, &st) < 0) if (stat (name, &st) < 0)
{ {
int save_errno = errno; int save_errno = errno;
fprintf_unfiltered (gdb_stderr, "Warning: "); fprintf_unfiltered (gdb_stderr, "Warning: ");
print_sys_errmsg (name, save_errno); print_sys_errmsg (name, save_errno);
} }
@ -813,6 +815,7 @@ done:
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
? "" : SLASH_STRING, ? "" : SLASH_STRING,
filename, (char *)NULL); filename, (char *)NULL);
*filename_opened = xfullpath (f); *filename_opened = xfullpath (f);
xfree (f); xfree (f);
} }
@ -1910,6 +1913,7 @@ void
_initialize_source (void) _initialize_source (void)
{ {
struct cmd_list_element *c; struct cmd_list_element *c;
current_source_symtab = 0; current_source_symtab = 0;
init_source_path (); init_source_path ();

View File

@ -352,7 +352,6 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
if (stabs) if (stabs)
{ {
/* for all the stab entries, find their corresponding symbols and /* for all the stab entries, find their corresponding symbols and
patch their types! */ patch their types! */
@ -435,6 +434,7 @@ static int
read_type_number (char **pp, int *typenums) read_type_number (char **pp, int *typenums)
{ {
int nbits; int nbits;
if (**pp == '(') if (**pp == '(')
{ {
(*pp)++; (*pp)++;
@ -508,9 +508,11 @@ ref_add (int refnum, struct symbol *sym, char *stabs, CORE_ADDR value)
{ {
int new_slots = ref_count - ref_chunk * MAX_CHUNK_REFS; int new_slots = ref_count - ref_chunk * MAX_CHUNK_REFS;
int new_chunks = new_slots / MAX_CHUNK_REFS + 1; int new_chunks = new_slots / MAX_CHUNK_REFS + 1;
ref_map = (struct ref_map *) ref_map = (struct ref_map *)
xrealloc (ref_map, REF_MAP_SIZE (ref_chunk + new_chunks)); 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_chunk += new_chunks;
} }
ref_map[refnum].stabs = stabs; ref_map[refnum].stabs = stabs;
@ -706,6 +708,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
if (SYMBOL_LANGUAGE (sym) == language_cplus) if (SYMBOL_LANGUAGE (sym) == language_cplus)
{ {
char *name = alloca (p - string + 1); char *name = alloca (p - string + 1);
memcpy (name, string, p - string); memcpy (name, string, p - string);
name[p - string] = '\0'; name[p - string] = '\0';
new_name = cp_canonicalize_string (name); new_name = cp_canonicalize_string (name);
@ -1121,6 +1124,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
&& gdbarch_stabs_argument_has_addr (gdbarch, SYMBOL_TYPE (sym))) && gdbarch_stabs_argument_has_addr (gdbarch, SYMBOL_TYPE (sym)))
{ {
struct symbol *prev_sym; struct symbol *prev_sym;
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1]; prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG) || SYMBOL_CLASS (prev_sym) == LOC_ARG)
@ -1154,11 +1158,13 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
!= SYMBOL_LINKAGE_NAME (sym)) != SYMBOL_LINKAGE_NAME (sym))
{ {
struct minimal_symbol *msym; 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) if (msym != NULL)
{ {
char *new_name = gdbarch_static_transform_name char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
} }
@ -1205,6 +1211,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
&& TYPE_N_BASECLASSES (SYMBOL_TYPE (sym))) && TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)))
{ {
int j; int j;
for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--) for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--)
if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0) if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0)
TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) = TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) =
@ -1315,7 +1322,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
{ {
/* Clone the sym and then modify it. */ /* Clone the sym and then modify it. */
struct symbol *typedef_sym = (struct symbol *) 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; *typedef_sym = *sym;
SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF; SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
SYMBOL_VALUE (typedef_sym) = valu; SYMBOL_VALUE (typedef_sym) = valu;
@ -1339,11 +1347,14 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
!= SYMBOL_LINKAGE_NAME (sym)) != SYMBOL_LINKAGE_NAME (sym))
{ {
struct minimal_symbol *msym; 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) if (msym != NULL)
{ {
char *new_name = gdbarch_static_transform_name char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
} }
@ -1580,6 +1591,7 @@ again:
if (q1 && p > q1 && p[1] == ':') if (q1 && p > q1 && p[1] == ':')
{ {
int nesting_level = 0; int nesting_level = 0;
for (q2 = q1; *q2; q2++) for (q2 = q1; *q2; q2++)
{ {
if (*q2 == '<') if (*q2 == '<')
@ -1597,6 +1609,7 @@ again:
if (current_subfile->language == language_cplus) if (current_subfile->language == language_cplus)
{ {
char *new_name, *name = alloca (p - *pp + 1); char *new_name, *name = alloca (p - *pp + 1);
memcpy (name, *pp, p - *pp); memcpy (name, *pp, p - *pp);
name[p - *pp] = '\0'; name[p - *pp] = '\0';
new_name = cp_canonicalize_string (name); new_name = cp_canonicalize_string (name);
@ -1684,6 +1697,7 @@ again:
TYPE_CODE (type) = TYPE_CODE_TYPEDEF; TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
{ {
struct type *xtype = read_type (pp, objfile); struct type *xtype = read_type (pp, objfile);
if (type == xtype) if (type == xtype)
{ {
/* It's being defined as itself. That means it is "void". */ /* It's being defined as itself. That means it is "void". */
@ -1856,6 +1870,7 @@ again:
/* type attribute */ /* type attribute */
{ {
char *attr = *pp; char *attr = *pp;
/* Skip to the semicolon. */ /* Skip to the semicolon. */
while (**pp != ';' && **pp != '\0') while (**pp != ';' && **pp != '\0')
++(*pp); ++(*pp);
@ -2667,6 +2682,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
{ {
char dem_opname[256]; char dem_opname[256];
int ret; int ret;
ret = cplus_demangle_opname (new_fnlist->fn_fieldlist.name, ret = cplus_demangle_opname (new_fnlist->fn_fieldlist.name,
dem_opname, DMGL_ANSI); dem_opname, DMGL_ANSI);
if (!ret) if (!ret)
@ -2744,9 +2760,9 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
case 'f': /* $vf -- a virtual function table pointer */ case 'f': /* $vf -- a virtual function table pointer */
name = type_name_no_tag (context); name = type_name_no_tag (context);
if (name == NULL) if (name == NULL)
{ {
name = ""; name = "";
} }
fip->list->field.name = obconcat (&objfile->objfile_obstack, fip->list->field.name = obconcat (&objfile->objfile_obstack,
vptr_name, name, (char *) NULL); vptr_name, name, (char *) NULL);
break; break;
@ -2789,6 +2805,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
{ {
int nbits; int nbits;
FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ';', &nbits, FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ';', &nbits,
0); 0);
if (nbits != 0) if (nbits != 0)
@ -2865,6 +2882,7 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p,
{ {
int nbits; int nbits;
FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ',', &nbits, 0); FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ',', &nbits, 0);
if (nbits != 0) if (nbits != 0)
{ {
@ -3068,6 +3086,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
ALLOCATE_CPLUS_STRUCT_TYPE (type); ALLOCATE_CPLUS_STRUCT_TYPE (type);
{ {
int nbits; int nbits;
TYPE_N_BASECLASSES (type) = read_huge_number (pp, ',', &nbits, 0); TYPE_N_BASECLASSES (type) = read_huge_number (pp, ',', &nbits, 0);
if (nbits != 0) if (nbits != 0)
return 0; return 0;
@ -3228,6 +3247,7 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
--i) --i)
{ {
char *name = TYPE_FIELD_NAME (t, i); char *name = TYPE_FIELD_NAME (t, i);
if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2) if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
&& is_cplus_marker (name[sizeof (vptr_name) - 2])) && is_cplus_marker (name[sizeof (vptr_name) - 2]))
{ {
@ -3483,6 +3503,7 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code,
{ {
int nbits; int nbits;
TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0); TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0);
if (nbits != 0) if (nbits != 0)
return error_type (pp, objfile); return error_type (pp, objfile);
@ -3673,9 +3694,11 @@ read_enum_type (char **pp, struct type *type,
{ {
int last = syms == osyms ? o_nsyms : 0; int last = syms == osyms ? o_nsyms : 0;
int j = syms->nsyms; int j = syms->nsyms;
for (; --j >= last; --n) for (; --j >= last; --n)
{ {
struct symbol *xsym = syms->symbol[j]; struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type; SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
@ -3860,6 +3883,7 @@ read_huge_number (char **pp, int end, int *bits, int twos_complement_bits)
size_t len; size_t len;
char *p1 = p; char *p1 = p;
while ((c = *p1) >= '0' && c < '8') while ((c = *p1) >= '0' && c < '8')
p1++; p1++;
@ -3893,6 +3917,7 @@ read_huge_number (char **pp, int end, int *bits, int twos_complement_bits)
if (n == 0) if (n == 0)
{ {
long sn = c - '0' - ((2 * (c - '0')) | (2 << sign_bit)); long sn = c - '0' - ((2 * (c - '0')) | (2 << sign_bit));
n = -sn; n = -sn;
} }
else else
@ -4095,6 +4120,7 @@ read_range_type (char **pp, int typenums[2], int type_size,
{ {
struct type *complex_type = struct type *complex_type =
init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile); init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile);
TYPE_TARGET_TYPE (complex_type) = float_type; TYPE_TARGET_TYPE (complex_type) = float_type;
return complex_type; return complex_type;
} }
@ -4107,6 +4133,7 @@ read_range_type (char **pp, int typenums[2], int type_size,
else if (n2 == 0 && n3 == -1) else if (n2 == 0 && n3 == -1)
{ {
int bits = type_size; int bits = type_size;
if (bits <= 0) if (bits <= 0)
{ {
/* We don't know its size. It is unsigned int or unsigned /* We don't know its size. It is unsigned int or unsigned
@ -4343,9 +4370,11 @@ static void
fix_common_block (struct symbol *sym, int valu) fix_common_block (struct symbol *sym, int valu)
{ {
struct pending *next = (struct pending *) SYMBOL_TYPE (sym); struct pending *next = (struct pending *) SYMBOL_TYPE (sym);
for (; next; next = next->next) for (; next; next = next->next)
{ {
int j; int j;
for (j = next->nsyms - 1; j >= 0; j--) for (j = next->nsyms - 1; j >= 0; j--)
SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu; SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu;
} }
@ -4748,6 +4777,7 @@ static char *
find_name_end (char *name) find_name_end (char *name)
{ {
char *s = name; char *s = name;
if (s[0] == '-' || *s == '+') if (s[0] == '-' || *s == '+')
{ {
/* Must be an ObjC method symbol. */ /* Must be an ObjC method symbol. */

View File

@ -287,6 +287,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
if (*SYMBOL_LINKAGE_NAME (sym)) if (*SYMBOL_LINKAGE_NAME (sym))
{ {
struct symbol *nsym; struct symbol *nsym;
nsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), nsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
b, VAR_DOMAIN, NULL); b, VAR_DOMAIN, NULL);
gdb_assert (nsym != NULL); gdb_assert (nsym != NULL);
@ -624,6 +625,7 @@ print_frame_info (struct frame_info *frame, int print_level,
else else
{ {
struct value_print_options opts; struct value_print_options opts;
get_user_print_options (&opts); get_user_print_options (&opts);
/* We used to do this earlier, but that is clearly /* We used to do this earlier, but that is clearly
wrong. This function is used by many different wrong. This function is used by many different
@ -721,6 +723,7 @@ find_frame_funname (struct frame_info *frame, char **funname,
with DMGL_PARAMS turned on, and here we don't want to with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */ display parameters. So remove the parameters. */
char *func_only = cp_remove_params (*funname); char *func_only = cp_remove_params (*funname);
if (func_only) if (func_only)
{ {
*funname = func_only; *funname = func_only;
@ -792,6 +795,7 @@ print_frame (struct frame_info *frame, int print_level,
{ {
struct print_args_args args; struct print_args_args args;
struct cleanup *args_list_chain; struct cleanup *args_list_chain;
args.frame = frame; args.frame = frame;
args.func = find_pc_function (get_frame_address_in_block (frame)); args.func = find_pc_function (get_frame_address_in_block (frame));
args.stream = gdb_stdout; args.stream = gdb_stdout;
@ -814,6 +818,7 @@ print_frame (struct frame_info *frame, int print_level,
if (ui_out_is_mi_like_p (uiout)) if (ui_out_is_mi_like_p (uiout))
{ {
const char *fullname = symtab_to_fullname (sal.symtab); const char *fullname = symtab_to_fullname (sal.symtab);
if (fullname != NULL) if (fullname != NULL)
ui_out_field_string (uiout, "fullname", fullname); ui_out_field_string (uiout, "fullname", fullname);
} }
@ -919,6 +924,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message,
{ {
struct frame_info *fid; struct frame_info *fid;
int level = value_as_long (args[0]); int level = value_as_long (args[0]);
fid = find_relative_frame (get_current_frame (), &level); fid = find_relative_frame (get_current_frame (), &level);
if (level == 0) if (level == 0)
/* find_relative_frame was successful */ /* find_relative_frame was successful */
@ -928,6 +934,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message,
/* Convert each value into a corresponding address. */ /* Convert each value into a corresponding address. */
{ {
int i; int i;
for (i = 0; i < numargs; i++) for (i = 0; i < numargs; i++)
addrs[i] = value_as_address (args[i]); addrs[i] = value_as_address (args[i]);
} }
@ -1034,6 +1041,7 @@ frame_info (char *addr_exp, int from_tty)
with DMGL_PARAMS turned on, and here we don't want to with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */ display parameters. So remove the parameters. */
char *func_only = cp_remove_params (funname); char *func_only = cp_remove_params (funname);
if (func_only) if (func_only)
{ {
funname = func_only; funname = func_only;
@ -1195,6 +1203,7 @@ frame_info (char *addr_exp, int from_tty)
int sp_size = register_size (gdbarch, gdbarch_sp_regnum (gdbarch)); int sp_size = register_size (gdbarch, gdbarch_sp_regnum (gdbarch));
gdb_byte value[MAX_REGISTER_SIZE]; gdb_byte value[MAX_REGISTER_SIZE];
CORE_ADDR sp; CORE_ADDR sp;
frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch), frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch),
&optimized, &lval, &addr, &optimized, &lval, &addr,
&realnum, value); &realnum, value);
@ -1321,6 +1330,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi)) for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi))
{ {
CORE_ADDR pc; CORE_ADDR pc;
QUIT; QUIT;
pc = get_frame_address_in_block (fi); pc = get_frame_address_in_block (fi);
find_pc_sect_symtab_via_partial (pc, find_pc_mapped_section (pc)); find_pc_sect_symtab_via_partial (pc, find_pc_mapped_section (pc));
@ -1514,6 +1524,7 @@ print_block_frame_labels (struct gdbarch *gdbarch, struct block *b,
{ {
struct symtab_and_line sal; struct symtab_and_line sal;
struct value_print_options opts; struct value_print_options opts;
sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0); sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
values_printed = 1; values_printed = 1;
fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
@ -1815,6 +1826,7 @@ find_relative_frame (struct frame_info *frame, int *level_offset_ptr)
while (*level_offset_ptr > 0) while (*level_offset_ptr > 0)
{ {
struct frame_info *prev = get_prev_frame (frame); struct frame_info *prev = get_prev_frame (frame);
if (!prev) if (!prev)
break; break;
(*level_offset_ptr)--; (*level_offset_ptr)--;
@ -1825,6 +1837,7 @@ find_relative_frame (struct frame_info *frame, int *level_offset_ptr)
while (*level_offset_ptr < 0) while (*level_offset_ptr < 0)
{ {
struct frame_info *next = get_next_frame (frame); struct frame_info *next = get_next_frame (frame);
if (!next) if (!next)
break; break;
(*level_offset_ptr)++; (*level_offset_ptr)++;
@ -2012,6 +2025,7 @@ If you continue, the return value that you specified will be ignored.\n";
if (from_tty) if (from_tty)
{ {
int confirmed; int confirmed;
if (thisfun == NULL) if (thisfun == NULL)
confirmed = query (_("%sMake selected stack frame return now? "), confirmed = query (_("%sMake selected stack frame return now? "),
query_prefix); query_prefix);

View File

@ -32,6 +32,7 @@ static struct value *
value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton) value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
if (gdbarch_deprecated_fp_regnum (gdbarch) >= 0) if (gdbarch_deprecated_fp_regnum (gdbarch) >= 0)
/* NOTE: cagney/2003-04-24: Since the mere presence of "fp" in the /* NOTE: cagney/2003-04-24: Since the mere presence of "fp" in the
register name table overrides this built-in $fp register, there register name table overrides this built-in $fp register, there
@ -46,6 +47,7 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr; struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
struct value *val = allocate_value (data_ptr_type); struct value *val = allocate_value (data_ptr_type);
gdb_byte *buf = value_contents_raw (val); gdb_byte *buf = value_contents_raw (val);
if (frame == NULL) if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val))); memset (buf, 0, TYPE_LENGTH (value_type (val)));
else else
@ -59,6 +61,7 @@ static struct value *
value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton) value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
if (gdbarch_pc_regnum (gdbarch) >= 0) if (gdbarch_pc_regnum (gdbarch) >= 0)
return value_of_register (gdbarch_pc_regnum (gdbarch), frame); return value_of_register (gdbarch_pc_regnum (gdbarch), frame);
else else
@ -66,6 +69,7 @@ value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr; struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
struct value *val = allocate_value (func_ptr_type); struct value *val = allocate_value (func_ptr_type);
gdb_byte *buf = value_contents_raw (val); gdb_byte *buf = value_contents_raw (val);
if (frame == NULL) if (frame == NULL)
memset (buf, 0, TYPE_LENGTH (value_type (val))); memset (buf, 0, TYPE_LENGTH (value_type (val)));
else else
@ -79,6 +83,7 @@ static struct value *
value_of_builtin_frame_sp_reg (struct frame_info *frame, const void *baton) value_of_builtin_frame_sp_reg (struct frame_info *frame, const void *baton)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
if (gdbarch_sp_regnum (gdbarch) >= 0) if (gdbarch_sp_regnum (gdbarch) >= 0)
return value_of_register (gdbarch_sp_regnum (gdbarch), frame); return value_of_register (gdbarch_sp_regnum (gdbarch), frame);
error (_("Standard register ``$sp'' is not available for this target")); error (_("Standard register ``$sp'' is not available for this target"));
@ -88,6 +93,7 @@ static struct value *
value_of_builtin_frame_ps_reg (struct frame_info *frame, const void *baton) value_of_builtin_frame_ps_reg (struct frame_info *frame, const void *baton)
{ {
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
if (gdbarch_ps_regnum (gdbarch) >= 0) if (gdbarch_ps_regnum (gdbarch) >= 0)
return value_of_register (gdbarch_ps_regnum (gdbarch), frame); return value_of_register (gdbarch_ps_regnum (gdbarch), frame);
error (_("Standard register ``$ps'' is not available for this target")); error (_("Standard register ``$ps'' is not available for this target"));

View File

@ -205,6 +205,7 @@ obsavestring (const char *ptr, int size, struct obstack *obstackp)
const char *p1 = ptr; const char *p1 = ptr;
char *p2 = p; char *p2 = p;
const char *end = ptr + size; const char *end = ptr + size;
while (p1 != end) while (p1 != end)
*p2++ = *p1++; *p2++ = *p1++;
} }
@ -1010,7 +1011,6 @@ syms_from_objfile (struct objfile *objfile,
void void
new_symfile_objfile (struct objfile *objfile, int add_flags) 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 /* 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 old main symbol file. Otherwise it is sufficient to fixup all the
breakpoints that may have been redefined by this symbol file. */ breakpoints that may have been redefined by this symbol file. */
@ -1608,6 +1608,7 @@ symfile_bfd_open (char *name)
if (desc < 0) if (desc < 0)
{ {
char *exename = alloca (strlen (name) + 5); char *exename = alloca (strlen (name) + 5);
strcat (strcpy (exename, name), ".exe"); strcat (strcpy (exename, name), ".exe");
desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename, desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename,
O_RDONLY | O_BINARY, &absolute_name); O_RDONLY | O_BINARY, &absolute_name);

View File

@ -391,6 +391,7 @@ dump_symtab_1 (struct objfile *objfile, struct symtab *symtab,
ALL_BLOCK_SYMBOLS (b, iter, sym) ALL_BLOCK_SYMBOLS (b, iter, sym)
{ {
struct print_symbol_args s; struct print_symbol_args s;
s.gdbarch = gdbarch; s.gdbarch = gdbarch;
s.symbol = sym; s.symbol = sym;
s.depth = depth + 1; s.depth = depth + 1;
@ -551,6 +552,7 @@ print_symbol (void *args)
{ {
unsigned i; unsigned i;
struct type *type = check_typedef (SYMBOL_TYPE (symbol)); struct type *type = check_typedef (SYMBOL_TYPE (symbol));
fprintf_filtered (outfile, "const %u hex bytes:", fprintf_filtered (outfile, "const %u hex bytes:",
TYPE_LENGTH (type)); TYPE_LENGTH (type));
for (i = 0; i < TYPE_LENGTH (type); i++) for (i = 0; i < TYPE_LENGTH (type); i++)
@ -782,6 +784,7 @@ static int
block_depth (struct block *block) block_depth (struct block *block)
{ {
int i = 0; int i = 0;
while ((block = BLOCK_SUPERBLOCK (block)) != NULL) while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
{ {
i++; i++;

View File

@ -191,6 +191,7 @@ got_symtab:
if (full_path != NULL) if (full_path != NULL)
{ {
const char *fp = symtab_to_fullname (s); const char *fp = symtab_to_fullname (s);
if (fp != NULL && FILENAME_CMP (full_path, fp) == 0) if (fp != NULL && FILENAME_CMP (full_path, fp) == 0)
{ {
return s; return s;
@ -200,9 +201,11 @@ got_symtab:
if (real_path != NULL) if (real_path != NULL)
{ {
char *fullname = symtab_to_fullname (s); char *fullname = symtab_to_fullname (s);
if (fullname != NULL) if (fullname != NULL)
{ {
char *rp = gdb_realpath (fullname); char *rp = gdb_realpath (fullname);
make_cleanup (xfree, rp); make_cleanup (xfree, rp);
if (FILENAME_CMP (real_path, rp) == 0) if (FILENAME_CMP (real_path, rp) == 0)
{ {
@ -320,13 +323,12 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id)
mangled_name_len = ((is_constructor ? 0 : strlen (field_name)) mangled_name_len = ((is_constructor ? 0 : strlen (field_name))
+ strlen (buf) + len + strlen (physname) + 1); + strlen (buf) + len + strlen (physname) + 1);
{ mangled_name = (char *) xmalloc (mangled_name_len);
mangled_name = (char *) xmalloc (mangled_name_len); if (is_constructor)
if (is_constructor) mangled_name[0] = '\0';
mangled_name[0] = '\0'; else
else strcpy (mangled_name, field_name);
strcpy (mangled_name, field_name);
}
strcat (mangled_name, buf); strcat (mangled_name, buf);
/* If the class doesn't have a name, i.e. newname NULL, then we just /* 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 mangle it using 0 for the length of the class. Thus it gets mangled
@ -374,6 +376,7 @@ static hashval_t
hash_demangled_name_entry (const void *data) hash_demangled_name_entry (const void *data)
{ {
const struct demangled_name_entry *e = data; const struct demangled_name_entry *e = data;
return htab_hash_string (e->mangled); return htab_hash_string (e->mangled);
} }
@ -383,6 +386,7 @@ eq_demangled_name_entry (const void *a, const void *b)
{ {
const struct demangled_name_entry *da = a; const struct demangled_name_entry *da = a;
const struct demangled_name_entry *db = b; const struct demangled_name_entry *db = b;
return strcmp (da->mangled, db->mangled) == 0; return strcmp (da->mangled, db->mangled) == 0;
} }
@ -541,8 +545,8 @@ symbol_set_names (struct general_symbol_info *gsymbol,
if (gsymbol->language == language_java) if (gsymbol->language == language_java)
{ {
char *alloc_name; char *alloc_name;
lookup_len = len + JAVA_PREFIX_LEN;
lookup_len = len + JAVA_PREFIX_LEN;
alloc_name = alloca (lookup_len + 1); alloc_name = alloca (lookup_len + 1);
memcpy (alloc_name, JAVA_PREFIX, JAVA_PREFIX_LEN); memcpy (alloc_name, JAVA_PREFIX, JAVA_PREFIX_LEN);
memcpy (alloc_name + JAVA_PREFIX_LEN, linkage_name, len); memcpy (alloc_name + JAVA_PREFIX_LEN, linkage_name, len);
@ -554,8 +558,8 @@ symbol_set_names (struct general_symbol_info *gsymbol,
else if (linkage_name[len] != '\0') else if (linkage_name[len] != '\0')
{ {
char *alloc_name; char *alloc_name;
lookup_len = len;
lookup_len = len;
alloc_name = alloca (lookup_len + 1); alloc_name = alloca (lookup_len + 1);
memcpy (alloc_name, linkage_name, len); memcpy (alloc_name, linkage_name, len);
alloc_name[lookup_len] = '\0'; alloc_name[lookup_len] = '\0';
@ -796,6 +800,7 @@ find_pc_sect_symtab_via_partial (CORE_ADDR pc, struct obj_section *section)
ALL_OBJFILES (objfile) ALL_OBJFILES (objfile)
{ {
struct symtab *result = NULL; struct symtab *result = NULL;
if (objfile->sf) if (objfile->sf)
result = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol, result = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol,
pc, section, 0); pc, section, 0);
@ -865,6 +870,7 @@ fixup_section (struct general_symbol_info *ginfo,
a search of the section table. */ a search of the section table. */
struct obj_section *s; struct obj_section *s;
ALL_OBJFILE_OSECTIONS (objfile, s) ALL_OBJFILE_OSECTIONS (objfile, s)
{ {
int idx = s->the_bfd_section->index; int idx = s->the_bfd_section->index;
@ -954,8 +960,8 @@ lookup_symbol_in_language (const char *name, const struct block *block,
modified_name = name; modified_name = name;
/* If we are using C++, D, or Java, demangle the name before doing a lookup, so /* If we are using C++, D, or Java, demangle the name before doing a
we can always binary search. */ lookup, so we can always binary search. */
if (lang == language_cplus) if (lang == language_cplus)
{ {
demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS); demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
@ -1067,6 +1073,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
{ {
struct symbol *sym = NULL; struct symbol *sym = NULL;
const struct block *function_block = block; const struct block *function_block = block;
/* 'this' is only defined in the function's block, so find the /* 'this' is only defined in the function's block, so find the
enclosing function block. */ enclosing function block. */
for (; function_block && !BLOCK_FUNCTION (function_block); for (; function_block && !BLOCK_FUNCTION (function_block);
@ -1715,6 +1722,7 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
if ((objfile->flags & OBJF_REORDERED) && objfile->sf) if ((objfile->flags & OBJF_REORDERED) && objfile->sf)
{ {
struct symtab *result; struct symtab *result;
result result
= objfile->sf->qf->find_pc_sect_symtab (objfile, = objfile->sf->qf->find_pc_sect_symtab (objfile,
msymbol, msymbol,
@ -1748,6 +1756,7 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
ALL_OBJFILES (objfile) ALL_OBJFILES (objfile)
{ {
struct symtab *result; struct symtab *result;
if (!objfile->sf) if (!objfile->sf)
continue; continue;
result = objfile->sf->qf->find_pc_sect_symtab (objfile, result = objfile->sf->qf->find_pc_sect_symtab (objfile,
@ -2047,7 +2056,8 @@ find_pc_line (CORE_ADDR pc, int notcurrent)
If not found, return NULL. */ If not found, return NULL. */
struct symtab * 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. */ int exact = 0; /* Initialized here to avoid a compiler warning. */
@ -2256,6 +2266,7 @@ int
find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr) find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
{ {
struct symtab_and_line sal; struct symtab_and_line sal;
sal = find_pc_line (pc, 0); sal = find_pc_line (pc, 0);
*startptr = sal.pc; *startptr = sal.pc;
*endptr = sal.end; *endptr = sal.end;
@ -2371,6 +2382,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
{ {
struct minimal_symbol *msymbol struct minimal_symbol *msymbol
= lookup_minimal_symbol_by_pc_section (sal->pc, sal->section); = lookup_minimal_symbol_by_pc_section (sal->pc, sal->section);
if (msymbol == NULL) if (msymbol == NULL)
{ {
do_cleanups (old_chain); do_cleanups (old_chain);
@ -2506,6 +2518,7 @@ operator_chars (char *p, char **end)
if (isalpha (*p) || *p == '_' || *p == '$') if (isalpha (*p) || *p == '_' || *p == '$')
{ {
char *q = p + 1; char *q = p + 1;
while (isalnum (*q) || *q == '_' || *q == '$') while (isalnum (*q) || *q == '_' || *q == '$')
q++; q++;
*end = q; *end = q;
@ -2718,6 +2731,7 @@ sources_info (char *ignore, int from_tty)
ALL_SYMTABS (objfile, s) ALL_SYMTABS (objfile, s)
{ {
const char *fullname = symtab_to_fullname (s); const char *fullname = symtab_to_fullname (s);
output_source_filename (fullname ? fullname : s->filename, &first); output_source_filename (fullname ? fullname : s->filename, &first);
} }
printf_filtered ("\n\n"); printf_filtered ("\n\n");
@ -2834,6 +2848,7 @@ static int
search_symbols_file_matches (const char *filename, void *user_data) search_symbols_file_matches (const char *filename, void *user_data)
{ {
struct search_symbols_data *data = user_data; struct search_symbols_data *data = user_data;
return file_matches (filename, data->files, data->nfiles); return file_matches (filename, data->files, data->nfiles);
} }
@ -2842,6 +2857,7 @@ static int
search_symbols_name_matches (const char *symname, void *user_data) search_symbols_name_matches (const char *symname, void *user_data)
{ {
struct search_symbols_data *data = user_data; struct search_symbols_data *data = user_data;
return data->regexp == NULL || re_exec (symname); return data->regexp == NULL || re_exec (symname);
} }
@ -2874,17 +2890,13 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
char *val; char *val;
int found_misc = 0; int found_misc = 0;
static enum minimal_symbol_type types[] 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[] 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[] 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[] 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 ourtype;
enum minimal_symbol_type ourtype2; enum minimal_symbol_type ourtype2;
enum minimal_symbol_type ourtype3; enum minimal_symbol_type ourtype3;
@ -2914,9 +2926,11 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
and <TYPENAME> or <OPERATOR>. */ and <TYPENAME> or <OPERATOR>. */
char *opend; char *opend;
char *opname = operator_chars (regexp, &opend); char *opname = operator_chars (regexp, &opend);
if (*opname) if (*opname)
{ {
int fix = -1; /* -1 means ok; otherwise number of spaces needed. */ int fix = -1; /* -1 means ok; otherwise number of spaces needed. */
if (isalpha (*opname) || *opname == '_' || *opname == '$') if (isalpha (*opname) || *opname == '_' || *opname == '$')
{ {
/* There should 1 space between 'operator' and 'TYPENAME'. */ /* There should 1 space between 'operator' and 'TYPENAME'. */
@ -2933,6 +2947,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
if (fix >= 0) if (fix >= 0)
{ {
char *tmp = (char *) alloca (8 + fix + strlen (opname) + 1); char *tmp = (char *) alloca (8 + fix + strlen (opname) + 1);
sprintf (tmp, "operator%.*s%s", fix, " ", opname); sprintf (tmp, "operator%.*s%s", fix, " ", opname);
regexp = tmp; regexp = tmp;
} }
@ -3013,10 +3028,12 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
{ {
struct symbol_search *prevtail = tail; struct symbol_search *prevtail = tail;
int nfound = 0; int nfound = 0;
b = BLOCKVECTOR_BLOCK (bv, i); b = BLOCKVECTOR_BLOCK (bv, i);
ALL_BLOCK_SYMBOLS (b, iter, sym) ALL_BLOCK_SYMBOLS (b, iter, sym)
{ {
struct symtab *real_symtab = SYMBOL_SYMTAB (sym); struct symtab *real_symtab = SYMBOL_SYMTAB (sym);
QUIT; QUIT;
if (file_matches (real_symtab->filename, files, nfiles) if (file_matches (real_symtab->filename, files, nfiles)
@ -3179,9 +3196,7 @@ print_msymbol_info (struct minimal_symbol *msymbol)
static void static void
symtab_symbol_info (char *regexp, domain_enum kind, int from_tty) symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
{ {
static char *classnames[] static char *classnames[] = {"variable", "function", "type", "method"};
=
{"variable", "function", "type", "method"};
struct symbol_search *symbols; struct symbol_search *symbols;
struct symbol_search *p; struct symbol_search *p;
struct cleanup *old_chain; struct cleanup *old_chain;
@ -3273,6 +3288,7 @@ rbreak_command (char *regexp, int from_tty)
if (regexp) if (regexp)
{ {
char *colon = strchr (regexp, ':'); char *colon = strchr (regexp, ':');
if (colon && *(colon + 1) != ':') if (colon && *(colon + 1) != ':')
{ {
int colon_index; int colon_index;
@ -3304,6 +3320,7 @@ rbreak_command (char *regexp, int from_tty)
int newlen = (strlen (p->symtab->filename) int newlen = (strlen (p->symtab->filename)
+ strlen (SYMBOL_LINKAGE_NAME (p->symbol)) + strlen (SYMBOL_LINKAGE_NAME (p->symbol))
+ 4); + 4);
if (newlen > len) if (newlen > len)
{ {
string = xrealloc (string, newlen); string = xrealloc (string, newlen);
@ -3322,8 +3339,8 @@ rbreak_command (char *regexp, int from_tty)
} }
else else
{ {
int newlen = (strlen (SYMBOL_LINKAGE_NAME (p->msymbol)) int newlen = (strlen (SYMBOL_LINKAGE_NAME (p->msymbol)) + 3);
+ 3);
if (newlen > len) if (newlen > len)
{ {
string = xrealloc (string, newlen); string = xrealloc (string, newlen);
@ -3375,6 +3392,7 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
{ {
char *new; char *new;
if (word == sym_text) if (word == sym_text)
{ {
new = xmalloc (strlen (symname) + 5); new = xmalloc (strlen (symname) + 5);
@ -3546,6 +3564,7 @@ add_macro_name (const char *name, const struct macro_definition *ignore,
void *user_data) void *user_data)
{ {
struct add_name_data *datum = (struct add_name_data *) user_data; struct add_name_data *datum = (struct add_name_data *) user_data;
completion_list_add_name ((char *) name, completion_list_add_name ((char *) name,
datum->sym_text, datum->sym_text_len, datum->sym_text, datum->sym_text_len,
datum->text, datum->word); datum->text, datum->word);
@ -3556,6 +3575,7 @@ static void
add_partial_symbol_name (const char *name, void *user_data) add_partial_symbol_name (const char *name, void *user_data)
{ {
struct add_name_data *datum = (struct add_name_data *) user_data; struct add_name_data *datum = (struct add_name_data *) user_data;
completion_list_add_name ((char *) name, completion_list_add_name ((char *) name,
datum->sym_text, datum->sym_text_len, datum->sym_text, datum->sym_text_len,
datum->text, datum->word); datum->text, datum->word);
@ -3970,6 +3990,7 @@ maybe_add_partial_symtab_filename (const char *fullname, const char *filename,
else else
{ {
const char *base_name = lbasename (filename); const char *base_name = lbasename (filename);
if (base_name != filename if (base_name != filename
&& !filename_seen (base_name, 1, data->first) && !filename_seen (base_name, 1, data->first)
#if HAVE_DOS_BASED_FILE_SYSTEM #if HAVE_DOS_BASED_FILE_SYSTEM
@ -4388,6 +4409,7 @@ append_exact_match_to_sals (char *filename, char *fullname, int lineno,
{ {
struct linetable *l; struct linetable *l;
int len; int len;
if (fullname != NULL if (fullname != NULL
&& symtab_to_fullname (symtab) != NULL && symtab_to_fullname (symtab) != NULL
&& FILENAME_CMP (fullname, symtab->fullname) != 0) && FILENAME_CMP (fullname, symtab->fullname) != 0)