Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add debug layer #9246

Closed
wants to merge 2 commits into from
Closed

Conversation

CeleritasCelery
Copy link
Contributor

@CeleritasCelery CeleritasCelery commented Jul 18, 2017

@sukeyisme originally created this layer with #8799. However his implementation only supported the c-c++ layer, so @syl20bnr merged it into that layer instead of creating a new one. I have since refactored the code so that this functionality can be added to any language. I updated the c-c++ layer to use the new method for adding debuggers and also added support for perl5.

This should be its own layer since realgud supports many languages.

I have added a method called spacemacs/add-realgud-debugger that can be called from any language layer to add support for their respective debuggers. If language layer maintainers want to add debugger support they can use this call in a post-init-realgud function.

@delaanthonio
Copy link
Contributor

@CeleritasCelery I refactored the c-c++ layer in commit 8e3a59d. I would appreciate it if you could rebase your changes on the current development branch.

@CeleritasCelery
Copy link
Contributor Author

@JAremko I remerged this commit and now the travis build is failing because of documentation issues (missing features with a colon). Am I honestly expected to go and fix everyone's documentation issues in order for my commit to be valid?

@JAremko
Copy link
Collaborator

JAremko commented Aug 6, 2017

@CeleritasCelery Not expected but it would be nice of you 😉
In this case it looks like only layers/+lang/perl5/README.org needs fixing.


But you can ignore it. I'll make this part of the test disabled until we sort out #9346

@CeleritasCelery
Copy link
Contributor Author

Thanks @JAremko. However it looks like a lot more then just one file needs to be fixed. I fixed the issue in the perl5 README as you suggested and now it is complaining about CONTRIBUTING.org's indentation. Before it was complaining about the bibtex layer. I don't feel that making all the required documentation fixes is in the scope of this PR. I feel that disabling these checks until develop is clean is the best course of action.

On another note, is there anyway this could get merged (or at very least reviewed) @JAremko? As you can see from the number of 👍 this layers has generated a lot of interest and would be huge addition to Spacemacs. All the Travis build were passing before I remerged.

@JAremko
Copy link
Collaborator

JAremko commented Aug 6, 2017

@CeleritasCelery I made the FORMATTING test optional. Just rebase your PR 👍

@CeleritasCelery
Copy link
Contributor Author

Thanks @JAremko! looks like it is good again.

