+Wed Mar 10 17:37:11 1993 Fred Fish (fnf@cygnus.com)
+
+ * main.c (source_command): Require an explicit pathname of file
+ to source, since previous behavior of defaulting to gdb init file
+ was troublesome and undocumented.
+ * printcmd.c (disassemble_command): Add missing '{}' pair to
+ else with two statements. Bug reported by Stephane Tsacas
+ <slt@isoft.fr>.
+ * symtab.c (find_pc_line): Don't complain about zero length or
+ negative length line numbers for the moment, since we may not own
+ the terminal when called, such as when single stepping. (FIXME)
+ * language.h (CAST_IS_CONVERSION): True if current language is
+ C++ as well as C. Fix from Peter Schauer.
+ * environ.c (get_in_environ, set_in_environ, unset_in_environ):
+ Use STREQN macro rather than bare '!strncmp()'.
+ * environ.c (unset_in_environ): Avoid use of memcpy on
+ overlapping memory regions, as suggested by Paul Eggert
+ <eggert@twinsun.com>.
+ * c-exp.y (%union struct): Remove unused ulval as suggested
+ by Paul Eggert <eggert@twinsun.com>.
+
+Mon Mar 8 19:03:06 1993 Fred Fish (fnf@cygnus.com)
+
+ * main.c (gdbinit): Make static.
+ * main.c (inhibit_gdbinit): Move to file scope.
+ * main.c (main): Remove local inhibit_gdbinit.
+ * main.c (source_command): Don't source '.gdbinit' file by
+ default if gdb has been told to ignore it.
+
Sun Mar 7 21:58:53 1993 Ian Lance Taylor (ian@cygnus.com)
* Makefile.in (MAKEOVERRIDES): Define to be empty for GNU Make
static value last_examine_value;
+/* Largest offset between a symbolic value and an address, that will be
+ printed as `0x1234 <symbol+offset>'. */
+
+static unsigned int max_symbolic_offset = UINT_MAX;
+
/* Number of auto-display expression currently being displayed.
- So that we can deleted it if we get an error or a signal within it.
+ So that we can disable it if we get an error or a signal within it.
-1 when not doing one. */
int current_display_number;
printf_command PARAMS ((char *, int));
static void
-print_frame_nameless_args PARAMS ((CORE_ADDR, long, int, int, FILE *));
+print_frame_nameless_args PARAMS ((struct frame_info *, long, int, int,
+ FILE *));
static void
display_info PARAMS ((char *, int));
int do_demangle;
char *leadin;
{
- int name_location;
+ CORE_ADDR name_location;
register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (addr);
/* If nothing comes out, don't print anything symbolic. */
if (msymbol == NULL)
return;
+ /* If the nearest symbol is too far away, ditto. */
+
+ name_location = SYMBOL_VALUE_ADDRESS (msymbol);
+
+ /* For when CORE_ADDR is larger than unsigned int, we do math in
+ CORE_ADDR. But when we detect unsigned wraparound in the
+ CORE_ADDR math, we ignore this test and print the offset,
+ because addr+max_symbolic_offset has wrapped through the end
+ of the address space back to the beginning, giving bogus comparison. */
+ if (addr > name_location + max_symbolic_offset
+ && name_location + max_symbolic_offset > name_location)
+ return;
+
fputs_filtered (leadin, stream);
fputs_filtered ("<", stream);
if (do_demangle)
fputs_filtered (SYMBOL_SOURCE_NAME (msymbol), stream);
else
fputs_filtered (SYMBOL_LINKAGE_NAME (msymbol), stream);
- name_location = SYMBOL_VALUE_ADDRESS (msymbol);
- if (addr - name_location)
- fprintf_filtered (stream, "+%d>", addr - name_location);
+ if (addr != name_location)
+ fprintf_filtered (stream, "+%d>", (int)(addr - name_location));
else
fputs_filtered (">", stream);
}
printf_filtered ("for function %s:\n", name);
}
else
- printf_filtered ("from %s ", local_hex_string(low));
- printf_filtered ("to %s:\n", local_hex_string(high));
+ {
+ printf_filtered ("from %s ", local_hex_string(low));
+ printf_filtered ("to %s:\n", local_hex_string(high));
+ }
/* Dump the specified range. */
for (pc = low; pc < high; )
add_com ("inspect", class_vars, inspect_command,
"Same as \"print\" command, except that if you are running in the epoch\n\
environment, the value is printed in its own window.");
+
+ add_show_from_set (
+ add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,
+ (char *)&max_symbolic_offset,
+ "Set the largest offset that will be printed in <symbol+1234> form.",
+ &setprintlist),
+ &showprintlist);
}
range, we must search all symtabs associated with this compilation unit, and
find the one whose first PC is closer than that of the next line in this
symtab.
+
+ FIXME: We used to complain here about zero length or negative length line
+ tables, but there are two problems with this: (1) some symtabs may not have
+ any line numbers due to gcc -g1 compilation, and (2) this function is called
+ during single stepping, when we don't own the terminal and thus can't
+ produce any output. One solution might be to implement a mechanism whereby
+ complaints can be queued until we regain control of the terminal. -fnf
*/
struct symtab_and_line
if (!l)
continue;
len = l->nitems;
- if (len <= 0)
+ if (len <= 0) /* See FIXME above. */
{
- fprintf (stderr, "Inconsistent line number info for %s\n",
- s->filename);
continue;
}
#define COMPLETION_LIST_ADD_SYMBOL(symbol, text, len) \
do { \
completion_list_add_name (SYMBOL_NAME (symbol), text, len); \
- if (SYMBOL_LANGUAGE (symbol) == language_cplus && \
- SYMBOL_DEMANGLED_NAME (symbol) != NULL) \
+ if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) \
completion_list_add_name (SYMBOL_DEMANGLED_NAME (symbol), text, len); \
} while (0)