help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdb emacs help newbie


From: avinashu
Subject: gdb emacs help newbie
Date: 26 Feb 2007 08:45:36 -0800
User-agent: G2/1.0

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!!!!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]