diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 31 | ||||
-rw-r--r-- | gdb/scm-exp.c | 6 | ||||
-rw-r--r-- | gdb/scm-lang.c | 4 | ||||
-rw-r--r-- | gdb/scm-valprint.c | 6 | ||||
-rw-r--r-- | gdb/sentinel-frame.c | 2 | ||||
-rw-r--r-- | gdb/ser-base.c | 2 | ||||
-rw-r--r-- | gdb/ser-go32.c | 1 | ||||
-rw-r--r-- | gdb/ser-mingw.c | 2 | ||||
-rw-r--r-- | gdb/ser-pipe.c | 3 | ||||
-rw-r--r-- | gdb/ser-tcp.c | 3 | ||||
-rw-r--r-- | gdb/ser-unix.c | 2 | ||||
-rw-r--r-- | gdb/serial.c | 1 | ||||
-rw-r--r-- | gdb/solib-darwin.c | 2 | ||||
-rw-r--r-- | gdb/solib-frv.c | 1 | ||||
-rw-r--r-- | gdb/solib-irix.c | 2 | ||||
-rw-r--r-- | gdb/solib-osf.c | 1 | ||||
-rw-r--r-- | gdb/solib-pa64.c | 3 | ||||
-rw-r--r-- | gdb/solib-som.c | 2 | ||||
-rw-r--r-- | gdb/solib-spu.c | 4 | ||||
-rw-r--r-- | gdb/solib-svr4.c | 5 | ||||
-rw-r--r-- | gdb/solib-target.c | 4 | ||||
-rw-r--r-- | gdb/solib.c | 6 | ||||
-rw-r--r-- | gdb/source.c | 4 | ||||
-rw-r--r-- | gdb/stabsread.c | 44 | ||||
-rw-r--r-- | gdb/stack.c | 14 | ||||
-rw-r--r-- | gdb/std-regs.c | 6 | ||||
-rw-r--r-- | gdb/symfile.c | 3 | ||||
-rw-r--r-- | gdb/symmisc.c | 3 | ||||
-rw-r--r-- | gdb/symtab.c | 72 |
29 files changed, 203 insertions, 36 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c5415d9..d508fe5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,36 @@ 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 for the "reverse-search" command. diff --git a/gdb/scm-exp.c b/gdb/scm-exp.c index 1d5b09e..69eb249 100644 --- a/gdb/scm-exp.c +++ b/gdb/scm-exp.c @@ -112,6 +112,7 @@ scm_istring2number (char *str, int len, int radix) #if 0 SCM res; #endif + if (len == 1) if (*str == '+' || *str == '-') /* Catches lone `+' and `-' for speed */ return SCM_BOOL_F; @@ -238,6 +239,7 @@ static int scm_skip_ws (void) { int c; + while (1) switch ((c = *lexptr++)) { @@ -272,6 +274,7 @@ scm_lreadparen (int skipping) for (;;) { int c = scm_skip_ws (); + if (')' == c || ']' == c) return; --lexptr; @@ -287,6 +290,7 @@ scm_lreadr (int skipping) int c, j; struct stoken str; LONGEST svalue = 0; + tryagain: c = *lexptr++; switch (c) @@ -309,6 +313,7 @@ tryagain: 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), @@ -481,6 +486,7 @@ int scm_parse (void) { char *start; + while (*lexptr == ' ') lexptr++; start = lexptr; diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 23e5f22..870b1e4 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -70,6 +70,7 @@ scm_get_field (LONGEST svalue, int index, int size, 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); } @@ -135,6 +136,7 @@ in_eval_c (void) { char *filename = cursal.symtab->filename; int len = strlen (filename); + if (len >= 6 && strcmp (filename + len - 6, "eval.c") == 0) return 1; } @@ -188,6 +190,7 @@ scm_evaluate_string (char *str, int len) 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); @@ -202,6 +205,7 @@ evaluate_exp (struct type *expect_type, struct expression *exp, enum exp_opcode op = exp->elts[*pos].opcode; int len, pc; char *str; + switch (op) { case OP_NAME: diff --git a/gdb/scm-valprint.c b/gdb/scm-valprint.c index 95185d4..8000c78 100644 --- a/gdb/scm-valprint.c +++ b/gdb/scm-valprint.c @@ -135,6 +135,7 @@ scm_scmlist_print (struct type *type, LONGEST svalue, #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); @@ -240,6 +241,7 @@ taloop: #if 0 SCM name; #endif + fputs_filtered ("#<latte ", stream); #if 1 fputs_filtered ("???", stream); @@ -313,6 +315,7 @@ taloop: int i; LONGEST elements = SCM_CDR (svalue); LONGEST val; + fputs_filtered ("#(", stream); for (i = 0; i < len; ++i) { @@ -329,6 +332,7 @@ taloop: { SCM result; SCM hook; + hook = scm_get_lvector_hook (exp, LV_PRINT_FN); if (hook == BOOL_F) { @@ -370,6 +374,7 @@ taloop: #define SCM_CHARS(x) ((char *)(SCM_CDR(x))) char *str = CHARS (SNAME (exp)); #endif + fprintf_filtered (stream, "#<primitive-procedure %s>", str); } @@ -447,6 +452,7 @@ scm_value_print (struct value *val, struct ui_file *stream, 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)); } diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c index d5d8233..8c11d7b 100644 --- a/gdb/sentinel-frame.c +++ b/gdb/sentinel-frame.c @@ -36,6 +36,7 @@ sentinel_frame_cache (struct regcache *regcache) { struct frame_unwind_cache *cache = FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache); + cache->regcache = regcache; return cache; } @@ -81,6 +82,7 @@ sentinel_frame_prev_arch (struct frame_info *this_frame, void **this_prologue_cache) { struct frame_unwind_cache *cache = *this_prologue_cache; + return get_regcache_arch (cache->regcache); } diff --git a/gdb/ser-base.c b/gdb/ser-base.c index 6d45441..c17a389 100644 --- a/gdb/ser-base.c +++ b/gdb/ser-base.c @@ -69,6 +69,7 @@ reschedule (struct serial *scb) if (serial_is_async_p (scb)) { int next_state; + switch (scb->async_state) { case FD_SCHEDULED: @@ -170,6 +171,7 @@ static void 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 */ diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index 12288f9..2f3b99c 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -677,6 +677,7 @@ static int dos_flush_input (struct serial *scb) { struct dos_ttystate *port = &ports[scb->fd]; + disable (); port->first = port->count = 0; if (port->fifo) diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c index af68c2b..877657b 100644 --- a/gdb/ser-mingw.c +++ b/gdb/ser-mingw.c @@ -751,6 +751,7 @@ ser_console_get_tty_state (struct serial *scb) if (isatty (scb->fd)) { struct ser_console_ttystate *state; + state = (struct ser_console_ttystate *) xmalloc (sizeof *state); state->is_a_tty = 1; return state; @@ -985,6 +986,7 @@ pipe_avail (struct serial *scb, int fd) HANDLE h = (HANDLE) _get_osfhandle (fd); DWORD numBytes; BOOL r = PeekNamedPipe (h, NULL, 0, NULL, &numBytes, NULL); + if (r == FALSE) numBytes = 0; return numBytes; diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c index 274883c..92ad3d9 100644 --- a/gdb/ser-pipe.c +++ b/gdb/ser-pipe.c @@ -63,6 +63,7 @@ pipe_open (struct serial *scb, const char *name) 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) @@ -146,6 +147,7 @@ static void pipe_close (struct serial *scb) { struct pipe_state *state = scb->state; + if (state != NULL) { int pid = state->pid; @@ -167,6 +169,7 @@ void _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; diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index df12b87..dd685e6 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -119,6 +119,7 @@ wait_for_connect (struct serial *scb, int *polls) if (scb) { fd_set rset, wset, eset; + FD_ZERO (&rset); FD_SET (scb->fd, &rset); wset = rset; @@ -272,6 +273,7 @@ net_open (struct serial *scb, const char *name) { 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 *" @@ -372,6 +374,7 @@ _initialize_ser_tcp (void) ser-mingw.c. */ #else struct serial_ops *ops; + ops = XMALLOC (struct serial_ops); memset (ops, 0, sizeof (struct serial_ops)); ops->name = "tcp"; diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index 1b2efd8..266453c 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -306,6 +306,7 @@ hardwire_drain_output (struct serial *scb) to be discarded. */ { struct hardwire_ttystate state; + if (get_tty_state (scb, &state)) { return (-1); @@ -888,6 +889,7 @@ void _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; diff --git a/gdb/serial.c b/gdb/serial.c index ea437a1..75a0878 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -528,6 +528,7 @@ serial_async (struct serial *scb, 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. */ diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 4cf657b..2eb188a 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -158,6 +158,7 @@ lookup_symbol_from_bfd (bfd *abfd, char *symname) 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) { @@ -320,6 +321,7 @@ darwin_solib_create_inferior_hook (int from_tty) if (dyld_bfd) { bfd *sub; + sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object, gdbarch_bfd_arch_info (target_gdbarch)); if (sub) diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index bf4ac51..300fe9c 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -1047,6 +1047,7 @@ frv_relocate_section_addresses (struct so_list *so, && 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; diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c index b75a0a8..303d3bf 100644 --- a/gdb/solib-irix.c +++ b/gdb/solib-irix.c @@ -163,6 +163,7 @@ fetch_lm_info (CORE_ADDR addr) 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); @@ -326,7 +327,6 @@ disable_break (void) { 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. */ diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c index a8354a1..3f5663b 100644 --- a/gdb/solib-osf.c +++ b/gdb/solib-osf.c @@ -192,6 +192,7 @@ static int lm_sec_cmp (const void *p1, const void *p2) { const struct lm_sec *lms1 = p1, *lms2 = p2; + return strcmp (lms1->name, lms2->name); } diff --git a/gdb/solib-pa64.c b/gdb/solib-pa64.c index 22478a3..bf736a2 100644 --- a/gdb/solib-pa64.c +++ b/gdb/solib-pa64.c @@ -491,6 +491,7 @@ pa64_current_sos (void) #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)); @@ -662,8 +663,8 @@ _initialize_pa64_solib (void) 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; diff --git a/gdb/solib-som.c b/gdb/solib-som.c index 1ac83e1..09db004 100644 --- a/gdb/solib-som.c +++ b/gdb/solib-som.c @@ -816,8 +816,8 @@ void 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; diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c index 6d035cb..177617d 100644 --- a/gdb/solib-spu.c +++ b/gdb/solib-spu.c @@ -124,6 +124,7 @@ spu_current_sos (void) 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; @@ -307,9 +308,11 @@ spu_bfd_open (char *pathname) 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'; @@ -352,6 +355,7 @@ spu_enable_break (struct objfile *objfile) 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); diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 8dfffad..d031303 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -723,6 +723,7 @@ scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr) 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, @@ -731,6 +732,7 @@ scan_dyntag_auxv (int dyntag, CORE_ADDR *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, @@ -793,6 +795,7 @@ elf_locate_base (void) 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. */ @@ -1519,6 +1522,7 @@ enable_break (struct svr4_info *info, int from_tty) { 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)); } @@ -2065,6 +2069,7 @@ static int 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); } diff --git a/gdb/solib-target.c b/gdb/solib-target.c index a9c34c8..6873e39 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -135,6 +135,7 @@ library_list_end_library (struct gdb_xml_parser *parser, { 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, @@ -364,6 +365,7 @@ Could not relocate shared library \"%s\": wrong number of ALLOC sections"), int bases_index = 0; int found_range = 0; CORE_ADDR *section_bases; + section_bases = VEC_address (CORE_ADDR, 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) { CORE_ADDR low, high; + low = section_bases[i]; 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) { struct symfile_segment_data *data; + data = get_symfile_segment_data (so->abfd); if (data == NULL) warning (_("\ diff --git a/gdb/solib.c b/gdb/solib.c index 5340516..837814b 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -68,6 +68,7 @@ static struct target_so_ops * solib_ops (struct gdbarch *gdbarch) { struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data); + return *ops; } @@ -77,6 +78,7 @@ void 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; } @@ -169,6 +171,7 @@ solib_find (char *in_pathname, int *fd) if (solib_symbols_extension) { char *p = in_pathname + strlen (in_pathname); + while (p > in_pathname && *p != '.') p--; @@ -1200,6 +1203,7 @@ clear_solib (void) while (so_list_head) { struct so_list *so = so_list_head; + so_list_head = so->next; observer_notify_solib_unloaded (so); if (so->abfd) @@ -1229,6 +1233,7 @@ void solib_create_inferior_hook (int from_tty) { struct target_so_ops *ops = solib_ops (target_gdbarch); + ops->solib_create_inferior_hook (from_tty); } @@ -1252,6 +1257,7 @@ int in_solib_dynsym_resolve_code (CORE_ADDR pc) { struct target_so_ops *ops = solib_ops (target_gdbarch); + return ops->in_dynsym_resolve_code (pc); } diff --git a/gdb/source.c b/gdb/source.c index cad0160..39bd06a 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -267,6 +267,7 @@ select_source_symtab (struct symtab *s) { const char *name = s->filename; int len = strlen (name); + if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 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) { int save_errno = errno; + fprintf_unfiltered (gdb_stderr, "Warning: "); print_sys_errmsg (name, save_errno); } @@ -813,6 +815,7 @@ done: IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) ? "" : SLASH_STRING, filename, (char *)NULL); + *filename_opened = xfullpath (f); xfree (f); } @@ -1910,6 +1913,7 @@ void _initialize_source (void) { struct cmd_list_element *c; + current_source_symtab = 0; init_source_path (); diff --git a/gdb/stabsread.c b/gdb/stabsread.c index e1d4f38..b62156c 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -352,7 +352,6 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, if (stabs) { - /* for all the stab entries, find their corresponding symbols and patch their types! */ @@ -435,6 +434,7 @@ static int read_type_number (char **pp, int *typenums) { int nbits; + if (**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_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; @@ -706,6 +708,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, 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); @@ -1121,6 +1124,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, && 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) @@ -1154,11 +1158,13 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, != 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); } @@ -1205,6 +1211,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, && 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) = @@ -1315,7 +1322,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, { /* 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; @@ -1339,11 +1347,14 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, != 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); } @@ -1580,6 +1591,7 @@ again: if (q1 && p > q1 && p[1] == ':') { int nesting_level = 0; + for (q2 = q1; *q2; q2++) { if (*q2 == '<') @@ -1597,6 +1609,7 @@ again: 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); @@ -1684,6 +1697,7 @@ again: 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". */ @@ -1856,6 +1870,7 @@ again: /* type attribute */ { char *attr = *pp; + /* Skip to the semicolon. */ while (**pp != ';' && **pp != '\0') ++(*pp); @@ -2667,6 +2682,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type, { char dem_opname[256]; int ret; + ret = cplus_demangle_opname (new_fnlist->fn_fieldlist.name, dem_opname, DMGL_ANSI); 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 */ 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; @@ -2789,6 +2805,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type, { int nbits; + FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ';', &nbits, 0); if (nbits != 0) @@ -2865,6 +2882,7 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p, { int nbits; + FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ',', &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); { int nbits; + TYPE_N_BASECLASSES (type) = read_huge_number (pp, ',', &nbits, 0); if (nbits != 0) return 0; @@ -3228,6 +3247,7 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type, --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])) { @@ -3483,6 +3503,7 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code, { int nbits; + TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0); if (nbits != 0) 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 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); @@ -3860,6 +3883,7 @@ read_huge_number (char **pp, int end, int *bits, int twos_complement_bits) size_t len; char *p1 = p; + while ((c = *p1) >= '0' && c < '8') p1++; @@ -3893,6 +3917,7 @@ read_huge_number (char **pp, int end, int *bits, int twos_complement_bits) if (n == 0) { long sn = c - '0' - ((2 * (c - '0')) | (2 << sign_bit)); + n = -sn; } else @@ -4095,6 +4120,7 @@ read_range_type (char **pp, int typenums[2], int type_size, { struct type *complex_type = init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile); + TYPE_TARGET_TYPE (complex_type) = float_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) { int bits = type_size; + if (bits <= 0) { /* 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) { 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; } @@ -4748,6 +4777,7 @@ static char * find_name_end (char *name) { char *s = name; + if (s[0] == '-' || *s == '+') { /* Must be an ObjC method symbol. */ diff --git a/gdb/stack.c b/gdb/stack.c index e05fe53..7941a67 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -287,6 +287,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, if (*SYMBOL_LINKAGE_NAME (sym)) { struct symbol *nsym; + nsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), b, VAR_DOMAIN, NULL); gdb_assert (nsym != NULL); @@ -624,6 +625,7 @@ print_frame_info (struct frame_info *frame, int print_level, 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 @@ -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 display parameters. So remove the parameters. */ char *func_only = cp_remove_params (*funname); + if (func_only) { *funname = func_only; @@ -792,6 +795,7 @@ print_frame (struct frame_info *frame, int print_level, { 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; @@ -814,6 +818,7 @@ print_frame (struct frame_info *frame, int print_level, 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); } @@ -919,6 +924,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message, { 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 */ @@ -928,6 +934,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message, /* Convert each value into a corresponding address. */ { int i; + for (i = 0; i < numargs; 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 display parameters. So remove the parameters. */ char *func_only = cp_remove_params (funname); + if (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)); gdb_byte value[MAX_REGISTER_SIZE]; CORE_ADDR sp; + frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch), &optimized, &lval, &addr, &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)) { CORE_ADDR pc; + QUIT; pc = get_frame_address_in_block (fi); 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 value_print_options opts; + sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0); values_printed = 1; 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) { struct frame_info *prev = get_prev_frame (frame); + if (!prev) break; (*level_offset_ptr)--; @@ -1825,6 +1837,7 @@ find_relative_frame (struct frame_info *frame, int *level_offset_ptr) while (*level_offset_ptr < 0) { struct frame_info *next = get_next_frame (frame); + if (!next) break; (*level_offset_ptr)++; @@ -2012,6 +2025,7 @@ If you continue, the return value that you specified will be ignored.\n"; if (from_tty) { int confirmed; + if (thisfun == NULL) confirmed = query (_("%sMake selected stack frame return now? "), query_prefix); diff --git a/gdb/std-regs.c b/gdb/std-regs.c index ac30bbd..8f0d444 100644 --- a/gdb/std-regs.c +++ b/gdb/std-regs.c @@ -32,6 +32,7 @@ static struct value * 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 @@ -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 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 @@ -59,6 +61,7 @@ static struct value * 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 @@ -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 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 @@ -79,6 +83,7 @@ static struct value * 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")); @@ -88,6 +93,7 @@ static struct value * 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")); diff --git a/gdb/symfile.c b/gdb/symfile.c index 883c669..1d7d53d 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -205,6 +205,7 @@ obsavestring (const char *ptr, int size, struct obstack *obstackp) const char *p1 = ptr; char *p2 = p; const char *end = ptr + size; + while (p1 != end) *p2++ = *p1++; } @@ -1010,7 +1011,6 @@ syms_from_objfile (struct objfile *objfile, 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. */ @@ -1608,6 +1608,7 @@ symfile_bfd_open (char *name) 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); diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 6d47de3..62e6b97 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -391,6 +391,7 @@ dump_symtab_1 (struct objfile *objfile, struct symtab *symtab, ALL_BLOCK_SYMBOLS (b, iter, sym) { struct print_symbol_args s; + s.gdbarch = gdbarch; s.symbol = sym; s.depth = depth + 1; @@ -551,6 +552,7 @@ print_symbol (void *args) { 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++) @@ -782,6 +784,7 @@ static int block_depth (struct block *block) { int i = 0; + while ((block = BLOCK_SUPERBLOCK (block)) != NULL) { i++; diff --git a/gdb/symtab.c b/gdb/symtab.c index 8b30ff1..632893d 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -191,6 +191,7 @@ got_symtab: if (full_path != NULL) { const char *fp = symtab_to_fullname (s); + if (fp != NULL && FILENAME_CMP (full_path, fp) == 0) { return s; @@ -200,9 +201,11 @@ got_symtab: 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) { @@ -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)) + 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 @@ -374,6 +376,7 @@ static hashval_t hash_demangled_name_entry (const void *data) { const struct demangled_name_entry *e = data; + 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 *db = b; + return strcmp (da->mangled, db->mangled) == 0; } @@ -541,8 +545,8 @@ symbol_set_names (struct general_symbol_info *gsymbol, 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); @@ -554,8 +558,8 @@ symbol_set_names (struct general_symbol_info *gsymbol, 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'; @@ -796,6 +800,7 @@ find_pc_sect_symtab_via_partial (CORE_ADDR pc, struct obj_section *section) ALL_OBJFILES (objfile) { struct symtab *result = NULL; + if (objfile->sf) result = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol, pc, section, 0); @@ -865,6 +870,7 @@ fixup_section (struct general_symbol_info *ginfo, a search of the section table. */ struct obj_section *s; + ALL_OBJFILE_OSECTIONS (objfile, s) { 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; - /* 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); @@ -1067,6 +1073,7 @@ lookup_symbol_aux (const char *name, const struct block *block, { 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); @@ -1715,6 +1722,7 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section) if ((objfile->flags & OBJF_REORDERED) && objfile->sf) { struct symtab *result; + result = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol, @@ -1748,6 +1756,7 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section) ALL_OBJFILES (objfile) { struct symtab *result; + if (!objfile->sf) continue; 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. */ 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. */ @@ -2256,6 +2266,7 @@ int 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; @@ -2371,6 +2382,7 @@ skip_prologue_sal (struct symtab_and_line *sal) { struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc_section (sal->pc, sal->section); + if (msymbol == NULL) { do_cleanups (old_chain); @@ -2506,6 +2518,7 @@ operator_chars (char *p, char **end) if (isalpha (*p) || *p == '_' || *p == '$') { char *q = p + 1; + while (isalnum (*q) || *q == '_' || *q == '$') q++; *end = q; @@ -2718,6 +2731,7 @@ sources_info (char *ignore, int from_tty) ALL_SYMTABS (objfile, s) { const char *fullname = symtab_to_fullname (s); + output_source_filename (fullname ? fullname : s->filename, &first); } printf_filtered ("\n\n"); @@ -2834,6 +2848,7 @@ static int 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); } @@ -2842,6 +2857,7 @@ static int search_symbols_name_matches (const char *symname, void *user_data) { struct search_symbols_data *data = user_data; + return data->regexp == NULL || re_exec (symname); } @@ -2874,17 +2890,13 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], 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; @@ -2914,9 +2926,11 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], 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'. */ @@ -2933,6 +2947,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], if (fix >= 0) { char *tmp = (char *) alloca (8 + fix + strlen (opname) + 1); + sprintf (tmp, "operator%.*s%s", fix, " ", opname); regexp = tmp; } @@ -3013,10 +3028,12 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], { 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) @@ -3179,9 +3196,7 @@ print_msymbol_info (struct minimal_symbol *msymbol) 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; @@ -3273,6 +3288,7 @@ rbreak_command (char *regexp, int from_tty) if (regexp) { char *colon = strchr (regexp, ':'); + if (colon && *(colon + 1) != ':') { int colon_index; @@ -3304,6 +3320,7 @@ rbreak_command (char *regexp, int from_tty) int newlen = (strlen (p->symtab->filename) + strlen (SYMBOL_LINKAGE_NAME (p->symbol)) + 4); + if (newlen > len) { string = xrealloc (string, newlen); @@ -3322,8 +3339,8 @@ rbreak_command (char *regexp, int from_tty) } 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); @@ -3375,6 +3392,7 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len, { char *new; + if (word == sym_text) { new = xmalloc (strlen (symname) + 5); @@ -3546,6 +3564,7 @@ add_macro_name (const char *name, const struct macro_definition *ignore, 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); @@ -3556,6 +3575,7 @@ static void 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); @@ -3970,6 +3990,7 @@ maybe_add_partial_symtab_filename (const char *fullname, const char *filename, else { const char *base_name = lbasename (filename); + if (base_name != filename && !filename_seen (base_name, 1, data->first) #if HAVE_DOS_BASED_FILE_SYSTEM @@ -4388,6 +4409,7 @@ append_exact_match_to_sals (char *filename, char *fullname, int lineno, { struct linetable *l; int len; + if (fullname != NULL && symtab_to_fullname (symtab) != NULL && FILENAME_CMP (fullname, symtab->fullname) != 0) |