Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gjs gjs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 104
    • Issues 104
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gjsgjs
  • Issues
  • #207
Closed
Open
Created Sep 24, 2018 by Philip Chimento@ptomato🚮Maintainer

Display current line of source code when displaying the current frame in the debugger

In the debugger, if you print the current frame you will get output in the format of:

#frame   functionName(argument, argument) at file.js:line:column

In order to help you figure out where you are in the source without having to keep the file open and cross-reference the line numbers to your editor, it would be best to show the corresponding line of source code when the frame is printed.

Being able to load the source code would also make it possible to implement a list command (see here for an explanation of GDB's equivalent.)

An example session might look something like this:

gjs -d examples/gtk.js 
GJS debugger. Type "help" for help
db> break 27
Breakpoint 1 at examples/gtk.js:27:4
db> c
Breakpoint 1, onDeleteEvent([object GObject_Object], [object GObject_Union]) at examples/gtk.js:27:4
db> f
#0    onDeleteEvent([object GObject_Object], [object GObject_Union]) at examples/gtk.js:27:4
  27     log('delete-event emitted');
db> l
  22 // are marked construct-only.
  23 window.title = 'Hello World!';
  24
  25 // This is a callback function
  26 function onDeleteEvent() {
* 27     log('delete-event emitted');
  28     // If you return false in the "delete_event" signal handler, Gtk will emit
  29     // the "destroy" signal.
  30     //
  31     // Returning true gives you a chance to pop up 'are you sure you want to
  32     // quit?' type dialogs.
Assignee
Assign to
Time tracking