Last Comment Bug 733783 - GCLI needs commands to support breakpoint stepping
: GCLI needs commands to support breakpoint stepping
Status: RESOLVED FIXED
[gclicommands]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Console (show other bugs)
: unspecified
: All All
: P2 normal (vote)
: Firefox 16
Assigned To: Victor Porof [:vporof][:vp]
:
Mentors:
Depends on: 773313
Blocks: 774603 GCLICMD
  Show dependency treegraph
 
Reported: 2012-03-07 08:21 PST by Joe Walker [:jwalker] (needinfo me or ping on irc)
Modified: 2012-07-17 02:30 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (5.96 KB, patch)
2012-06-26 04:22 PDT, Victor Porof [:vporof][:vp]
no flags Details | Diff | Review
Patch with working test (12.15 KB, patch)
2012-07-13 10:25 PDT, Michael Ratcliffe [:miker] [:mratcliffe]
past: review+
Details | Diff | Review
Addressed reviewers comments (12.19 KB, patch)
2012-07-14 02:39 PDT, Michael Ratcliffe [:miker] [:mratcliffe]
no flags Details | Diff | Review

Description Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-03-07 08:21:05 PST
See notes on bug 683503.
Comment 1 Panos Astithas [:past] 2012-03-07 08:28:54 PST
Something to consider is emulating the relevant commands for GDB:

http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gnat_ugn_unw/Introduction-to-GDB-Commands.html

We could also consider expanding the scope of the GDB emulation to add command aliases for all GDB commands supported by our debugger.
Comment 2 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-04-29 11:25:31 PDT
GCLI Triage.
Comment 3 Victor Porof [:vporof][:vp] 2012-06-26 04:22:38 PDT
Created attachment 636656 [details] [diff] [review]
v1

We'll need new strings for stepping because I took them from somewhere.
Comment 4 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-06-27 06:38:25 PDT
Comment on attachment 636656 [details] [diff] [review]
v1

Review of attachment 636656 [details] [diff] [review]:
-----------------------------------------------------------------

I do think we need to add some tests for these commands. We've skipped it in the past and got bitten.
It's not hard, because there is a framework to help.

Examples:
- browser/devtools/commandline/test/browser_gcli_commands.js
- browser/devtools/commandline/test/browser_gcli_edit.js

There is even documentation (which I should perhaps move to MDN):
- browser/devtools/commandline/test/head.js
  See the doc comments for DeveloperToolbarTest.checkInputStatus()
  and DeveloperToolbarTest.exec()

Thanks.
Comment 5 Michael Ratcliffe [:miker] [:mratcliffe] 2012-07-13 05:50:41 PDT
Unfortunately I need to add a breakpoint and this process is async ... so blocked by bug 773313
Comment 6 Michael Ratcliffe [:miker] [:mratcliffe] 2012-07-13 10:25:36 PDT
Created attachment 641947 [details] [diff] [review]
Patch with working test

Works now so we should be fine to land depending on review.
Comment 7 Panos Astithas [:past] 2012-07-13 10:45:13 PDT
Comment on attachment 641947 [details] [diff] [review]
Patch with working test

Review of attachment 641947 [details] [diff] [review]:
-----------------------------------------------------------------

The only issue I found was a window leak I got when I ran the test. I believe using the registerCleanupFunction idea from the debugger mochitests would fix it.

::: browser/devtools/commandline/test/resources_dbg.html
@@ +27,5 @@
> +    function stepOverMe() {
> +      output.value = "step over";
> +    }
> +
> +    function checkTestPaused() {

Nit: this function looks unused.
Comment 8 Michael Ratcliffe [:miker] [:mratcliffe] 2012-07-14 02:39:31 PDT
Created attachment 642199 [details] [diff] [review]
Addressed reviewers comments

http://tbpl.mozilla.org/?tree=Try&rev=9fb63e1299fc
Comment 9 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-07-14 15:19:31 PDT
https://tbpl.mozilla.org/?tree=Fx-Team&rev=6e2e2f904237
Comment 10 Ed Morley [:emorley] 2012-07-16 05:27:01 PDT
https://hg.mozilla.org/mozilla-central/rev/aaaa345f52bd
Comment 11 Francesco Lodolo [:flod] - OFFLINE Jun 26-Jul 3 2012-07-17 02:15:37 PDT
Commented in the wrong bug this morning.

> The skipped statements are executed, but not stepped through
Could you explain the meaning of this string?

Side note: copy&paste of l10n comments (clearly wrong, e.g. "A very short string used to describe thefunction of the dbg step over command.") is kind of worse than having no comments at all.
Comment 12 Michael Ratcliffe [:miker] [:mratcliffe] 2012-07-17 02:30:36 PDT
> > The skipped statements are executed, but not stepped through
> Could you explain the meaning of this string?

I can give it a shot ... it is easier to understand when compared with Step In.

Step In and Step Over differ in only one respect, the way they handle function calls. Either command instructs the debugger to execute the next line of code. If the line contains a function call, Step Into executes only the call itself, then halts at the first line of code inside the function. Step Over executes the entire function, then halts at the first line outside the function. Use Step Into if you want to look inside the function call. Use Step Over if you want to avoid stepping into functions.

Bug 774603 has been created so that we can fix any errors in gclicommands.properties, please log any other issues in that bug.

Note You need to log in before you can comment on or make changes to this bug.