2008-07-03 11:05:26 +00:00
|
|
|
Implement `b <funcname>' for <funcname> with concete inlined instances by
|
|
|
|
a multiple-PC breakpoint.
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/ada-lang.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/ada-lang.c 2008-11-25 00:21:15.000000000 +0100
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/ada-lang.c 2008-12-06 21:39:56.000000000 +0100
|
|
|
|
@@ -4614,7 +4614,7 @@ remove_irrelevant_renamings (struct ada_
|
2008-07-03 11:05:26 +00:00
|
|
|
if (current_block == NULL)
|
|
|
|
return nsyms;
|
|
|
|
|
|
|
|
- current_function = block_linkage_function (current_block);
|
|
|
|
+ current_function = block_function (current_block);
|
|
|
|
if (current_function == NULL)
|
|
|
|
return nsyms;
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
@@ -6625,7 +6625,7 @@ ada_find_renaming_symbol (const char *na
|
2008-07-03 11:05:26 +00:00
|
|
|
static struct symbol *
|
|
|
|
find_old_style_renaming_symbol (const char *name, struct block *block)
|
|
|
|
{
|
|
|
|
- const struct symbol *function_sym = block_linkage_function (block);
|
|
|
|
+ const struct symbol *function_sym = block_function (block);
|
|
|
|
char *rename;
|
|
|
|
|
|
|
|
if (function_sym != NULL)
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/block.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/block.c 2008-12-06 14:06:16.000000000 +0100
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/block.c 2008-12-06 21:40:29.000000000 +0100
|
|
|
|
@@ -75,6 +75,19 @@ block_linkage_function (const struct blo
|
2008-07-03 11:05:26 +00:00
|
|
|
return BLOCK_FUNCTION (bl);
|
|
|
|
}
|
|
|
|
|
|
|
|
+/* Return the symbol for the function which contains a specified
|
|
|
|
+ lexical block, described by a struct block BL. Inlined functions
|
|
|
|
+ can be returned. */
|
|
|
|
+
|
|
|
|
+struct symbol *
|
|
|
|
+block_function (const struct block *bl)
|
|
|
|
+{
|
|
|
|
+ while (BLOCK_FUNCTION (bl) == NULL && BLOCK_SUPERBLOCK (bl) != NULL)
|
|
|
|
+ bl = BLOCK_SUPERBLOCK (bl);
|
|
|
|
+
|
|
|
|
+ return BLOCK_FUNCTION (bl);
|
|
|
|
+}
|
|
|
|
+
|
2008-12-14 14:05:20 +00:00
|
|
|
/* Return one if BL represents an inlined function. */
|
2008-07-03 11:05:26 +00:00
|
|
|
|
|
|
|
int
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/block.h
|
|
|
|
===================================================================
|
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/block.h 2008-12-06 14:06:16.000000000 +0100
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/block.h 2008-12-06 21:39:56.000000000 +0100
|
|
|
|
@@ -133,6 +133,7 @@ struct blockvector
|
2008-07-03 11:05:26 +00:00
|
|
|
enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 };
|
|
|
|
|
|
|
|
extern struct symbol *block_linkage_function (const struct block *);
|
|
|
|
+extern struct symbol *block_function (const struct block *bl);
|
|
|
|
|
|
|
|
extern int block_inlined_p (const struct block *block);
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/blockframe.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/blockframe.c 2008-12-06 14:06:16.000000000 +0100
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/blockframe.c 2008-12-06 21:39:56.000000000 +0100
|
|
|
|
@@ -143,7 +143,7 @@ find_pc_sect_function (CORE_ADDR pc, str
|
2008-07-03 11:05:26 +00:00
|
|
|
struct block *b = block_for_pc_sect (pc, section);
|
|
|
|
if (b == 0)
|
|
|
|
return 0;
|
|
|
|
- return block_linkage_function (b);
|
|
|
|
+ return block_function (b);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the function containing pc value PC.
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/breakpoint.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-06 14:06:17.000000000 +0100
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-06 21:39:56.000000000 +0100
|
|
|
|
@@ -5712,7 +5712,7 @@ resolve_sal_pc (struct symtab_and_line *
|
2008-07-03 11:05:26 +00:00
|
|
|
bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab);
|
|
|
|
if (bv != NULL)
|
|
|
|
{
|
|
|
|
- sym = block_linkage_function (b);
|
|
|
|
+ sym = block_function (b);
|
|
|
|
if (sym != NULL)
|
|
|
|
{
|
|
|
|
fixup_symbol_section (sym, sal->symtab->objfile);
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp
|
|
|
|
===================================================================
|
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:37:27.000000000 +0100
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:41:37.000000000 +0100
|
|
|
|
@@ -45,8 +45,10 @@ if { [skip_inline_frame_tests] } {
|
2008-07-03 11:05:26 +00:00
|
|
|
|
|
|
|
# First, check that the things we expected to be inlined really were,
|
|
|
|
# and those that shouldn't be weren't.
|
2008-12-14 14:05:20 +00:00
|
|
|
-set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
|
|
|
|
-gdb_breakpoint $srcfile2:$line1
|
2008-07-03 11:05:26 +00:00
|
|
|
+# We test also inlining by the function name, otherwise we would use:
|
2008-12-14 14:05:20 +00:00
|
|
|
+# set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
|
|
|
|
+# gdb_breakpoint $srcfile2:$line1
|
2008-07-03 11:05:26 +00:00
|
|
|
+gdb_breakpoint "bar"
|
2008-12-14 14:05:20 +00:00
|
|
|
set line2 [gdb_get_line_number "set breakpoint 2 here" ${srcfile2}]
|
|
|
|
gdb_breakpoint $srcfile2:$line2
|
2008-07-03 11:05:26 +00:00
|
|
|
|