@syl20bnr syl20bnr self-assigned this Aug 6, 2017
"q" 'realgud:cmd-quit
"S" 'realgud-window-cmd-undisturb-src))))
(defun c-c++/pre-init-realgud()
(dolist (mode '(c-mode c++-mode))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace the '(c-mode c++-mode) with c-c++-modes.

@JAremko
Copy link
Collaborator

JAremko commented Aug 21, 2017

@CeleritasCelery ci/circleci is optional 😉

@CeleritasCelery
Copy link
Contributor Author

@JAremko How do I disable it?

@JAremko
Copy link
Collaborator

JAremko commented Aug 21, 2017

@CeleritasCelery you can simply ignore it or add [ci skip] to the commit message

@mfulz
Copy link

mfulz commented Aug 23, 2017

Would be really great, if that could be merged. My PR is nearly a year old and it looks like the realgud stuff is even better

@CeleritasCelery
Copy link
Contributor Author

@syl20bnr self assigned this, so imagine he will make it a priority when he gets back to Spacemacs.

@CeleritasCelery CeleritasCelery force-pushed the debug-layer branch 2 times, most recently from 7479f11 to c84ea8d Compare October 2, 2017 16:32
@CeleritasCelery
Copy link
Contributor Author

CeleritasCelery commented Oct 16, 2017

@syl20bnr @JAremko could we get a merge or a review this? This would be a great feature for the next release, especially as other language layers add support. It has generated a lot of interest.

@robbert-vdh
Copy link
Contributor

Any update on merging this? Being able to use a single debugger for every language would be a huge plus.

@CeleritasCelery
Copy link
Contributor Author

I think I may have to open a new PR. This one seems to have fallen into the massive heap of forgotten Pull requests. The maintainers only look at the first few.

@JAremko
Copy link
Collaborator

JAremko commented Nov 25, 2017

@CeleritasCelery I think @syl20bnr is busy with the new release. He self assigned to this PR so it should be merged. Eventually 😉

@yssource
Copy link
Contributor

Any update on merging this?

@dvzubarev dvzubarev mentioned this pull request Jan 27, 2018
@myrgy
Copy link
Contributor

myrgy commented Jan 27, 2018

What about adding one extra folder.
'+debug/realgud'. I'd like to add gdm-mi layer as well.

@myrgy
Copy link
Contributor

myrgy commented Jan 29, 2018

Nice hint from this PR: #7355 - make debugger transient state

@dvzubarev
Copy link
Contributor

I created recenty transient state for realgud. It may be useful for this PR.

@CeleritasCelery
Copy link
Contributor Author

I am going to leave this PR open but I am also going to create a new repo which has the debug layer. There has been a lot of interest in this and many user requests but no action has been taken in Spacemacs. If we make the layer it own repo, users can install and use that until/if this gets merged.

@dvzubarev What does a transient state add that the shortkey state doesn't?

@dvzubarev
Copy link
Contributor

It is not convenient for me to use shortkey state. It overwrites some evil bindings that I used to use in the source code buffer, e.g. e, s. Also it has unusual keys: s for -next, i for -step, o for finish, instead of n, s, f.

@CeleritasCelery
Copy link
Contributor Author

Also it has unusual keys

Those are the keybinding mnemonics that Spacemacs uses.

What keybinding do you use to activate your transient state? I do like the idea of having the transient state help text.

@dvzubarev
Copy link
Contributor

I use these keybindings:

(spacemacs/set-leader-keys-for-major-mode mode
      "d." 'spacemacs/realgud-transient-state/body
      "de" 'my/realgud-eval-dwim
      "dJ" 'realgud:cmd-jump)

@dvzubarev
Copy link
Contributor

Actually, I think it is better to run this transient state automatically when entering new source buffer. It can be achived via this code:

(add-hook 'realgud-short-key-mode-hook 'spacemacs/realgud-transient-state/body)

@CeleritasCelery
Copy link
Contributor Author

alright, I created an independent repo here for people who want to use realgud. @dvzubarev, if you want to submit a pull request with your transient state I will test it out and add it. I honestly like that idea better.
@yssource @robbert-vdh

@MaskRay
Copy link
Contributor

MaskRay commented Feb 10, 2018

Regarding (evilified-state-evilify-map realgud:shortkey-mode-map

Do you have some idea to set up keys for evaluating variables around the point? Something like avy-jump will be great.

I currently use my clumsy 1 to 9
https://github.com/MaskRay/Config/blob/master/home/.emacs.d/private/%2Bmy/my-code/packages.el#L248

@ajholyoake
Copy link

@CeleritasCelery any idea of the status of this PR?

I came here by way of this stack exchange question, which details how to set this up for python. (For users searching how to do this)

https://emacs.stackexchange.com/a/34371/19276

@CeleritasCelery
Copy link
Contributor Author

It is up to @syl20bnr to merge new layers, so not much can be till then. In the meantime I moved the code to its own repo that people can use until it is merged.
https://github.com/CeleritasCelery/debug-layer

@syl20bnr
Copy link
Owner

Thank you ! 💜 Sorry for late merging, I changed my setup to be more reactive to mentions, so hopefully it will get better from now on :-)

I made formatting changes in commits 5cdc1ed05 and 0a32d339f

Cherry-picked into develop branch, you can safely delete your branch.

@syl20bnr syl20bnr closed this May 13, 2018
@CeleritasCelery CeleritasCelery deleted the debug-layer branch May 14, 2018 15:47
@ajholyoake
Copy link

ajholyoake commented May 15, 2018

@CeleritasCelery,
I'm having trouble getting the keybindings to work and setting breakpoints.

I've added the following to the packages.el in the python layer

(defun python/pre-init-realgud()
(dolist (mode '(anaconda-mode)) 
(spacemacs|add-realgud-debugger mode "trepan2")))

And tried adding both (separately)
(debug :variables debug-additional-debuggers '("trepan2"))
and
debug to my .spacemacs.

trepan2 seems to be registered when I do M-x realgud:trepan2 (and will execute as it should), however SPC-m-d-d doesn't seem to be firing as it should do. As far as I can see the add-realgud-debugger mode should do this.

I'm fairly new to emacs, so am at a bit of a loss as to how to debug this - have I missed anything?

FYI, there's a PR open on your other repo for transient state keybindings.

@CeleritasCelery
Copy link
Contributor Author

Adding it to debug-additional-debuggers does not establish a key binding because it doesn’t know what major mode. Also IIRC, anaconda-mode is a minor mode not a major mode.

If you want to add trepan2 to python use this

(defun python/post-init-realgud ()
    (spacemacs/add-realgud-debugger ‘python-mode “trepan2”))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.