Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001101 [Quercus] minor always 05-12-06 13:39 05-15-06 19:00
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.0.20 Product Version 3.0.19
  Product Build
Summary 0001101: Need debug_backtrace()
Description Quercus doesn't implement debug_backtrace(), which our code uses.
Steps To Reproduce
Additional Information This should be under Quercus -- can't seem to get Mantis to do that reliably when I file a bug.
Attached Files

- Relationships

- Notes
(0001124)
koreth
05-12-06 15:25

I decided to have a whack at implementing this; here's what I added to ErrorModule.java. This is functional enough for our code but isn't really a complete implementation.

  
  /**
   * Returns the active stack of function calls.
   */
  public static Value debug_backtrace(Env env)
    throws Exception
  {
    Value array = new ArrayValueImpl();
    Expr frame;
    int depth = 0;

    while ((frame = env.peekCall(depth++)) != null)
    {
      ArrayValue thisFunction = new ArrayValueImpl();
      Location location = frame.getLocation();
      String temp;

      if (location != null)
      {
        temp = location.getFunctionName();
        if (temp != null)
          thisFunction.put("function", temp);
        thisFunction.put("line", location.getLineNumber());
        temp = location.getFileName();
        if (temp != null)
          thisFunction.put("file", temp);
        temp = location.getClassName();
        if (temp != null)
          thisFunction.put("class", temp);
        // XXX - no way to populate "type" or "args"
      }
      else
      {
        thisFunction.put("function", "?");
        thisFunction.put("file", frame.getFunctionLocation());
        thisFunction.put("line", "");
      }

      array.put(thisFunction);
    }
    return array;
  }
 
(0001136)
ferg
05-15-06 19:00

php/180i
 

- Issue History
Date Modified Username Field Change
05-12-06 13:39 koreth New Issue
05-12-06 15:25 koreth Note Added: 0001124
05-12-06 15:37 ferg Project Resin => Quercus
05-15-06 19:00 ferg Note Added: 0001136
05-15-06 19:00 ferg Assigned To  => ferg
05-15-06 19:00 ferg Status new => closed
05-15-06 19:00 ferg Resolution open => fixed
05-15-06 19:00 ferg Fixed in Version  => 3.0.20


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker