Emacs gdb mode not working with gdb-ia

Emacs gdb mode not working with gdb-ia

Hi,

when using gdb I normally use it inside Emacs, which provides a nice environment for debugging while in text mode (image attached), but this doesn't seem to work with gdb-ia. When invoking gdb from inside Emacs, I change the name of the gdb executable to gdb-ia, but I get the error:

angelv@carro:~$ Error: you did not specify -i=mi on GDB's command line!

Is there any way to get gdb-ia to play nicely with GDB Emacs mode?

Thanks,

Ángel de Vicente

AttachmentSize
Downloadimage/png emacs_gdb.png819.41 KB
14 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

could you please tell me which exact versions you use for:

  • EMACS
  • Default GDB
  • Intel version of GDB (gdb-ia)

I had a quick go with EMACS 23.1.1 and gdb-ia 7.8-16.0.768 which worked w/o error message.

Thank you & best regards,

Georg Zitzlsberger

Hi Georg,

I am running the following versions:

emacs --version: GNU Emacs 24.5.1

gdb --version: GNU gdb (GDB) Fedora 7.9.1-20.fc22

gdb-ia --version: GNU gdb (GDB) 7.8-16.0.558

In the attached gdb-ia.png you see how I invoke gdb but using gdb-ia, and in gdb-ia2.png you see the error message. Any help appreciated.

Thanks,

Ángel de Vicente

Attachments: 

AttachmentSize
Downloadimage/png gdb-ia2.png940.86 KB
Downloadimage/png gdb-ia.png233.12 KB

Thank you very much for the information!

I'm now able to reproduce the problem. The root cause is that gdb-ia in MI mode (-i=mi) prints the first line w/o MI formatting:
No symbol table is loaded.  Use the "file" command.

This makes EMACS thinking it's not in MI mode (hence the error: Error: you did not specify -i=mi on GDB's command line!).

I've filed a ticket for engineering (DPD200584470) to fix that in a future version. As a workaround you can use a wrapper script calling gdb-ia and filtering away the first line, e.g. (wrap.sh):

#!/bin/sh
gdb-ia $@ 2>&1 | sed -e 's/^No symbol table is loaded.  Use the "file" command.$/~""/g'

Use that instead of "gdb-ia" for the time being:
Run gdb (like this): ./wrap.sh -i=mi my_exec

Best regards,

Georg Zitzlsberger

Great, that works a treat!

 

Thanks,

Ángel de Vicente

Hi, 

sorry, one more question. Is it possible to get gdb-ia as a standalone download, without the need for a compiler license?

Thanks,

Ángel

Hello,

we do not have any separate download for it. The only way to get those Intel enhanced GDBs is via the development suites. However, our teams are working with the community to up-stream as much as possible, and we also provide the GDB source code with the suites.

Best regards,

Georg Zitzlsberger

Hi,

OK, thanks. By the way, in case it can be of interest to someone reading this thread in the future, I put up a video showing how to use gdb-ia + Emacs to debug both serial and parallel Fortran codes: https://youtu.be/Bc3H1fhh9ho

Any advice on how to improve my setting is very welcome.

Cheers,

Ángel de Vicente

Hello,

DPD200584470 is now fixed with upcoming final release of Intel(R) Parallel Studio XE 2017 and the 2016 Update 4 version. Both will be released next month.

Best regards,

Georg Zitzlsberger

Hello, 

I know this is an old question but it seems gdb-ia is not working for me even though I have the latest release of intel fortran (Intel® Parallel Studio XE Composer Edition for Fortran macOS* 2017-Update 4). I tried to use gdb-ia from inside the Emacs (as in the original post). First I typed: "M-x gdb". Then: "gdb-ia -i=mi test.exe" and the message I got was: "Searching for program: No such file or directory, gdb-ia". Am I doing something wrong?    

I have:

emacs --version: GNU Emacs 25.2.1

gdb --version: GNU gdb (GDB) 7.12.1

gdb-ia (GDB) 7.10-18.0.543

macOS -- Version 10.12.4

Thanks, 

Diego

 

 

 

Hi Diego,

I haven't used this in a while, but it looks like Emacs simply cannot find gdb-ia. Before you invoke Emacs (or from an Emacs shell), can you find gdb-ia with the command which?

In my case:

[angelv@duna ~]$ which gdb-ia
/opt/intel/2016.0.1/compilers_and_libraries_2016.1.150/linux/bin/intel64/gdb-ia

Cheers,

Ángel

Dear Angel,

Thanks for your reply. If I write which gdb-ia in the terminal, I get nothing. However, if I write before: source /opt/intel/bin/compilervars.sh intel64  then I get: /opt/intel//debugger_2017/gdb/intel64/bin/gdb-ia. Do you have any idea about how to proceed?

All my best, 

Diego

 

 

Hi Diego,

just run the source command before launching Emacs, and I think Emacs should have no problem then in finding gdb-ia

Cheers,

Ángel

Hello Lads, 

Just another quick question related with this old post. When I am debugging with gdb-ia in emacs, I get a lot of the following warnings: 

warning: can't find symbol 'xxxxxxx' in minsymtab

Do you have any idea about how to get rid of these warnings. Thanks, Diego

Leave a Comment

Please sign in to add a comment. Not a member? Join today