]>
Commit | Line | Data |
---|---|---|
3a58abaf AM |
1 | Implement `b <funcname>' for <funcname> with concete inlined instances by |
2 | a multiple-PC breakpoint. | |
3 | ||
4 | Index: gdb-6.8.50.20081128/gdb/ada-lang.c | |
5 | =================================================================== | |
6 | --- gdb-6.8.50.20081128.orig/gdb/ada-lang.c 2008-11-25 00:21:15.000000000 +0100 | |
7 | +++ gdb-6.8.50.20081128/gdb/ada-lang.c 2008-12-06 21:39:56.000000000 +0100 | |
8 | @@ -4614,7 +4614,7 @@ remove_irrelevant_renamings (struct ada_ | |
9 | if (current_block == NULL) | |
10 | return nsyms; | |
11 | ||
12 | - current_function = block_linkage_function (current_block); | |
13 | + current_function = block_function (current_block); | |
14 | if (current_function == NULL) | |
15 | return nsyms; | |
16 | ||
17 | @@ -6625,7 +6625,7 @@ ada_find_renaming_symbol (const char *na | |
18 | static struct symbol * | |
19 | find_old_style_renaming_symbol (const char *name, struct block *block) | |
20 | { | |
21 | - const struct symbol *function_sym = block_linkage_function (block); | |
22 | + const struct symbol *function_sym = block_function (block); | |
23 | char *rename; | |
24 | ||
25 | if (function_sym != NULL) | |
26 | Index: gdb-6.8.50.20081128/gdb/block.c | |
27 | =================================================================== | |
28 | --- gdb-6.8.50.20081128.orig/gdb/block.c 2008-12-06 14:06:16.000000000 +0100 | |
29 | +++ gdb-6.8.50.20081128/gdb/block.c 2008-12-06 21:40:29.000000000 +0100 | |
30 | @@ -75,6 +75,19 @@ block_linkage_function (const struct blo | |
31 | return BLOCK_FUNCTION (bl); | |
32 | } | |
33 | ||
34 | +/* Return the symbol for the function which contains a specified | |
35 | + lexical block, described by a struct block BL. Inlined functions | |
36 | + can be returned. */ | |
37 | + | |
38 | +struct symbol * | |
39 | +block_function (const struct block *bl) | |
40 | +{ | |
41 | + while (BLOCK_FUNCTION (bl) == NULL && BLOCK_SUPERBLOCK (bl) != NULL) | |
42 | + bl = BLOCK_SUPERBLOCK (bl); | |
43 | + | |
44 | + return BLOCK_FUNCTION (bl); | |
45 | +} | |
46 | + | |
47 | /* Return one if BL represents an inlined function. */ | |
48 | ||
49 | int | |
50 | Index: gdb-6.8.50.20081128/gdb/block.h | |
51 | =================================================================== | |
52 | --- gdb-6.8.50.20081128.orig/gdb/block.h 2008-12-06 14:06:16.000000000 +0100 | |
53 | +++ gdb-6.8.50.20081128/gdb/block.h 2008-12-06 21:39:56.000000000 +0100 | |
54 | @@ -133,6 +133,7 @@ struct blockvector | |
55 | enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 }; | |
56 | ||
57 | extern struct symbol *block_linkage_function (const struct block *); | |
58 | +extern struct symbol *block_function (const struct block *bl); | |
59 | ||
60 | extern int block_inlined_p (const struct block *block); | |
61 | ||
62 | Index: gdb-6.8.50.20081128/gdb/blockframe.c | |
63 | =================================================================== | |
64 | --- gdb-6.8.50.20081128.orig/gdb/blockframe.c 2008-12-06 14:06:16.000000000 +0100 | |
65 | +++ gdb-6.8.50.20081128/gdb/blockframe.c 2008-12-06 21:39:56.000000000 +0100 | |
66 | @@ -143,7 +143,7 @@ find_pc_sect_function (CORE_ADDR pc, str | |
67 | struct block *b = block_for_pc_sect (pc, section); | |
68 | if (b == 0) | |
69 | return 0; | |
70 | - return block_linkage_function (b); | |
71 | + return block_function (b); | |
72 | } | |
73 | ||
74 | /* Return the function containing pc value PC. | |
75 | Index: gdb-6.8.50.20081128/gdb/breakpoint.c | |
76 | =================================================================== | |
77 | --- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-06 14:06:17.000000000 +0100 | |
78 | +++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-06 21:39:56.000000000 +0100 | |
79 | @@ -5712,7 +5712,7 @@ resolve_sal_pc (struct symtab_and_line * | |
80 | bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab); | |
81 | if (bv != NULL) | |
82 | { | |
83 | - sym = block_linkage_function (b); | |
84 | + sym = block_function (b); | |
85 | if (sym != NULL) | |
86 | { | |
87 | fixup_symbol_section (sym, sal->symtab->objfile); | |
88 | Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp | |
89 | =================================================================== | |
90 | --- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:37:27.000000000 +0100 | |
91 | +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:41:37.000000000 +0100 | |
92 | @@ -45,8 +45,10 @@ if { [skip_inline_frame_tests] } { | |
93 | ||
94 | # First, check that the things we expected to be inlined really were, | |
95 | # and those that shouldn't be weren't. | |
96 | -set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] | |
97 | -gdb_breakpoint $srcfile2:$line1 | |
98 | +# We test also inlining by the function name, otherwise we would use: | |
99 | +# set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] | |
100 | +# gdb_breakpoint $srcfile2:$line1 | |
101 | +gdb_breakpoint "bar" | |
102 | set line2 [gdb_get_line_number "set breakpoint 2 here" ${srcfile2}] | |
103 | gdb_breakpoint $srcfile2:$line2 | |
104 |