aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2009-06-17 23:54:40 +0000
committerCary Coutant <ccoutant@gcc.gnu.org>2009-06-17 16:54:40 -0700
commited5ef2e4085ebc1bf6be8f1667365cd328aae0e3 (patch)
treef03a2d8d3edb0a313d09132edfa2cdab7229e22b /gcc/final.c
parentb0f43ca013f71384e43d32bf4062df250528627f (diff)
downloadgcc-ed5ef2e4085ebc1bf6be8f1667365cd328aae0e3.zip
gcc-ed5ef2e4085ebc1bf6be8f1667365cd328aae0e3.tar.gz
gcc-ed5ef2e4085ebc1bf6be8f1667365cd328aae0e3.tar.bz2
dbxout.c (dbxout_source_line): Add is_stmt parameter.
* dbxout.c (dbxout_source_line): Add is_stmt parameter. Change caller. * debug.c (struct gcc_debug_hooks): Change placeholder for source_line hook. (debug_nothing_int_charstar_int): Replaced by... (debug_nothing_int_charstar_int_bool): ...this. * debug.h (struct gcc_debug_hooks): Add is_stmt parameter to source_line prototype. (debug_nothing_int_charstar_int): Replaced by... (debug_nothing_int_charstar_int_bool): ...this. * defaults.h (SUPPORTS_DISCRIMINATOR): New constant. * dwarf2out.c (dwarf2out_source_line): Add is_stmt parameter. Output is_stmt operand when necessary. * final.c (last_is_stmt): New variable. (final_start_function): Initialize last_is_stmt. (final_scan_insn): Pass is_stmt to source_line debug hook. (notice_source_line): Add is_stmt parameter. * sdbout.c (sdbout_source_line): Add is_stmt parameter. * vmsdbgout.c (vmsdbgout_source_line): Add is_stmt parameter. Change callers. * xcoffout.c (xcoffout_source_line): Add is_stmt parameter. * xcoffout.h (xcoffout_source_line): Add is_stmt parameter. From-SVN: r148635
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/gcc/final.c b/gcc/final.c
index b113bc9..3de7281 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -213,7 +213,7 @@ static int asm_insn_count (rtx);
#endif
static void profile_function (FILE *);
static void profile_after_prologue (FILE *);
-static bool notice_source_line (rtx);
+static bool notice_source_line (rtx, bool *);
static rtx walk_alter_subreg (rtx *, bool *);
static void output_asm_name (void);
static void output_alternate_entry_point (FILE *, rtx);
@@ -2089,6 +2089,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
rtx body = PATTERN (insn);
int insn_code_number;
const char *templ;
+ bool is_stmt;
#ifdef HAVE_conditional_execution
/* Reset this early so it is correct for ASM statements. */
@@ -2190,11 +2191,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
}
/* Output this line note if it is the first or the last line
note in a row. */
- if (notice_source_line (insn))
+ if (notice_source_line (insn, &is_stmt))
{
(*debug_hooks->source_line) (last_linenum,
last_filename,
- last_discriminator);
+ last_discriminator,
+ is_stmt);
}
if (GET_CODE (body) == ASM_INPUT)
@@ -2698,10 +2700,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
return NEXT_INSN (insn);
}
-/* Return whether a source line note needs to be emitted before INSN. */
+/* Return whether a source line note needs to be emitted before INSN.
+ Sets IS_STMT to TRUE if the line should be marked as a possible
+ breakpoint location. */
static bool
-notice_source_line (rtx insn)
+notice_source_line (rtx insn, bool *is_stmt)
{
const char *filename;
int linenum;
@@ -2717,20 +2721,33 @@ notice_source_line (rtx insn)
linenum = insn_line (insn);
}
- if (filename
- && (force_source_line
- || filename != last_filename
- || last_linenum != linenum
- || last_discriminator != discriminator))
+ if (filename == NULL)
+ return false;
+
+ if (force_source_line
+ || filename != last_filename
+ || last_linenum != linenum)
{
force_source_line = false;
last_filename = filename;
last_linenum = linenum;
last_discriminator = discriminator;
+ *is_stmt = true;
high_block_linenum = MAX (last_linenum, high_block_linenum);
high_function_linenum = MAX (last_linenum, high_function_linenum);
return true;
}
+
+ if (SUPPORTS_DISCRIMINATOR && last_discriminator != discriminator)
+ {
+ /* If the discriminator changed, but the line number did not,
+ output the line table entry with is_stmt false so the
+ debugger does not treat this as a breakpoint location. */
+ last_discriminator = discriminator;
+ *is_stmt = false;
+ return true;
+ }
+
return false;
}