aboutsummaryrefslogtreecommitdiff
path: root/gdb/valarith.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-09-20 20:18:39 +0000
committerJeff Johnston <jjohnstn@redhat.com>2004-09-20 20:18:39 +0000
commit987504bb93b4da9529d309ee545de78bc082fab2 (patch)
tree81f0db21727ca497ba8f42e2e608ffa13a5f03d2 /gdb/valarith.c
parent7213f6d65b75bda7dde6694db8efdf9ebeaeeedb (diff)
downloadgdb-987504bb93b4da9529d309ee545de78bc082fab2.zip
gdb-987504bb93b4da9529d309ee545de78bc082fab2.tar.gz
gdb-987504bb93b4da9529d309ee545de78bc082fab2.tar.bz2
2004-09-20 Jeff Johnston <jjohnstn@redhat.com>
* dwarf2read.c (typename_concat): Change prototype to accept obstack and dwarf2_cu struct pointer as arguments. Change function to use obstack if provided and use dwarf2_cu to determine language-specific separator. (partial_die_parent_scope): Change comment to include java. Use new version of typename_concat instead of obconcat. (partial_die_full_name): Use typename_concat. (read_namespace): Ditto. (read_enumeration_type): Use typename_concat instead of obconcat. (new_symbol): Ditto. (add_partial_symbol): Enhance tests for C++ to also test for Java. (guess_structure_name): Ditto. (read_subroutine_type): Ditto. (read_structure_type): Ditto. (is_vtable_name): Add Java support. (determine_class_name): Switch to new typename_concat call. (determine_prefix): Switch to new typename_concat call. * jv-exp.y (FuncStart): New pattern. (MethodInvocation): Add support for simple function calls. Change warning message for other forms of inferior call currently not supported. * valarith.c (value_subscript): Treat an array with upper-bound of -1 as unknown size.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r--gdb/valarith.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 7858f91..f88701f 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -202,7 +202,10 @@ value_subscript (struct value *array, struct value *idx)
LONGEST index = value_as_long (idx);
if (index >= lowerbound && index <= upperbound)
return value_subscripted_rvalue (array, idx, lowerbound);
- warning ("array or string index out of range");
+ /* Emit warning unless we have an array of unknown size.
+ An array of unknown size has lowerbound 0 and upperbound -1. */
+ if (upperbound > -1)
+ warning ("array or string index out of range");
/* fall doing C stuff */
c_style = 1;
}