* gdb emacs help newbie
@ 2007-02-26 16:45 avinashu
0 siblings, 0 replies; 2+ messages in thread
From: avinashu @ 2007-02-26 16:45 UTC (permalink / raw)
To: help-gnu-emacs
Hello Everyone
I am a newbie with Linux/GDB/emacs. I am connecting to a linux server
using ssh client and using it to run c++ programs. I am trying to use
the gdb debugger with emacs. This is a simple program i am trying to
use the debugger on.
# include <iostream.h>
# include <math.h>
void modify_array(int [],int);
int main()
{
int a[5]={0,1,2,3,4};
int i;
cout<<endl;
for(i=0;i<5;i++) cout<<a[i]<<" ";
modify_array(a,5);
cout<<endl;
for(i=0;i<5;i++) cout<<a[i]<<" ";
}
void modify_array(int ref[], int arraysize)
{
int i;
for(i=0;i<arraysize;i++) ref[i]=ref[i]*3;
}
these are the commands I type out
emacs
[ESC] x gdb [ENTER]
gdb a.out
break 6
run
Now the screen has split into 2 and and u see the code of the cpp file
in the top window and gdb command line in the botton
window
I type n and then n to go to the next lines
The cursor is on line 8 now
When I try to set a breakpoint using:
C-c C-b I get the following message "wrong type argument, sequencep,8"
I get the same message with C-x [SPC]
I get the same message for other lines and other files i tried
Any help would be appreciated!!!!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: gdb emacs help newbie
@ 2007-02-27 21:22 Nick Roberts
0 siblings, 0 replies; 2+ messages in thread
From: Nick Roberts @ 2007-02-27 21:22 UTC (permalink / raw)
To: avinashu; +Cc: help-gnu-emacs
> these are the commands I type out
> emacs
> [ESC] x gdb [ENTER]
> gdb a.out
> break 6
> run
> Now the screen has split into 2 and and u see the code of the cpp file
> in the top window and gdb command line in the botton
> window
> I type n and then n to go to the next lines
> The cursor is on line 8 now
> When I try to set a breakpoint using:
> C-c C-b I get the following message "wrong type argument, sequencep,8"
> I get the same message with C-x [SPC]
> I get the same message for other lines and other files i tried
> Any help would be appreciated!!!!
This is a bug with Emacs 21 which is not present in soon-to-be-released Emacs
22. But anyway, if you place the cursor in the _source_ buffer at the line
where you want your program to stop, and do `C-x SPC' or `C-x C-a C-b' then it
should work as you want.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-27 21:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-27 21:22 gdb emacs help newbie Nick Roberts
-- strict thread matches above, loose matches on Subject: below --
2007-02-26 16:45 avinashu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).