aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-14 23:41:05 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-14 23:41:05 +0000
commite0881a8e0fbb8bd5d4d14683390269b97e4e90d7 (patch)
tree60fe317865c5f6a2e987df4e590cf170bee3360f /gdb/linespec.c
parentabbb1732a91accadee3e1c00b75fc0a3f418fae7 (diff)
downloadgdb-e0881a8e0fbb8bd5d4d14683390269b97e4e90d7.zip
gdb-e0881a8e0fbb8bd5d4d14683390269b97e4e90d7.tar.gz
gdb-e0881a8e0fbb8bd5d4d14683390269b97e4e90d7.tar.bz2
2010-05-14 Michael Snyder <msnyder@vmware.com>
* jv-lang.c: White space. * jv-typeprint.c: White space. * jv-valprint.c: White space. * language.c: White space. * libunwind-frame.c: White space. * linespec.c: White space. * linux-nat.c: White space. * linux-record.c: White space. * linux-thread-db.c: White space.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index d9721b4..378c6c9 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -150,11 +150,13 @@ cplusplus_error (const char *name, const char *fmt, ...)
{
struct ui_file *tmp_stream;
char *message;
+
tmp_stream = mem_fileopen ();
make_cleanup_ui_file_delete (tmp_stream);
{
va_list args;
+
va_start (args, fmt);
vfprintf_unfiltered (tmp_stream, fmt, args);
va_end (args);
@@ -767,6 +769,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
{
struct symtabs_and_lines values;
+
values = decode_objc (argptr, funfirstline, NULL,
canonical, saved_arg);
if (values.sals != NULL)
@@ -1034,6 +1037,7 @@ locate_first_half (char **argptr, int *is_quote_enclosed)
if (p[0] == '<')
{
char *temp_end = find_template_name_end (p);
+
if (!temp_end)
error (_("malformed template specification in command"));
p = temp_end;
@@ -1074,6 +1078,7 @@ locate_first_half (char **argptr, int *is_quote_enclosed)
if (*is_quote_enclosed)
{
char *closing_quote = strchr (p - 1, '"');
+
if (closing_quote && closing_quote[1] == '\0')
*closing_quote = '\0';
}
@@ -1339,6 +1344,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
{
/* At this point argptr->"fun". */
char *a;
+
p = *argptr;
while (*p && *p != ' ' && *p != '\t' && *p != ',' && *p != ':'
&& *p != '(')
@@ -1372,6 +1378,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
if (*p && current_language->la_language == language_java)
{
struct type *type;
+
p2 = p;
while (*p2)
++p2;
@@ -1508,9 +1515,11 @@ lookup_prefix_sym (char **argptr, char *p)
using VAR_DOMAIN (where typedefs live) and double-check that we
found a struct/class type. */
struct symbol *s = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
+
if (s != NULL)
{
struct type *t = SYMBOL_TYPE (s);
+
CHECK_TYPEDEF (t);
if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
return s;
@@ -1566,10 +1575,12 @@ find_method (int funfirstline, char ***canonical, char *saved_arg,
if (strchr (saved_arg, '(') != NULL)
{
int i;
+
for (i = 0; i < i1; ++i)
{
char *name = saved_arg;
char *canon = cp_canonicalize_string (name);
+
if (canon != NULL)
name = canon;
@@ -1776,6 +1787,7 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
{
/* We have a value history reference. */
struct value *val_history;
+
sscanf ((copy[1] == '$') ? copy + 2 : copy + 1, "%d", &index);
val_history = access_value_history ((copy[1] == '$') ? -index : index);
if (TYPE_CODE (value_type (val_history)) != TYPE_CODE_INT)
@@ -1836,7 +1848,6 @@ decode_variable (char *copy, int funfirstline, char ***canonical,
struct symtab *file_symtab, int *not_found_ptr)
{
struct symbol *sym;
-
struct minimal_symbol *msymbol;
sym = lookup_symbol (copy,
@@ -1898,6 +1909,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy,
{
struct blockvector *bv = BLOCKVECTOR (SYMBOL_SYMTAB (sym));
struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+
if (lookup_block_symbol (b, copy, VAR_DOMAIN) != NULL)
build_canonical_line_spec (values.sals, copy, canonical);
}