]>
Commit | Line | Data |
---|---|---|
f412e1b4 PS |
1 | https://bugzilla.redhat.com/show_bug.cgi?id=787487 |
2 | http://sourceware.org/ml/gdb-patches/2012-02/msg00112.html | |
3 | Subject: RFC: extend symtabs_from_filename skipping for C++ | |
4 | ||
5 | I'd appreciate comments on this. Barring comments I will check it in | |
6 | after a couple days. | |
7 | ||
8 | A while ago Doug committed a patch to change linespec to skip | |
9 | symtabs_from_filename when possible. This was an important performance | |
10 | improvement. | |
11 | ||
12 | We got a bug report in Red Hat bugzilla asking that this be extended to | |
13 | C++ qualified names: | |
14 | ||
15 | https://bugzilla.redhat.com/show_bug.cgi?id=787487 | |
16 | ||
17 | This patch implements this idea. | |
18 | ||
19 | Built and regtested on x86-64 Fedora 15. | |
20 | ||
21 | Tom | |
22 | ||
23 | 2012-02-08 Tom Tromey <tromey@redhat.com> | |
24 | ||
25 | * linespec.c (decode_line_internal): Skip symtabs_from_filename | |
26 | when we have a C++ qualified name. | |
27 | ||
28 | diff --git a/gdb/linespec.c b/gdb/linespec.c | |
29 | index da88d17..3f53b8e 100644 | |
30 | --- a/gdb/linespec.c | |
31 | +++ b/gdb/linespec.c | |
32 | @@ -912,9 +912,11 @@ decode_line_internal (struct linespec_state *self, char **argptr) | |
33 | /* First things first: if ARGPTR starts with a filename, get its | |
34 | symtab and strip the filename from ARGPTR. | |
35 | Avoid calling symtab_from_filename if we know can, | |
36 | - it can be expensive. */ | |
37 | + it can be expensive. We know we can avoid the call if we see a | |
38 | + single word (e.g., "break NAME") or if we see a qualified C++ | |
39 | + name ("break QUAL::NAME"). */ | |
40 | ||
41 | - if (*p != '\0') | |
42 | + if (*p != '\0' && p[1] != ':') | |
43 | { | |
44 | TRY_CATCH (file_exception, RETURN_MASK_ERROR) | |
45 | { | |
46 |