Code of Call Stack

37 views
Skip to first unread message

Tajkia Rahman Toma

unread,
Jan 19, 2014, 11:34:17 PM1/19/14
to fir...@googlegroups.com
I need to customize the call stack part of Script panel for my work. Is it possible to have a call stack without debugging mode? And also where can i find the codes related to stack side panel?

Thanks in advance.




Tajkia Rahman Toma
IIT, DU

Jan Honza Odvarko

unread,
Jan 20, 2014, 2:53:03 AM1/20/14
to fir...@googlegroups.com
On Monday, January 20, 2014 5:34:17 AM UTC+1, Tajkia Rahman Toma wrote:
I need to customize the call stack part of Script panel for my work. Is it possible to have a call stack without debugging mode?
The callstack panel is wired with the debugger, so customization that wants to use the callstack while the debugger is not paused doesn't have to be straightforward.

 
And also where can i find the codes related to stack side panel?
The current version (released on AMO) has the callstack implementation here:
https://github.com/firebug/firebug/blob/firebug1.12/extension/content/firebug/js/callstack.js

The new version we are currently working on is here:
https://github.com/firebug/firebug/tree/jsd2/extension/content/firebug/debugger/stack
(the new version supports JSD2 and needs several months of work to be released)

---

What do you want to customize?
Can we help you somehow, e.g. by offering some new APIs?

Honza

Tajkia Rahman Toma

unread,
Jan 20, 2014, 9:23:17 PM1/20/14
to fir...@googlegroups.com

What do you want to customize?
I am trying to track all the UI events and log which functions (and line number of the function in the file) are executed.
Suppose a button's click event is registered to the function click:

function click(){
  doit();
  doit2()
}
function doit(){
  doit3()
}




when the button is clicked I want to log
------
click
  doit
    doit3
  doit2
------
or at least:

------
click
doit
doit3
doit2

------
 
Can we help you somehow, e.g. by offering some new APIs?


Yes of course. :)

Jan Honza Odvarko

unread,
Jan 21, 2014, 3:56:19 AM1/21/14
to fir...@googlegroups.com

On Tuesday, January 21, 2014 3:23:17 AM UTC+1, Tajkia Rahman Toma wrote:

What do you want to customize?
I am trying to track all the UI events and log which functions (and line number of the function in the file) are executed.
Suppose a button's click event is registered to the function click:
I see, a function call tracer.

1) I believe you should use JSD2 (debugging engine) since this is the future

2) You probably want to implement your own panel (or UI), taking inspiration from e.g. the Callstack panel

3) You should also look at JSD2 based profiler, which tracks function call execution and does pretty much the same as you want. In addition you need to remember the hierarchy of calls.
Docs: https://getfirebug.com/wiki/index.php/Profiler

The GIT branch we use for JSD1 -> JSD2 Firebug transition is here:
https://github.com/firebug/firebug/tree/jsd2

You are interested in these modules:
https://github.com/firebug/firebug/tree/jsd2
https://github.com/firebug/firebug/blob/jsd2/extension/content/firebug/console/profilerEngine.js
This is the code you need the most

* https://github.com/firebug/firebug/blob/jsd2/extension/content/firebug/console/commands/profiler.js
This module implements the Command Line command and related UI logged into the Console panel. You can get some inspiration how the UI is done.

4) We are always happy to include some new API in Firebug core to help you (or other similar extensions) to be created, but you need to tell what exactly you need.

Honza


Reply all
Reply to author
Forward
0 new messages