aboutsummaryrefslogtreecommitdiff
path: root/gdb/mep-tdep.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2007-07-14 00:15:50 +0000
committerKevin Buettner <kevinb@redhat.com>2007-07-14 00:15:50 +0000
commitf219aedc69cffe0b3ef3d455d7c2f4ed6c141d8d (patch)
tree26c4443b5dd874d2f074982ffb3b62a7bb9b6b78 /gdb/mep-tdep.c
parentc1449908117c51031590e25c2a540ddd81fc9188 (diff)
downloadbinutils-f219aedc69cffe0b3ef3d455d7c2f4ed6c141d8d.zip
binutils-f219aedc69cffe0b3ef3d455d7c2f4ed6c141d8d.tar.gz
binutils-f219aedc69cffe0b3ef3d455d7c2f4ed6c141d8d.tar.bz2
* mep-tdep.c (mep_analyze_prologue): Update comment for BRA
instruction case.
Diffstat (limited to 'gdb/mep-tdep.c')
-rw-r--r--gdb/mep-tdep.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 5d60437..01baab3 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -1812,13 +1812,24 @@ mep_analyze_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc,
}
else if (IS_BRA (insn) && BRA_DISP (insn) > 0)
{
- /* When a loop appears as the first statement as a function
+ /* When a loop appears as the first statement of a function
body, gcc 4.x will use a BRA instruction to branch to the
loop condition checking code. This BRA instruction is
marked as part of the prologue. We therefore set next_pc
to this branch target and also stop the prologue scan.
The instructions at and beyond the branch target should
- no longer be associated with the prologue. */
+ no longer be associated with the prologue.
+
+ Note that we only consider forward branches here. We
+ presume that a forward branch is being used to skip over
+ a loop body.
+
+ A backwards branch is covered by the default case below.
+ If we were to encounter a backwards branch, that would
+ most likely mean that we've scanned through a loop body.
+ We definitely want to stop the prologue scan when this
+ happens and that is precisely what is done by the default
+ case below. */
next_pc = pc + BRA_DISP (insn);
after_last_frame_setup_insn = next_pc;
break;