1 /* Parser for linespec for the GNU debugger, GDB.
2 Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
3 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
32 #include "completer.h"
34 #include "parser-defs.h"
36 #include "objc-lang.h"
39 /* We share this one with symtab.c, but it is not exported widely. */
41 extern char *operator_chars (char *, char **);
43 /* Prototypes for local functions */
45 static void initialize_defaults (struct symtab
**default_symtab
,
48 static void set_flags (char *arg
, int *is_quoted
, char **paren_pointer
);
50 static struct symtabs_and_lines
decode_indirect (char **argptr
);
52 static char *locate_first_half (char **argptr
, int *is_quote_enclosed
);
54 static struct symtabs_and_lines
decode_objc (char **argptr
,
56 struct symtab
*file_symtab
,
60 static struct symtabs_and_lines
decode_compound (char **argptr
,
66 static struct symbol
*lookup_prefix_sym (char **argptr
, char *p
);
68 static struct symtabs_and_lines
find_method (int funfirstline
,
73 struct symbol
*sym_class
);
75 static int collect_methods (char *copy
, struct type
*t
,
76 struct symbol
**sym_arr
);
78 static NORETURN
void cplusplus_error (const char *name
,
80 ATTR_NORETURN
ATTR_FORMAT (printf
, 2, 3);
82 static int total_number_of_methods (struct type
*type
);
84 static int find_methods (struct type
*, char *, struct symbol
**);
86 static int add_matching_methods (int method_counter
, struct type
*t
,
87 struct symbol
**sym_arr
);
89 static int add_constructors (int method_counter
, struct type
*t
,
90 struct symbol
**sym_arr
);
92 static void build_canonical_line_spec (struct symtab_and_line
*,
95 static char *find_toplevel_char (char *s
, char c
);
97 static struct symtabs_and_lines
decode_line_2 (struct symbol
*[],
100 static struct symtab
*symtab_from_filename (char **argptr
,
101 char *p
, int is_quote_enclosed
);
104 symtabs_and_lines
decode_all_digits (char **argptr
,
105 struct symtab
*default_symtab
,
108 struct symtab
*file_symtab
,
111 static struct symtabs_and_lines
decode_dollar (char *copy
,
113 struct symtab
*default_symtab
,
115 struct symtab
*file_symtab
);
117 static struct symtabs_and_lines
decode_variable (char *copy
,
120 struct symtab
*file_symtab
);
123 symtabs_and_lines
symbol_found (int funfirstline
,
127 struct symtab
*file_symtab
,
128 struct symtab
*sym_symtab
);
131 symtabs_and_lines
minsym_found (int funfirstline
,
132 struct minimal_symbol
*msymbol
);
134 /* Helper functions. */
136 /* Issue a helpful hint on using the command completion feature on
137 single quoted demangled C++ symbols as part of the completion
141 cplusplus_error (const char *name
, const char *fmt
, ...)
143 struct ui_file
*tmp_stream
;
144 tmp_stream
= mem_fileopen ();
145 make_cleanup_ui_file_delete (tmp_stream
);
149 va_start (args
, fmt
);
150 vfprintf_unfiltered (tmp_stream
, fmt
, args
);
154 while (*name
== '\'')
156 fprintf_unfiltered (tmp_stream
,
157 ("Hint: try '%s<TAB> or '%s<ESC-?>\n"
158 "(Note leading single quote.)"),
160 error_stream (tmp_stream
);
163 /* Return the number of methods described for TYPE, including the
164 methods from types it derives from. This can't be done in the symbol
165 reader because the type of the baseclass might still be stubbed
166 when the definition of the derived class is parsed. */
169 total_number_of_methods (struct type
*type
)
174 CHECK_TYPEDEF (type
);
175 if (TYPE_CPLUS_SPECIFIC (type
) == NULL
)
177 count
= TYPE_NFN_FIELDS_TOTAL (type
);
179 for (n
= 0; n
< TYPE_N_BASECLASSES (type
); n
++)
180 count
+= total_number_of_methods (TYPE_BASECLASS (type
, n
));
185 /* Recursive helper function for decode_line_1.
186 Look for methods named NAME in type T.
187 Return number of matches.
188 Put matches in SYM_ARR, which should have been allocated with
189 a size of total_number_of_methods (T) * sizeof (struct symbol *).
190 Note that this function is g++ specific. */
193 find_methods (struct type
*t
, char *name
, struct symbol
**sym_arr
)
197 char *class_name
= type_name_no_tag (t
);
199 /* Ignore this class if it doesn't have a name. This is ugly, but
200 unless we figure out how to get the physname without the name of
201 the class, then the loop can't do any good. */
203 && (lookup_symbol (class_name
, (struct block
*) NULL
,
204 STRUCT_DOMAIN
, (int *) NULL
,
205 (struct symtab
**) NULL
)))
208 int name_len
= strlen (name
);
212 /* Loop over each method name. At this level, all overloads of a name
213 are counted as a single name. There is an inner loop which loops over
216 for (method_counter
= TYPE_NFN_FIELDS (t
) - 1;
220 char *method_name
= TYPE_FN_FIELDLIST_NAME (t
, method_counter
);
223 if (strncmp (method_name
, "__", 2) == 0 ||
224 strncmp (method_name
, "op", 2) == 0 ||
225 strncmp (method_name
, "type", 4) == 0)
227 if (cplus_demangle_opname (method_name
, dem_opname
, DMGL_ANSI
))
228 method_name
= dem_opname
;
229 else if (cplus_demangle_opname (method_name
, dem_opname
, 0))
230 method_name
= dem_opname
;
233 if (strcmp_iw (name
, method_name
) == 0)
234 /* Find all the overloaded methods with that name. */
235 i1
+= add_matching_methods (method_counter
, t
,
237 else if (strncmp (class_name
, name
, name_len
) == 0
238 && (class_name
[name_len
] == '\0'
239 || class_name
[name_len
] == '<'))
240 i1
+= add_constructors (method_counter
, t
,
245 /* Only search baseclasses if there is no match yet, since names in
246 derived classes override those in baseclasses.
248 FIXME: The above is not true; it is only true of member functions
249 if they have the same number of arguments (??? - section 13.1 of the
250 ARM says the function members are not in the same scope but doesn't
251 really spell out the rules in a way I understand. In any case, if
252 the number of arguments differ this is a case in which we can overload
253 rather than hiding without any problem, and gcc 2.4.5 does overload
254 rather than hiding in this case). */
257 for (ibase
= 0; ibase
< TYPE_N_BASECLASSES (t
); ibase
++)
258 i1
+= find_methods (TYPE_BASECLASS (t
, ibase
), name
, sym_arr
+ i1
);
263 /* Add the symbols associated to methods of the class whose type is T
264 and whose name matches the method indexed by METHOD_COUNTER in the
265 array SYM_ARR. Return the number of methods added. */
268 add_matching_methods (int method_counter
, struct type
*t
,
269 struct symbol
**sym_arr
)
274 for (field_counter
= TYPE_FN_FIELDLIST_LENGTH (t
, method_counter
) - 1;
281 f
= TYPE_FN_FIELDLIST1 (t
, method_counter
);
283 if (TYPE_FN_FIELD_STUB (f
, field_counter
))
287 tmp_name
= gdb_mangle_name (t
,
290 phys_name
= alloca (strlen (tmp_name
) + 1);
291 strcpy (phys_name
, tmp_name
);
295 phys_name
= TYPE_FN_FIELD_PHYSNAME (f
, field_counter
);
297 /* Destructor is handled by caller, don't add it to
299 if (is_destructor_name (phys_name
) != 0)
302 sym_arr
[i1
] = lookup_symbol (phys_name
,
305 (struct symtab
**) NULL
);
310 /* This error message gets printed, but the method
311 still seems to be found
312 fputs_filtered("(Cannot find method ", gdb_stdout);
313 fprintf_symbol_filtered (gdb_stdout, phys_name,
315 DMGL_PARAMS | DMGL_ANSI);
316 fputs_filtered(" - possibly inlined.)\n", gdb_stdout);
324 /* Add the symbols associated to constructors of the class whose type
325 is CLASS_TYPE and which are indexed by by METHOD_COUNTER to the
326 array SYM_ARR. Return the number of methods added. */
329 add_constructors (int method_counter
, struct type
*t
,
330 struct symbol
**sym_arr
)
335 /* For GCC 3.x and stabs, constructors and destructors
336 have names like __base_ctor and __complete_dtor.
337 Check the physname for now if we're looking for a
340 = TYPE_FN_FIELDLIST_LENGTH (t
, method_counter
) - 1;
347 f
= TYPE_FN_FIELDLIST1 (t
, method_counter
);
349 /* GCC 3.x will never produce stabs stub methods, so
350 we don't need to handle this case. */
351 if (TYPE_FN_FIELD_STUB (f
, field_counter
))
353 phys_name
= TYPE_FN_FIELD_PHYSNAME (f
, field_counter
);
354 if (! is_constructor_name (phys_name
))
357 /* If this method is actually defined, include it in the
359 sym_arr
[i1
] = lookup_symbol (phys_name
,
362 (struct symtab
**) NULL
);
370 /* Helper function for decode_line_1.
371 Build a canonical line spec in CANONICAL if it is non-NULL and if
372 the SAL has a symtab.
373 If SYMNAME is non-NULL the canonical line spec is `filename:symname'.
374 If SYMNAME is NULL the line number from SAL is used and the canonical
375 line spec is `filename:linenum'. */
378 build_canonical_line_spec (struct symtab_and_line
*sal
, char *symname
,
381 char **canonical_arr
;
382 char *canonical_name
;
384 struct symtab
*s
= sal
->symtab
;
386 if (s
== (struct symtab
*) NULL
387 || s
->filename
== (char *) NULL
388 || canonical
== (char ***) NULL
)
391 canonical_arr
= (char **) xmalloc (sizeof (char *));
392 *canonical
= canonical_arr
;
394 filename
= s
->filename
;
397 canonical_name
= xmalloc (strlen (filename
) + strlen (symname
) + 2);
398 sprintf (canonical_name
, "%s:%s", filename
, symname
);
402 canonical_name
= xmalloc (strlen (filename
) + 30);
403 sprintf (canonical_name
, "%s:%d", filename
, sal
->line
);
405 canonical_arr
[0] = canonical_name
;
410 /* Find an instance of the character C in the string S that is outside
411 of all parenthesis pairs, single-quoted strings, and double-quoted
412 strings. Also, ignore the char within a template name, like a ','
413 within foo<int, int>. */
416 find_toplevel_char (char *s
, char c
)
418 int quoted
= 0; /* zero if we're not in quotes;
419 '"' if we're in a double-quoted string;
420 '\'' if we're in a single-quoted string. */
421 int depth
= 0; /* Number of unclosed parens we've seen. */
424 for (scan
= s
; *scan
; scan
++)
430 else if (*scan
== '\\' && *(scan
+ 1))
433 else if (*scan
== c
&& ! quoted
&& depth
== 0)
435 else if (*scan
== '"' || *scan
== '\'')
437 else if (*scan
== '(' || *scan
== '<')
439 else if ((*scan
== ')' || *scan
== '>') && depth
> 0)
446 /* Given a list of NELTS symbols in SYM_ARR, return a list of lines to
447 operate on (ask user if necessary).
448 If CANONICAL is non-NULL return a corresponding array of mangled names
449 as canonical line specs there. */
451 static struct symtabs_and_lines
452 decode_line_2 (struct symbol
*sym_arr
[], int nelts
, int funfirstline
,
455 struct symtabs_and_lines values
, return_values
;
460 struct cleanup
*old_chain
;
461 char **canonical_arr
= (char **) NULL
;
463 values
.sals
= (struct symtab_and_line
*)
464 alloca (nelts
* sizeof (struct symtab_and_line
));
465 return_values
.sals
= (struct symtab_and_line
*)
466 xmalloc (nelts
* sizeof (struct symtab_and_line
));
467 old_chain
= make_cleanup (xfree
, return_values
.sals
);
471 canonical_arr
= (char **) xmalloc (nelts
* sizeof (char *));
472 make_cleanup (xfree
, canonical_arr
);
473 memset (canonical_arr
, 0, nelts
* sizeof (char *));
474 *canonical
= canonical_arr
;
478 printf_unfiltered ("[0] cancel\n[1] all\n");
481 init_sal (&return_values
.sals
[i
]); /* Initialize to zeroes. */
482 init_sal (&values
.sals
[i
]);
483 if (sym_arr
[i
] && SYMBOL_CLASS (sym_arr
[i
]) == LOC_BLOCK
)
485 values
.sals
[i
] = find_function_start_sal (sym_arr
[i
], funfirstline
);
486 printf_unfiltered ("[%d] %s at %s:%d\n",
488 SYMBOL_PRINT_NAME (sym_arr
[i
]),
489 values
.sals
[i
].symtab
->filename
,
490 values
.sals
[i
].line
);
493 printf_unfiltered ("?HERE\n");
497 prompt
= getenv ("PS2");
502 args
= command_line_input (prompt
, 0, "overload-choice");
504 if (args
== 0 || *args
== 0)
505 error_no_arg ("one or more choice numbers");
513 while (*arg1
>= '0' && *arg1
<= '9')
515 if (*arg1
&& *arg1
!= ' ' && *arg1
!= '\t')
516 error ("Arguments must be choice numbers.");
526 for (i
= 0; i
< nelts
; i
++)
528 if (canonical_arr
[i
] == NULL
)
530 symname
= DEPRECATED_SYMBOL_NAME (sym_arr
[i
]);
531 canonical_arr
[i
] = savestring (symname
, strlen (symname
));
535 memcpy (return_values
.sals
, values
.sals
,
536 (nelts
* sizeof (struct symtab_and_line
)));
537 return_values
.nelts
= nelts
;
538 discard_cleanups (old_chain
);
539 return return_values
;
542 if (num
>= nelts
+ 2)
544 printf_unfiltered ("No choice number %d.\n", num
);
549 if (values
.sals
[num
].pc
)
553 symname
= DEPRECATED_SYMBOL_NAME (sym_arr
[num
]);
554 make_cleanup (xfree
, symname
);
555 canonical_arr
[i
] = savestring (symname
, strlen (symname
));
557 return_values
.sals
[i
++] = values
.sals
[num
];
558 values
.sals
[num
].pc
= 0;
562 printf_unfiltered ("duplicate request for %d ignored.\n", num
);
567 while (*args
== ' ' || *args
== '\t')
570 return_values
.nelts
= i
;
571 discard_cleanups (old_chain
);
572 return return_values
;
575 /* The parser of linespec itself. */
577 /* Parse a string that specifies a line number.
578 Pass the address of a char * variable; that variable will be
579 advanced over the characters actually parsed.
583 LINENUM -- that line number in current file. PC returned is 0.
584 FILE:LINENUM -- that line in that file. PC returned is 0.
585 FUNCTION -- line number of openbrace of that function.
586 PC returned is the start of the function.
587 VARIABLE -- line number of definition of that variable.
589 FILE:FUNCTION -- likewise, but prefer functions in that file.
590 *EXPR -- line in which address EXPR appears.
592 This may all be followed by an "if EXPR", which we ignore.
594 FUNCTION may be an undebuggable function found in minimal symbol table.
596 If the argument FUNFIRSTLINE is nonzero, we want the first line
597 of real code inside a function when a function is specified, and it is
598 not OK to specify a variable or type to get its line number.
600 DEFAULT_SYMTAB specifies the file to use if none is specified.
601 It defaults to current_source_symtab.
602 DEFAULT_LINE specifies the line number to use for relative
603 line numbers (that start with signs). Defaults to current_source_line.
604 If CANONICAL is non-NULL, store an array of strings containing the canonical
605 line specs there if necessary. Currently overloaded member functions and
606 line numbers or static functions without a filename yield a canonical
607 line spec. The array and the line spec strings are allocated on the heap,
608 it is the callers responsibility to free them.
610 Note that it is possible to return zero for the symtab
611 if no file is validly specified. Callers must check that.
612 Also, the line number returned may be invalid. */
614 /* We allow single quotes in various places. This is a hideous
615 kludge, which exists because the completer can't yet deal with the
616 lack of single quotes. FIXME: write a linespec_completer which we
617 can use as appropriate instead of make_symbol_completion_list. */
619 struct symtabs_and_lines
620 decode_line_1 (char **argptr
, int funfirstline
, struct symtab
*default_symtab
,
621 int default_line
, char ***canonical
)
625 /* If a file name is specified, this is its symtab. */
626 struct symtab
*file_symtab
= NULL
;
629 /* This is NULL if there are no parens in *ARGPTR, or a pointer to
630 the closing parenthesis if there are parens. */
632 /* This says whether or not something in *ARGPTR is quoted with
633 completer_quotes (i.e. with single quotes). */
635 /* Is part of *ARGPTR is enclosed in double quotes? */
636 int is_quote_enclosed
;
637 int is_objc_method
= 0;
638 char *saved_arg
= *argptr
;
640 /* Defaults have defaults. */
642 initialize_defaults (&default_symtab
, &default_line
);
644 /* See if arg is *PC. */
647 return decode_indirect (argptr
);
649 /* Set various flags. 'paren_pointer' is important for overload
650 checking, where we allow things like:
651 (gdb) break c::f(int)
654 set_flags (*argptr
, &is_quoted
, &paren_pointer
);
656 /* Check to see if it's a multipart linespec (with colons or
659 /* Locate the end of the first half of the linespec. */
661 p
= locate_first_half (argptr
, &is_quote_enclosed
);
663 /* Check if this is an Objective-C method (anything that starts with
664 a '+' or '-' and a '['). */
665 if (*p
&& (p
[0] == ':') && (strchr ("+-", p
[1]) != NULL
)
669 paren_pointer
= NULL
; /* Just a category name. Ignore it. */
672 /* Check if the symbol could be an Objective-C selector. */
675 struct symtabs_and_lines values
;
676 values
= decode_objc (argptr
, funfirstline
, NULL
,
677 canonical
, saved_arg
);
678 if (values
.sals
!= NULL
)
682 /* Does it look like there actually were two parts? */
684 if ((p
[0] == ':' || p
[0] == '.') && paren_pointer
== NULL
)
687 *argptr
= *argptr
+ 1;
689 /* Is it a C++ or Java compound data structure? */
691 if (p
[0] == '.' || p
[1] == ':')
692 return decode_compound (argptr
, funfirstline
, canonical
,
695 /* No, the first part is a filename; set s to be that file's
696 symtab. Also, move argptr past the filename. */
698 file_symtab
= symtab_from_filename (argptr
, p
, is_quote_enclosed
);
701 /* No one really seems to know why this was added. It certainly
702 breaks the command line, though, whenever the passed
703 name is of the form ClassName::Method. This bit of code
704 singles out the class name, and if funfirstline is set (for
705 example, you are setting a breakpoint at this function),
706 you get an error. This did not occur with earlier
707 verions, so I am ifdef'ing this out. 3/29/99 */
710 /* Check if what we have till now is a symbol name */
712 /* We may be looking at a template instantiation such
713 as "foo<int>". Check here whether we know about it,
714 instead of falling through to the code below which
715 handles ordinary function names, because that code
716 doesn't like seeing '<' and '>' in a name -- the
717 skip_quoted call doesn't go past them. So see if we
718 can figure it out right now. */
720 copy
= (char *) alloca (p
- *argptr
+ 1);
721 memcpy (copy
, *argptr
, p
- *argptr
);
722 copy
[p
- *argptr
] = '\000';
723 sym
= lookup_symbol (copy
, 0, VAR_DOMAIN
, 0, &sym_symtab
);
726 *argptr
= (*p
== '\'') ? p
+ 1 : p
;
727 return symbol_found (funfirstline
, canonical
, copy
, sym
,
730 /* Otherwise fall out from here and go to file/line spec
735 /* S is specified file's symtab, or 0 if no file specified.
736 arg no longer contains the file name. */
738 /* Check whether arg is all digits (and sign). */
741 if (*q
== '-' || *q
== '+')
743 while (*q
>= '0' && *q
<= '9')
746 if (q
!= *argptr
&& (*q
== 0 || *q
== ' ' || *q
== '\t' || *q
== ','))
747 /* We found a token consisting of all digits -- at least one digit. */
748 return decode_all_digits (argptr
, default_symtab
, default_line
,
749 canonical
, file_symtab
, q
);
751 /* Arg token is not digits => try it as a variable name
752 Find the next token (everything up to end or next whitespace). */
754 if (**argptr
== '$') /* May be a convenience variable. */
755 /* One or two $ chars possible. */
756 p
= skip_quoted (*argptr
+ (((*argptr
)[1] == '$') ? 2 : 1));
759 p
= skip_quoted (*argptr
);
761 error ("Unmatched single quote.");
763 else if (is_objc_method
)
765 /* allow word separators in method names for Obj-C */
766 p
= skip_quoted_chars (*argptr
, NULL
, "");
768 else if (paren_pointer
!= NULL
)
770 p
= paren_pointer
+ 1;
774 p
= skip_quoted (*argptr
);
777 copy
= (char *) alloca (p
- *argptr
+ 1);
778 memcpy (copy
, *argptr
, p
- *argptr
);
779 copy
[p
- *argptr
] = '\0';
782 && copy
[0] == copy
[p
- *argptr
- 1]
783 && strchr (get_gdb_completer_quote_characters (), copy
[0]) != NULL
)
785 copy
[p
- *argptr
- 1] = '\0';
788 while (*p
== ' ' || *p
== '\t')
792 /* If it starts with $: may be a legitimate variable or routine name
793 (e.g. HP-UX millicode routines such as $$dyncall), or it may
794 be history value, or it may be a convenience variable. */
797 return decode_dollar (copy
, funfirstline
, default_symtab
,
798 canonical
, file_symtab
);
800 /* Look up that token as a variable.
801 If file specified, use that file's per-file block to start with. */
803 return decode_variable (copy
, funfirstline
, canonical
, file_symtab
);
808 /* Now, more helper functions for decode_line_1. Some conventions
809 that these functions follow:
811 Decode_line_1 typically passes along some of its arguments or local
812 variables to the subfunctions. It passes the variables by
813 reference if they are modified by the subfunction, and by value
816 Some of the functions have side effects that don't arise from
817 variables that are passed by reference. In particular, if a
818 function is passed ARGPTR as an argument, it modifies what ARGPTR
819 points to; typically, it advances *ARGPTR past whatever substring
820 it has just looked at. (If it doesn't modify *ARGPTR, then the
821 function gets passed *ARGPTR instead, which is then called ARG: see
822 set_flags, for example.) Also, functions that return a struct
823 symtabs_and_lines may modify CANONICAL, as in the description of
826 If a function returns a struct symtabs_and_lines, then that struct
827 will immediately make its way up the call chain to be returned by
828 decode_line_1. In particular, all of the functions decode_XXX
829 calculate the appropriate struct symtabs_and_lines, under the
830 assumption that their argument is of the form XXX. */
832 /* First, some functions to initialize stuff at the beggining of the
836 initialize_defaults (struct symtab
**default_symtab
, int *default_line
)
838 if (*default_symtab
== 0)
840 /* Use whatever we have for the default source line. We don't use
841 get_current_or_default_symtab_and_line as it can recurse and call
843 struct symtab_and_line cursal
=
844 get_current_source_symtab_and_line ();
846 *default_symtab
= cursal
.symtab
;
847 *default_line
= cursal
.line
;
852 set_flags (char *arg
, int *is_quoted
, char **paren_pointer
)
857 /* 'has_if' is for the syntax:
858 (gdb) break foo if (a==b)
860 if ((ii
= strstr (arg
, " if ")) != NULL
||
861 (ii
= strstr (arg
, "\tif ")) != NULL
||
862 (ii
= strstr (arg
, " if\t")) != NULL
||
863 (ii
= strstr (arg
, "\tif\t")) != NULL
||
864 (ii
= strstr (arg
, " if(")) != NULL
||
865 (ii
= strstr (arg
, "\tif( ")) != NULL
)
867 /* Temporarily zap out "if (condition)" to not confuse the
868 parenthesis-checking code below. This is undone below. Do not
876 && strchr (get_gdb_completer_quote_characters (),
879 *paren_pointer
= strchr (arg
, '(');
880 if (*paren_pointer
!= NULL
)
881 *paren_pointer
= strrchr (*paren_pointer
, ')');
883 /* Now that we're safely past the paren_pointer check, put back " if
884 (condition)" so outer layers can see it. */
891 /* Decode arg of the form *PC. */
893 static struct symtabs_and_lines
894 decode_indirect (char **argptr
)
896 struct symtabs_and_lines values
;
900 pc
= parse_and_eval_address_1 (argptr
);
902 values
.sals
= (struct symtab_and_line
*)
903 xmalloc (sizeof (struct symtab_and_line
));
906 values
.sals
[0] = find_pc_line (pc
, 0);
907 values
.sals
[0].pc
= pc
;
908 values
.sals
[0].section
= find_pc_overlay (pc
);
915 /* Locate the first half of the linespec, ending in a colon, period,
916 or whitespace. (More or less.) Also, check to see if *ARGPTR is
917 enclosed in double quotes; if so, set is_quote_enclosed, advance
918 ARGPTR past that and zero out the trailing double quote. */
921 locate_first_half (char **argptr
, int *is_quote_enclosed
)
927 /* Maybe we were called with a line range FILENAME:LINENUM,FILENAME:LINENUM
928 and we must isolate the first half. Outer layers will call again later
931 Don't count commas that appear in argument lists of overloaded
932 functions, or in quoted strings. It's stupid to go to this much
933 trouble when the rest of the function is such an obvious roach hotel. */
934 ii
= find_toplevel_char (*argptr
, ',');
935 has_comma
= (ii
!= 0);
937 /* Temporarily zap out second half to not confuse the code below.
938 This is undone below. Do not change ii!! */
944 /* Maybe arg is FILE : LINENUM or FILE : FUNCTION. May also be
945 CLASS::MEMBER, or NAMESPACE::NAME. Look for ':', but ignore
951 *is_quote_enclosed
= 1;
956 *is_quote_enclosed
= 0;
961 char *temp_end
= find_template_name_end (p
);
963 error ("malformed template specification in command");
966 /* Check for a colon and a plus or minus and a [ (which
967 indicates an Objective-C method) */
968 if (*p
&& (p
[0] == ':') && (strchr ("+-", p
[1]) != NULL
)
973 /* Check for the end of the first half of the linespec. End of
974 line, a tab, a double colon or the last single colon, or a
975 space. But if enclosed in double quotes we do not break on
980 && ((p
[1] == ':') || (strchr (p
+ 1, ':') == NULL
)))
981 || ((p
[0] == ' ') && !*is_quote_enclosed
))
983 if (p
[0] == '.' && strchr (p
, ':') == NULL
)
985 /* Java qualified method. Find the *last* '.', since the
986 others are package qualifiers. */
987 for (p1
= p
; *p1
; p1
++)
995 while (p
[0] == ' ' || p
[0] == '\t')
998 /* If the closing double quote was left at the end, remove it. */
999 if (*is_quote_enclosed
)
1001 char *closing_quote
= strchr (p
- 1, '"');
1002 if (closing_quote
&& closing_quote
[1] == '\0')
1003 *closing_quote
= '\0';
1006 /* Now that we've safely parsed the first half, put back ',' so
1007 outer layers can see it. */
1016 /* Here's where we recognise an Objective-C Selector. An Objective C
1017 selector may be implemented by more than one class, therefore it
1018 may represent more than one method/function. This gives us a
1019 situation somewhat analogous to C++ overloading. If there's more
1020 than one method that could represent the selector, then use some of
1021 the existing C++ code to let the user choose one. */
1023 struct symtabs_and_lines
1024 decode_objc (char **argptr
, int funfirstline
, struct symtab
*file_symtab
,
1025 char ***canonical
, char *saved_arg
)
1027 struct symtabs_and_lines values
;
1028 struct symbol
**sym_arr
= NULL
;
1029 struct symbol
*sym
= NULL
;
1031 struct block
*block
= NULL
;
1038 if (file_symtab
!= NULL
)
1039 block
= BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab
), STATIC_BLOCK
);
1041 block
= get_selected_block (0);
1043 copy
= find_imps (file_symtab
, block
, *argptr
, NULL
, &i1
, &i2
);
1047 sym_arr
= (struct symbol
**) alloca ((i1
+ 1) * sizeof (struct symbol
*));
1050 copy
= find_imps (file_symtab
, block
, *argptr
, sym_arr
, &i1
, &i2
);
1054 /* i1 now represents the TOTAL number of matches found.
1055 i2 represents how many HIGH-LEVEL (struct symbol) matches,
1056 which will come first in the sym_arr array. Any low-level
1057 (minimal_symbol) matches will follow those. */
1063 /* Already a struct symbol. */
1068 sym
= find_pc_function (SYMBOL_VALUE_ADDRESS (sym_arr
[0]));
1069 if ((sym
!= NULL
) && strcmp (SYMBOL_LINKAGE_NAME (sym_arr
[0]), SYMBOL_LINKAGE_NAME (sym
)) != 0)
1071 warning ("debugging symbol \"%s\" does not match selector; ignoring", SYMBOL_LINKAGE_NAME (sym
));
1076 values
.sals
= (struct symtab_and_line
*) xmalloc (sizeof (struct symtab_and_line
));
1079 if (sym
&& SYMBOL_CLASS (sym
) == LOC_BLOCK
)
1081 /* Canonicalize this, so it remains resolved for dylib loads. */
1082 values
.sals
[0] = find_function_start_sal (sym
, funfirstline
);
1083 build_canonical_line_spec (values
.sals
, SYMBOL_NATURAL_NAME (sym
), canonical
);
1087 /* The only match was a non-debuggable symbol. */
1088 values
.sals
[0].symtab
= 0;
1089 values
.sals
[0].line
= 0;
1090 values
.sals
[0].end
= 0;
1091 values
.sals
[0].pc
= SYMBOL_VALUE_ADDRESS (sym_arr
[0]);
1098 /* More than one match. The user must choose one or more. */
1099 return decode_line_2 (sym_arr
, i2
, funfirstline
, canonical
);
1105 /* This handles C++ and Java compound data structures. P should point
1106 at the first component separator, i.e. double-colon or period. */
1108 static struct symtabs_and_lines
1109 decode_compound (char **argptr
, int funfirstline
, char ***canonical
,
1110 char *saved_arg
, char *p
)
1112 struct symtabs_and_lines values
;
1117 char *saved_arg2
= *argptr
;
1120 /* The symtab that SYM was found in. */
1121 struct symtab
*sym_symtab
;
1123 struct symbol
*sym_class
;
1124 struct symbol
**sym_arr
;
1127 /* First check for "global" namespace specification,
1128 of the form "::foo". If found, skip over the colons
1129 and jump to normal symbol processing. */
1131 && ((*argptr
== p
) || (p
[-1] == ' ') || (p
[-1] == '\t')))
1134 /* We have what looks like a class or namespace
1135 scope specification (A::B), possibly with many
1136 levels of namespaces or classes (A::B::C::D).
1138 Some versions of the HP ANSI C++ compiler (as also possibly
1139 other compilers) generate class/function/member names with
1140 embedded double-colons if they are inside namespaces. To
1141 handle this, we loop a few times, considering larger and
1142 larger prefixes of the string as though they were single
1143 symbols. So, if the initially supplied string is
1144 A::B::C::D::foo, we have to look up "A", then "A::B",
1145 then "A::B::C", then "A::B::C::D", and finally
1146 "A::B::C::D::foo" as single, monolithic symbols, because
1147 A, B, C or D may be namespaces.
1149 Note that namespaces can nest only inside other
1150 namespaces, and not inside classes. So we need only
1151 consider *prefixes* of the string; there is no need to look up
1152 "B::C" separately as a symbol in the previous example. */
1154 p2
= p
; /* Save for restart. */
1157 sym_class
= lookup_prefix_sym (argptr
, p
);
1160 (t
= check_typedef (SYMBOL_TYPE (sym_class
)),
1161 (TYPE_CODE (t
) == TYPE_CODE_STRUCT
1162 || TYPE_CODE (t
) == TYPE_CODE_UNION
)))
1164 /* Arg token is not digits => try it as a function name.
1165 Find the next token (everything up to end or next
1168 && strchr (get_gdb_completer_quote_characters (),
1171 p
= skip_quoted (*argptr
);
1172 *argptr
= *argptr
+ 1;
1177 while (*p
&& *p
!= ' ' && *p
!= '\t' && *p
!= ',' && *p
!= ':')
1181 q = operator_chars (*argptr, &q1);
1185 char *tmp = alloca (q1 - q + 1);
1186 memcpy (tmp, q, q1 - q);
1188 opname = cplus_mangle_opname (tmp, DMGL_ANSI);
1191 cplusplus_error (saved_arg, "no mangling for \"%s\"\n", tmp);
1193 copy = (char*) alloca (3 + strlen(opname));
1194 sprintf (copy, "__%s", opname);
1200 copy
= (char *) alloca (p
- *argptr
+ 1);
1201 memcpy (copy
, *argptr
, p
- *argptr
);
1202 copy
[p
- *argptr
] = '\0';
1204 && copy
[p
- *argptr
- 1]
1205 && strchr (get_gdb_completer_quote_characters (),
1206 copy
[p
- *argptr
- 1]) != NULL
)
1207 copy
[p
- *argptr
- 1] = '\0';
1210 /* No line number may be specified. */
1211 while (*p
== ' ' || *p
== '\t')
1215 return find_method (funfirstline
, canonical
, saved_arg
,
1216 copy
, t
, sym_class
);
1219 /* Move pointer up to next possible class/namespace token. */
1220 p
= p2
+ 1; /* Restart with old value +1. */
1221 /* Move pointer ahead to next double-colon. */
1222 while (*p
&& (p
[0] != ' ') && (p
[0] != '\t') && (p
[0] != '\''))
1226 temp_end
= find_template_name_end (p
);
1228 error ("malformed template specification in command");
1231 else if ((p
[0] == ':') && (p
[1] == ':'))
1232 break; /* Found double-colon. */
1238 break; /* Out of the while (1). */
1240 p2
= p
; /* Save restart for next time around. */
1241 *argptr
= saved_arg2
; /* Restore argptr. */
1244 /* Last chance attempt -- check entire name as a symbol. Use "copy"
1245 in preparation for jumping out of this block, to be consistent
1246 with usage following the jump target. */
1247 copy
= (char *) alloca (p
- saved_arg2
+ 1);
1248 memcpy (copy
, saved_arg2
, p
- saved_arg2
);
1249 /* Note: if is_quoted should be true, we snuff out quote here
1251 copy
[p
- saved_arg2
] = '\000';
1252 /* Set argptr to skip over the name. */
1253 *argptr
= (*p
== '\'') ? p
+ 1 : p
;
1254 /* Look up entire name */
1255 sym
= lookup_symbol (copy
, 0, VAR_DOMAIN
, 0, &sym_symtab
);
1257 return symbol_found (funfirstline
, canonical
, copy
, sym
,
1260 /* Couldn't find any interpretation as classes/namespaces, so give
1261 up. The quotes are important if copy is empty. */
1262 cplusplus_error (saved_arg
,
1263 "Can't find member of namespace, class, struct, or union named \"%s\"\n",
1267 /* Next come some helper functions for decode_compound. */
1269 /* Return the symbol corresponding to the substring of *ARGPTR ending
1270 at P, allowing whitespace. Also, advance *ARGPTR past the symbol
1271 name in question, the compound object separator ("::" or "."), and
1274 static struct symbol
*
1275 lookup_prefix_sym (char **argptr
, char *p
)
1280 /* Extract the class name. */
1282 while (p
!= *argptr
&& p
[-1] == ' ')
1284 copy
= (char *) alloca (p
- *argptr
+ 1);
1285 memcpy (copy
, *argptr
, p
- *argptr
);
1286 copy
[p
- *argptr
] = 0;
1288 /* Discard the class name from the arg. */
1289 p
= p1
+ (p1
[0] == ':' ? 2 : 1);
1290 while (*p
== ' ' || *p
== '\t')
1294 return lookup_symbol (copy
, 0, STRUCT_DOMAIN
, 0,
1295 (struct symtab
**) NULL
);
1298 /* This finds the method COPY in the class whose type is T and whose
1299 symbol is SYM_CLASS. */
1301 static struct symtabs_and_lines
1302 find_method (int funfirstline
, char ***canonical
, char *saved_arg
,
1303 char *copy
, struct type
*t
, struct symbol
*sym_class
)
1305 struct symtabs_and_lines values
;
1306 struct symbol
*sym
= 0;
1307 int i1
; /* Counter for the symbol array. */
1308 struct symbol
**sym_arr
= alloca (total_number_of_methods (t
)
1309 * sizeof (struct symbol
*));
1311 /* Find all methods with a matching name, and put them in
1314 i1
= collect_methods (copy
, t
, sym_arr
);
1318 /* There is exactly one field with that name. */
1321 if (sym
&& SYMBOL_CLASS (sym
) == LOC_BLOCK
)
1323 values
.sals
= (struct symtab_and_line
*)
1324 xmalloc (sizeof (struct symtab_and_line
));
1326 values
.sals
[0] = find_function_start_sal (sym
,
1337 /* There is more than one field with that name
1338 (overloaded). Ask the user which one to use. */
1339 return decode_line_2 (sym_arr
, i1
, funfirstline
, canonical
);
1345 if (is_operator_name (copy
))
1347 tmp
= (char *) alloca (strlen (copy
+ 3) + 9);
1348 strcpy (tmp
, "operator ");
1349 strcat (tmp
, copy
+ 3);
1354 cplusplus_error (saved_arg
,
1355 "the class `%s' does not have destructor defined\n",
1356 SYMBOL_PRINT_NAME (sym_class
));
1358 cplusplus_error (saved_arg
,
1359 "the class %s does not have any method named %s\n",
1360 SYMBOL_PRINT_NAME (sym_class
), tmp
);
1364 /* Find all methods named COPY in the class whose type is T, and put
1365 them in SYM_ARR. Return the number of methods found. */
1368 collect_methods (char *copy
, struct type
*t
,
1369 struct symbol
**sym_arr
)
1371 int i1
= 0; /* Counter for the symbol array. */
1373 if (destructor_name_p (copy
, t
))
1375 /* Destructors are a special case. */
1376 int m_index
, f_index
;
1378 if (get_destructor_fn_field (t
, &m_index
, &f_index
))
1380 struct fn_field
*f
= TYPE_FN_FIELDLIST1 (t
, m_index
);
1383 lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f
, f_index
),
1384 NULL
, VAR_DOMAIN
, (int *) NULL
,
1385 (struct symtab
**) NULL
);
1391 i1
= find_methods (t
, copy
, sym_arr
);
1398 /* Return the symtab associated to the filename given by the substring
1399 of *ARGPTR ending at P, and advance ARGPTR past that filename. */
1401 static struct symtab
*
1402 symtab_from_filename (char **argptr
, char *p
, int is_quote_enclosed
)
1406 struct symtab
*file_symtab
;
1409 while (p
!= *argptr
&& p
[-1] == ' ')
1411 if ((*p
== '"') && is_quote_enclosed
)
1413 copy
= (char *) alloca (p
- *argptr
+ 1);
1414 memcpy (copy
, *argptr
, p
- *argptr
);
1415 /* It may have the ending quote right after the file name. */
1416 if (is_quote_enclosed
&& copy
[p
- *argptr
- 1] == '"')
1417 copy
[p
- *argptr
- 1] = 0;
1419 copy
[p
- *argptr
] = 0;
1421 /* Find that file's data. */
1422 file_symtab
= lookup_symtab (copy
);
1423 if (file_symtab
== 0)
1425 if (!have_full_symbols () && !have_partial_symbols ())
1426 error ("No symbol table is loaded. Use the \"file\" command.");
1427 error ("No source file named %s.", copy
);
1430 /* Discard the file name from the arg. */
1432 while (*p
== ' ' || *p
== '\t')
1441 /* This decodes a line where the argument is all digits (possibly
1442 preceded by a sign). Q should point to the end of those digits;
1443 the other arguments are as usual. */
1445 static struct symtabs_and_lines
1446 decode_all_digits (char **argptr
, struct symtab
*default_symtab
,
1447 int default_line
, char ***canonical
,
1448 struct symtab
*file_symtab
, char *q
)
1451 struct symtabs_and_lines values
;
1452 struct symtab_and_line val
;
1460 /* We might need a canonical line spec if no file was specified. */
1461 int need_canonical
= (file_symtab
== 0) ? 1 : 0;
1465 /* This is where we need to make sure that we have good defaults.
1466 We must guarantee that this section of code is never executed
1467 when we are called with just a function name, since
1468 set_default_source_symtab_and_line uses
1469 select_source_symtab that calls us with such an argument. */
1471 if (file_symtab
== 0 && default_symtab
== 0)
1473 /* Make sure we have at least a default source file. */
1474 set_default_source_symtab_and_line ();
1475 initialize_defaults (&default_symtab
, &default_line
);
1478 if (**argptr
== '+')
1479 sign
= plus
, (*argptr
)++;
1480 else if (**argptr
== '-')
1481 sign
= minus
, (*argptr
)++;
1482 val
.line
= atoi (*argptr
);
1488 if (file_symtab
== 0)
1489 val
.line
= default_line
+ val
.line
;
1494 if (file_symtab
== 0)
1495 val
.line
= default_line
- val
.line
;
1500 break; /* No need to adjust val.line. */
1503 while (*q
== ' ' || *q
== '\t')
1506 if (file_symtab
== 0)
1507 file_symtab
= default_symtab
;
1509 /* It is possible that this source file has more than one symtab,
1510 and that the new line number specification has moved us from the
1511 default (in file_symtab) to a new one. */
1512 val
.symtab
= find_line_symtab (file_symtab
, val
.line
, NULL
, NULL
);
1513 if (val
.symtab
== 0)
1514 val
.symtab
= file_symtab
;
1517 values
.sals
= (struct symtab_and_line
*)
1518 xmalloc (sizeof (struct symtab_and_line
));
1519 values
.sals
[0] = val
;
1522 build_canonical_line_spec (values
.sals
, NULL
, canonical
);
1528 /* Decode a linespec starting with a dollar sign. */
1530 static struct symtabs_and_lines
1531 decode_dollar (char *copy
, int funfirstline
, struct symtab
*default_symtab
,
1532 char ***canonical
, struct symtab
*file_symtab
)
1536 int need_canonical
= 0;
1537 struct symtabs_and_lines values
;
1538 struct symtab_and_line val
;
1541 /* The symtab that SYM was found in. */
1542 struct symtab
*sym_symtab
;
1543 struct minimal_symbol
*msymbol
;
1545 p
= (copy
[1] == '$') ? copy
+ 2 : copy
+ 1;
1546 while (*p
>= '0' && *p
<= '9')
1548 if (!*p
) /* Reached end of token without hitting non-digit. */
1550 /* We have a value history reference. */
1551 sscanf ((copy
[1] == '$') ? copy
+ 2 : copy
+ 1, "%d", &index
);
1552 valx
= access_value_history ((copy
[1] == '$') ? -index
: index
);
1553 if (TYPE_CODE (VALUE_TYPE (valx
)) != TYPE_CODE_INT
)
1554 error ("History values used in line specs must have integer values.");
1558 /* Not all digits -- may be user variable/function or a
1559 convenience variable. */
1561 /* Look up entire name as a symbol first. */
1562 sym
= lookup_symbol (copy
, 0, VAR_DOMAIN
, 0, &sym_symtab
);
1563 file_symtab
= (struct symtab
*) 0;
1565 /* Symbol was found --> jump to normal symbol processing. */
1567 return symbol_found (funfirstline
, canonical
, copy
, sym
,
1570 /* If symbol was not found, look in minimal symbol tables. */
1571 msymbol
= lookup_minimal_symbol (copy
, NULL
, NULL
);
1572 /* Min symbol was found --> jump to minsym processing. */
1574 return minsym_found (funfirstline
, msymbol
);
1576 /* Not a user variable or function -- must be convenience variable. */
1577 need_canonical
= (file_symtab
== 0) ? 1 : 0;
1578 valx
= value_of_internalvar (lookup_internalvar (copy
+ 1));
1579 if (TYPE_CODE (VALUE_TYPE (valx
)) != TYPE_CODE_INT
)
1580 error ("Convenience variables used in line specs must have integer values.");
1585 /* Either history value or convenience value from above, in valx. */
1586 val
.symtab
= file_symtab
? file_symtab
: default_symtab
;
1587 val
.line
= value_as_long (valx
);
1590 values
.sals
= (struct symtab_and_line
*) xmalloc (sizeof val
);
1591 values
.sals
[0] = val
;
1595 build_canonical_line_spec (values
.sals
, NULL
, canonical
);
1602 /* Decode a linespec that's a variable. If FILE_SYMTAB is non-NULL,
1603 look in that symtab's static variables first. */
1605 static struct symtabs_and_lines
1606 decode_variable (char *copy
, int funfirstline
, char ***canonical
,
1607 struct symtab
*file_symtab
)
1610 /* The symtab that SYM was found in. */
1611 struct symtab
*sym_symtab
;
1613 struct minimal_symbol
*msymbol
;
1615 sym
= lookup_symbol (copy
,
1617 ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab
),
1619 : get_selected_block (0)),
1620 VAR_DOMAIN
, 0, &sym_symtab
);
1623 return symbol_found (funfirstline
, canonical
, copy
, sym
,
1624 file_symtab
, sym_symtab
);
1626 msymbol
= lookup_minimal_symbol (copy
, NULL
, NULL
);
1628 if (msymbol
!= NULL
)
1629 return minsym_found (funfirstline
, msymbol
);
1631 if (!have_full_symbols () &&
1632 !have_partial_symbols () && !have_minimal_symbols ())
1633 error ("No symbol table is loaded. Use the \"file\" command.");
1635 error ("Function \"%s\" not defined.", copy
);
1641 /* Now come some functions that are called from multiple places within
1644 /* We've found a symbol SYM to associate with our linespec; build a
1645 corresponding struct symtabs_and_lines. */
1647 static struct symtabs_and_lines
1648 symbol_found (int funfirstline
, char ***canonical
, char *copy
,
1649 struct symbol
*sym
, struct symtab
*file_symtab
,
1650 struct symtab
*sym_symtab
)
1652 struct symtabs_and_lines values
;
1654 if (SYMBOL_CLASS (sym
) == LOC_BLOCK
)
1656 /* Arg is the name of a function */
1657 values
.sals
= (struct symtab_and_line
*)
1658 xmalloc (sizeof (struct symtab_and_line
));
1659 values
.sals
[0] = find_function_start_sal (sym
, funfirstline
);
1662 /* Don't use the SYMBOL_LINE; if used at all it points to
1663 the line containing the parameters or thereabouts, not
1664 the first line of code. */
1666 /* We might need a canonical line spec if it is a static
1668 if (file_symtab
== 0)
1670 struct blockvector
*bv
= BLOCKVECTOR (sym_symtab
);
1671 struct block
*b
= BLOCKVECTOR_BLOCK (bv
, STATIC_BLOCK
);
1672 if (lookup_block_symbol (b
, copy
, NULL
, VAR_DOMAIN
) != NULL
)
1673 build_canonical_line_spec (values
.sals
, copy
, canonical
);
1680 error ("\"%s\" is not a function", copy
);
1681 else if (SYMBOL_LINE (sym
) != 0)
1683 /* We know its line number. */
1684 values
.sals
= (struct symtab_and_line
*)
1685 xmalloc (sizeof (struct symtab_and_line
));
1687 memset (&values
.sals
[0], 0, sizeof (values
.sals
[0]));
1688 values
.sals
[0].symtab
= sym_symtab
;
1689 values
.sals
[0].line
= SYMBOL_LINE (sym
);
1693 /* This can happen if it is compiled with a compiler which doesn't
1694 put out line numbers for variables. */
1695 /* FIXME: Shouldn't we just set .line and .symtab to zero
1696 and return? For example, "info line foo" could print
1698 error ("Line number not known for symbol \"%s\"", copy
);
1702 /* We've found a minimal symbol MSYMBOL to associate with our
1703 linespec; build a corresponding struct symtabs_and_lines. */
1705 static struct symtabs_and_lines
1706 minsym_found (int funfirstline
, struct minimal_symbol
*msymbol
)
1708 struct symtabs_and_lines values
;
1710 values
.sals
= (struct symtab_and_line
*)
1711 xmalloc (sizeof (struct symtab_and_line
));
1712 values
.sals
[0] = find_pc_sect_line (SYMBOL_VALUE_ADDRESS (msymbol
),
1713 (struct sec
*) 0, 0);
1714 values
.sals
[0].section
= SYMBOL_BFD_SECTION (msymbol
);
1717 values
.sals
[0].pc
+= FUNCTION_START_OFFSET
;
1718 values
.sals
[0].pc
= SKIP_PROLOGUE (values
.sals
[0].pc
);