Joseph Wenninger
Edwin Steiner
- $Id: dseg.c 6066 2006-11-27 15:29:40Z edwin $
+ $Id: dseg.c 6077 2006-11-28 22:04:29Z twisti $
*/
linenumbertable_entry *lntinline; /* special entry for inlined method */
for (; lntsize > 0; lntsize--, lntentry--) {
- /* did we reach the current line? */
-
/* Note: In case of inlining this may actually compare the pc
against a methodinfo *, yielding a non-sensical
result. This is no problem, however, as we ignore such
common case (ie. a real pc in lntentry->pc). */
if (pc >= lntentry->pc) {
- /* check for special inline entries (see
- doc/inlining_stacktrace.txt for details */
+ /* did we reach the current line? */
- if ((s4) lntentry->line < 0) {
- switch (lntentry->line) {
- case -1:
- /* begin of inlined method (ie. INLINE_END
- instruction) */
+ if ((s4) lntentry->line >= 0)
+ return (s4) lntentry->line;
- lntinline = --lntentry;/* get entry with methodinfo * */
- lntentry--; /* skip the special entry */
- lntsize -= 2;
+ /* we found a special inline entry (see
+ doc/inlining_stacktrace.txt for details */
- /* search inside the inlined method */
+ switch (lntentry->line) {
+ case -1:
+ /* begin of inlined method (ie. INLINE_END
+ instruction) */
- if (dseg_get_linenumber_from_pc_intern(pm,
- lntentry,
- lntsize,
- pc))
- {
- /* the inlined method contained the pc */
+ lntinline = --lntentry;/* get entry with methodinfo * */
+ lntentry--; /* skip the special entry */
+ lntsize -= 2;
- *pm = (methodinfo *) lntinline->pc;
+ /* search inside the inlined method */
- assert(lntinline->line <= -3);
+ if (dseg_get_linenumber_from_pc_intern(pm, lntentry, lntsize,
+ pc))
+ {
+ /* the inlined method contained the pc */
- return (-3) - lntinline->line;
- }
+ *pm = (methodinfo *) lntinline->pc;
- /* pc was not in inlined method, continue
- search. Entries inside the inlined method
- will be skipped because their lntentry->pc
- is higher than pc. */
- break;
+ assert(lntinline->line <= -3);
- case -2:
- /* end of inlined method */
+ return (-3) - lntinline->line;
+ }
- return 0;
+ /* pc was not in inlined method, continue search.
+ Entries inside the inlined method will be skipped
+ because their lntentry->pc is higher than pc. */
+ break;
- /* default: is only reached for an -3-line entry
- after a skipped -2 entry. We can safely ignore
- it and continue searching. */
- }
- }
- else {
- /* found a normal entry */
+ case -2:
+ /* end of inlined method */
- return (s4) lntentry->line;
+ return 0;
+
+ /* default: is only reached for an -3-line entry after
+ a skipped -2 entry. We can safely ignore it and
+ continue searching. */
}
}
}