gud-gdb emacs 24 not working - emacs

I'm having difficulties with gdb under emacs 24.
I compiled my c code with the -g switch, and the symbol table loads in gdb.
The problem I'm having is that no source code is shown when I load my application, no breakpoints are visible. I guess there appears to be no connection between the source code buffer and gdb buffer.
I have used gdb under emacs before (emacs 22, and 23) and it worked well and now it doesn't.
I also tried it under emacs -q so no plugins are loaded in case my .emacs was at fault, no joy.
Just to recap (so I don't get "compile with -g" answers):
I compiled with -g I loaded emacs with no plugins
I used annotate=3with gud-gdb
I even tried gdb-mi (doesn't work at all, didn't pursue
this road any further)
Gdb ain't working with source code showing (with breakpoints).
What can I do to fix it, or at least how can I find out what's wrong?

M-x gud-gdb is not for use with annotate=3 but with --fullname (aka --annotate=1, IIRC).

Try M-x gdb with -i=mi instead of --annotate=3.
Then it worked for me, but it's damn slow in my case :/

When did you build Emacs 24? There's been a lot of churn in the gdb/gud area from emacs-devel. If you repro problems in the latest (i.e. today's) build, report bugs ASAP. The pretest is coming to an end very soon.

Related

adding a hook to minibuffer-setup-hook breaks key-bindings

