This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: remote debugging: gdbserver backtrace on mips


Hi,

SETUP:--

Server:
Running on the uclinux mips board.Talking to the
client over ethernet via tcp.

Following i'm doing at server:
server> gdbserver 137.71.32.9:5000 test
Process test created; pid = 34
Remote debugging from host 137.71.32.9 

Following i'm doing at Client:
client> mips-linux-gdb
GNU gdb 5.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=mips-linux".
(gdb) target remote 137.71.32.5:5000
Remote debugging using 137.71.32.5:5000
0x00000010 in ?? ()
(gdb) add-symbol-file test.gdb
add symbol table from file "test.gdb" at
(y or n) y
Reading symbols from test.gdb...done.
(gdb) set heuristic-fence-post 1
(gdb) list
1       #include<stdio.h>
2       void sat();
3       void cal(int *,int *);
4       main()
5       {
6         int xx,yy,zz,ww;
7         xx = 200;
8         yy = 100;
9         zz = xx + yy;
10        ww = zz/yy;
(gdb) b main
Breakpoint 1 at 0x27c: file test.c, line 7.
(gdb) b sat
Breakpoint 2 at 0x324: file test.c, line 22.
(gdb) b cal
Breakpoint 3 at 0x3d0: file test.c, line 29.
(gdb) c
Continuing.
 
Breakpoint 1, main () at test.c:7
7         xx = 200;
(gdb) c
Continuing.
 
Breakpoint 3, cal (a=0x803cff20, b=0x803cff24) at
test.c:29
29        x = *a + *b;
(gdb) bt
#0  cal (a=0x803cff20, b=0x803cff24) at test.c:29
warning: Warning: GDB can't find the start of the
function at 0x803c82ec.
 
    GDB is unable to find the start of the function at
0x803c82ec
and thus can't determine the size of that function's
stack frame.
This means that GDB may be unable to access that stack
frame, or
the frames below it.
    This problem is most likely caused by an invalid
program counter or
stack pointer.
 However, if you think GDB should simply search
farther back
from 0x803c82ec for code which looks like the
beginning of a
function, you can increase the range of the search
using the `set
heuristic-fence-post' command.
(gdb)

MY TEST PROGRAMME LOOK LIKE THIS:-
main()
{
  int xx,yy,zz,ww;
  xx = 200;
  yy = 100;
  zz = xx + yy;
  ww = zz/yy;
  cal(&xx,&yy);
  xx = yy;
  printf("Test program %x %x %x
%x..\n",&xx,&yy,&zz,&ww);
  printf("main %x sat %x cal %x ..\n",main,sat,cal);
  printf(" gVar1 %x gVar2 %x \r\n",&gVar1,&gVar2);
  sat();

}
void sat()
{
  int i=20,j=5,sum=0,dev=0,mul=0;
  sum = i+j;
  dev = i/j;
  mul = i*j;
  printf("division %d\n",dev);
  printf("add %d\n",sum);
  printf("multi %d\n",mul);
}
void cal(int *a,int *b)
{
  int x,y,z;
  x = *a + *b;
  y = *a / *b;
  z = *a - *b;
  printf("x =%d\n",x);
  printf("y =%d\n",y);
  printf("z =%d\n",z);
}

Regards
sadiq.shaikh

--- Daniel Jacobowitz <drow@mvista.com> wrote:
> On Tue, Jun 03, 2003 at 02:00:03AM -0700, #-sadiq
> shaikh-# wrote:
> > Hi,
> >  
> > Has anyone worked on gdbserver on mips platform,
> and
> > got thru the backtrace problem. when i do bt
> command
> > on the client(host) side i could see only
> innermost
> > frame, previous frames its trying to get but not
> > succeeding. Eventually giving error as 
> > --------------------------------------------------
> > (gdb) bt
> > #0? cal (a=0x803cff20, b=0x803cff24) at test.c:29
> > warning: Warning: GDB can't find the start of the
> > function at 0x803c82ec.
> 
> Please provide a full transcript of the session,
> including GDB's
> command line and any other commands.
> 
> It should work, and I do test mips-linux gdbserver.
> 
> -- 
> Daniel Jacobowitz
> MontaVista Software                         Debian
> GNU/Linux Developer


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]