-static bool stacktrace_add_method(stacktracebuffer *stb, methodinfo *m, u1 *pv,
- u1 *pc)
-{
- ptrint lntsize; /* size of line number table */
- u1 *lntstart; /* start of line number table */
- linenumbertable_entry *lntentry; /* points to last entry in the table */
-
- /* get size of line number table */
-
- lntsize = *((ptrint *) (pv + LineNumberTableSize));
- lntstart = *((u1 **) (pv + LineNumberTableStart));
-
- /* Subtract the size of the line number entry of the structure,
- since the line number table start points to the pc. */
-
- lntentry = (linenumbertable_entry *) (lntstart - SIZEOF_VOID_P);
-
- /* Find the line number for the specified PC (going backwards
- in the linenumber table). The linenumber table size is zero
- in native stubs. */
-
- for (; lntsize > 0; lntsize--, lntentry--) {
- /* did we reach the current line? */
-
- if (pc >= lntentry->pc) {
- /* check for special inline entries */
-
- switch (lntentry->line) {
-#if 0
- /* XXX TWISTI we have to think about this inline stuff again */
-
- case -1: /* begin of inlined method */
- lntinline = (lineNumberTableEntryInlineBegin *) (--lntentry);
- lntentry++;
- lntsize--; lntsize--;
- if (stacktrace_fillInStackTrace_methodRecursive(buffer,
- ilStart->method,
- ent,
- &ent,
- &ahead,
- pc)) {
- stacktrace_add_entry(buffer, m, ilStart->lineNrOuter);
-
- return true;
- }
- break;
-
- case -2: /* end of inlined method */
- *entry = ent;
- *entriesAhead = ahead;
- return false;
- break;
-#endif