i have a few keys that i prefer to force-bind to keys i'm familiar with, and so i have used this SO Solution .
but i have found recently that it breaks for me.
the circumstances: it works fine when running 24.2.1 in window mode as build 2012-08-27 on bob.parkland.org (i.e. the pre-build emacs-for-mac solution found at http://emacsformacosx.com/).
but then it will not work when run in terminal on lion, which is 22.1.1 (mac-apple-darwin) of 2012-01-12 on b1006.apple.com .
if i comment out the call to add the hook, it works fine.
the problem is partly that i byte-compiled the code found at the other link above into a separate loadable .elc file … and did so with the newer version of emacs.
when i go back to the 22.1.1 version of emacs and byte-compile it with that version, it works in both versions of emacs without problems.

Using gdb -i=mi integration in emacs 24

I'm checking out a segfault in one of our apps. A short time after starting the app, the main gdb status bar changes to:
(Debugger:run [signal-received])
A (gdb) prompt appears but the contents of all other windows remain unchanged (empty). Typing anything at the prompt does nothing - gdb appears to be hanging. Running the same steps on the command line results in the expected output from gdb with a complete and correct backtrace.
This is my first time debugging with the -i=mi integration between emacs and gdb. I'm using emacs 24.2 and gdb 7.5.
Are there any suggestions on how I can debug this further?
Is it possible to reduce the level of integration? Would that allow me to determine which area is causing the problem?
A final point is that the initial loading of the app takes around 70s compared with around 3s from the command line.
Load time can be reduced by setting gdb-create-source-file-list to nil (use customize). See the documentation for what this does and why it substantially increases load times in some instances.
You can use M-x gud-gdb to use the old gud mode (i.e. without the mi interaction). Less fancy but more reliable.
It appears that gdb-ui from emacs 23 will still work in emacs 24:
Find a copy of gdb-ui (In my case gdb-ui.el.gz and gdb-ui.elc from a backup)
Place these into a directory (I have added ~/emacs-modes)
Then add the following to your .emacs:
(add-to-list 'load-path "~/emacs-modes")
(require 'gdb-ui)
Running gdb will now use the old --annotate=3 mode rather than -i=mi.

org mode refile error

Since some time (but I didn't change anything in .emacs), I have some errors with emacs's behaviour :
Remember mode will not kill the temporary buffer on "Ctl-C Ctl-C"
Orgmode will not refile any entry
Both operations complain with error "Not bookmark format"
I restored an old .emacs to make sure that I didn't mess it up but the error persists.
Where can I investigate to find out the problem ?
I have Emacs 24.2.1 since end of august.
The built in orgmode version is 7.8.11 (I see 7.9.2 is out ...)
It's always best to start debugging problems such as this by seeing if the problem still happens when you ignore your init file altogether - try starting emacs with --no-init-file and seeing if you still get the problem. If you don't then it's clearly something in your init file.
You can also get odd behaviour if you've got a local install of Org-mode in addition to the one bundled with Emacs itself - eg if you pull in a newer one through ELPA. If you have a local install through ELPA then you can try uninstalling the Org-mode package and trying again using the built-in Org-mode.
I have something similar to the following in my init file to make it switch to the ELPA-installed Org-mode to avoid such problems (this variant is untested so forgive me if it's not quite right):
(package-initialize) ; load and initialise ELPA-installed packages
(org-reload) ; restart Org-mode with the ELPA package
I filed a bug to the emacs team and they found out that the error comes from a corrupted bookmark file.
I removed my ~/.emacs.d/bookmark file (it was empty) and everything is fine now.

nXhtml is not highlighting PHP code, gives errors on loading

I'm using the latest nXhtml checked out from the repo, and using GNU Emacs version 24.0.91.1. When I open a PHP file it shows as un-syntax-highlighted text, and I get a compile error:
Error: Wrong type argument: number-or-marker-p, nil
and a message in the log:
File mode specification error: (cl-assertion-failed (functionp byte-compiled-fun))
I'm avoiding my .emacs and .emacs.d by running emacs with this command:
emacs -Q --eval '(load "/path/to/nxhtml/autostart")' /path/to/nxhtml/tests/in/heredoc.php
Even if you don't have a fix, how can I go about debugging this issue?
There seem to be a fair amount of such wrong-type-argument errors lately with the development version of Emacs (24). This might represent an Emacs bug. Or it might represent an nXhtml bug.
I suggest starting by notifying Lennart, the nXhtml author, trying to give him a clear recipe, starting from emacs -Q.
If that doesn't help, consider filing an Emacs bug: M-x report-emacs-bug.
To try to debug it a bit yourself, be sure to load only source files (e.g. for nXhtml), i.e., *.el, not *.elc, starting preferably with emacs -Q (no init file). Do M-x set-variable debug-on-error t to see where the error is raised. Then perhaps use M-x debug-on-entry FUNCTION, where FUNCTION is the function where the error seems to have been raised. Then step through the Emacs debugger, hitting d to step and c to skip through a step.
But again, I suggest starting with Lennart.
Try the newest version of Emacs.
I had the same problem (on Windows 7):
Error: Wrong type argument: number-or-marker-p, nil
at line 1471 of nxhtml-loaddefs.el.
Nxhtml seems fine on Emacs 24.1.50.1 (23 April 2012).
http://alpha.gnu.org/gnu/emacs/windows/?C=M;O=D

gdb not showing code within emacs on Windows

I asked a question just yesterday which caused this new issue. gdb within emacs on Windows
Basically I was installing a QT sdk which asked me to uninstall MSYS which I did & I hosed my emacs/gdb interaction.
Here is the gdb_init file that I'm using. Before the uninstall of MSYS this worked fine. Now after it, the breakpoints are working but I am not getting my code in another window with the little red dot on the left margin for a breakpoint.
file ~/../sandbox/trunk/current-win32/debug-bin/sm.exe
dir ~/../sandbox/trunk/src/mgr/view
dir ~/../sandbox/trunk/src/mgr/view/appstatus
dir ~/../sandbox/trunk/src/mgr/controller
break widget.cpp:176
break book.cpp:72
break TcpClient.cpp:660
break mainwidget.cpp:1474
The steps I'm running in emacs
M-x gdb
source ~/gdb_init
run
(It will break but not give me the code along with the breakpoint)
Any ideas what I'm doing wrong?
It turns out I was using the Cygwin version of gdb and had that in my system PATH. For some reason that didn't work out and I was getting errors in gdb within Emacs. Once I installed MSYS(mingw) & the gdb install on their download page and put that in my system PATH then I was back up and running.
I had the exact same problem: windows emacs, cygwin gdb, and the source buffer did not update with the "=>" pointer to show the code location. Downloaded mingw gdb.exe from here: http://sourceforge.net/projects/mingw/files/OldFiles/and selected that gdb with M-x gdb and it worked perfectly.