aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2024-10-28 22:32:29 +0000
committerMark Harmstone <mark@harmstone.com>2024-11-30 14:53:41 +0000
commit4ed189854eae2d243557c9405f654bd9a16dadaa (patch)
tree866eee3bd388cc2da4fd46416116043390551a0b /gcc
parent214985f6b35ea8038c4e96590b435aaef2919769 (diff)
downloadgcc-4ed189854eae2d243557c9405f654bd9a16dadaa.zip
gcc-4ed189854eae2d243557c9405f654bd9a16dadaa.tar.gz
gcc-4ed189854eae2d243557c9405f654bd9a16dadaa.tar.bz2
Add block parameter to begin_block debug hook
Add a parameter to the begin_block debug hook that is a pointer to the tree_node of the block in question. CodeView needs this as it records line numbers of inlined functions in a different manner, so we need to be able to tell if the block is actually the start of an inlined function. gcc/ * debug.cc (do_nothing_debug_hooks): Change begin_block function pointer. (debug_nothing_int_int_tree): New function. * debug.h (struct gcc_debug_hooks): Add tree parameter to begin_block. (debug_nothing_int_int_tree): Add declaration. * dwarf2out.cc (dwarf2out_begin_block): Add tree parameter. (dwarf2_lineno_debug_hooks): Use new dummy function for begin_block. * final.cc (final_scan_insn_1): Pass insn block through to debug_hooks->begin_block. * vmsdbgout.cc (vmsdbgout_begin_block): Add tree parameter.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/debug.cc9
-rw-r--r--gcc/debug.h3
-rw-r--r--gcc/dwarf2out.cc7
-rw-r--r--gcc/final.cc2
-rw-r--r--gcc/vmsdbgout.cc5
5 files changed, 18 insertions, 8 deletions
diff --git a/gcc/debug.cc b/gcc/debug.cc
index 81f6683..65725de 100644
--- a/gcc/debug.cc
+++ b/gcc/debug.cc
@@ -32,7 +32,7 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int,
- debug_nothing_int_int, /* begin_block */
+ debug_nothing_int_int_tree, /* begin_block */
debug_nothing_int_int, /* end_block */
debug_true_const_tree, /* ignore_block */
debug_nothing_int_int_charstar_int_bool, /* source_line */
@@ -147,6 +147,13 @@ debug_nothing_int_int (unsigned int line ATTRIBUTE_UNUSED,
}
void
+debug_nothing_int_int_tree (unsigned int line ATTRIBUTE_UNUSED,
+ unsigned int n ATTRIBUTE_UNUSED,
+ tree block ATTRIBUTE_UNUSED)
+{
+}
+
+void
debug_nothing_tree_int (tree decl ATTRIBUTE_UNUSED,
int local ATTRIBUTE_UNUSED)
{
diff --git a/gcc/debug.h b/gcc/debug.h
index 1d6642a..7d35d7d 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -57,7 +57,7 @@ struct gcc_debug_hooks
/* Record the beginning of block N, counting from 1 and not
including the function-scope block, at LINE. */
- void (* begin_block) (unsigned int line, unsigned int n);
+ void (* begin_block) (unsigned int line, unsigned int n, tree block);
/* Record the end of a block. Arguments as for begin_block. */
void (* end_block) (unsigned int line, unsigned int n);
@@ -223,6 +223,7 @@ extern void debug_nothing_int_int_charstar_int_bool (unsigned int,
int, bool);
extern void debug_nothing_int (unsigned int);
extern void debug_nothing_int_int (unsigned int, unsigned int);
+extern void debug_nothing_int_int_tree (unsigned int, unsigned int, tree);
extern void debug_nothing_tree (tree);
extern void debug_nothing_tree_tree (tree, tree);
extern void debug_nothing_tree_int (tree, int);
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 0eb3390..a4957cf 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -2865,7 +2865,7 @@ static void dwarf2out_undef (unsigned int, const char *);
static void dwarf2out_start_source_file (unsigned, const char *);
static void dwarf2out_end_source_file (unsigned);
static void dwarf2out_function_decl (tree);
-static void dwarf2out_begin_block (unsigned, unsigned);
+static void dwarf2out_begin_block (unsigned, unsigned, tree);
static void dwarf2out_end_block (unsigned, unsigned);
static bool dwarf2out_ignore_block (const_tree);
static void dwarf2out_set_ignored_loc (unsigned, unsigned, const char *);
@@ -2950,7 +2950,7 @@ const struct gcc_debug_hooks dwarf2_lineno_debug_hooks =
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int,
- debug_nothing_int_int, /* begin_block */
+ debug_nothing_int_int_tree, /* begin_block */
debug_nothing_int_int, /* end_block */
debug_true_const_tree, /* ignore_block */
dwarf2out_source_line, /* source_line */
@@ -27805,7 +27805,8 @@ dwarf2out_function_decl (tree decl)
static void
dwarf2out_begin_block (unsigned int line ATTRIBUTE_UNUSED,
- unsigned int blocknum)
+ unsigned int blocknum,
+ tree block ATTRIBUTE_UNUSED)
{
switch_to_section (current_function_section ());
ASM_OUTPUT_DEBUG_LABEL (asm_out_file, BLOCK_BEGIN_LABEL, blocknum);
diff --git a/gcc/final.cc b/gcc/final.cc
index 5d91158..ea08c49 100644
--- a/gcc/final.cc
+++ b/gcc/final.cc
@@ -2299,7 +2299,7 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
/* Output debugging info about the symbol-block beginning. */
if (!DECL_IGNORED_P (current_function_decl))
- debug_hooks->begin_block (last_linenum, n);
+ debug_hooks->begin_block (last_linenum, n, NOTE_BLOCK (insn));
/* Mark this block as output. */
TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
diff --git a/gcc/vmsdbgout.cc b/gcc/vmsdbgout.cc
index f5d0d84..d9e6a8b 100644
--- a/gcc/vmsdbgout.cc
+++ b/gcc/vmsdbgout.cc
@@ -154,7 +154,7 @@ static void vmsdbgout_define (unsigned int, const char *);
static void vmsdbgout_undef (unsigned int, const char *);
static void vmsdbgout_start_source_file (unsigned int, const char *);
static void vmsdbgout_end_source_file (unsigned int);
-static void vmsdbgout_begin_block (unsigned int, unsigned int);
+static void vmsdbgout_begin_block (unsigned int, unsigned int, tree);
static void vmsdbgout_end_block (unsigned int, unsigned int);
static bool vmsdbgout_ignore_block (const_tree);
static void vmsdbgout_source_line (unsigned int, unsigned int, const char *,
@@ -1230,7 +1230,8 @@ vmsdbgout_end_epilogue (unsigned int line, const char *file)
a lexical block. */
static void
-vmsdbgout_begin_block (unsigned line, unsigned blocknum)
+vmsdbgout_begin_block (unsigned line, unsigned blocknum,
+ tree block ATTRIBUTE_UNUSED)
{
if (write_symbols == VMS_AND_DWARF2_DEBUG)
(*dwarf2_debug_hooks.begin_block) (line, blocknum);