All of lore.kernel.org
 help / color / mirror / Atom feed
* gdb/insight 5.3 buggy   in kernel module debug
@ 2003-07-08  8:00 renwei
  2003-07-09 12:36 ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: renwei @ 2003-07-08  8:00 UTC (permalink / raw)
  To: linux-mips

Is there anyone else find the same problem?


I download the gdb/insight 5.3 , want to use 
it to debug my mipsel idt334 board.
configure as --target=mipsel-linux.

when connect to the target , it always give me
some wrong addr:

new thead xxxxxx
   0xffffffff83f28040 in ??()
something like that.
and the backtrace command can't work, also.
but my gdb5.0 for mipsel is ok.


I think that's the gdb get the pc as 64bit, but my 
board's cpu is 32bit, so it can't get the correct pc ...
The kernel addr is up to 0x80000000, so it's negative.

I trace the gdb5.3 , and find the place in 
mips-tdep.c, so I just fix the read_pc , make it 
as 32bit , now it can work, and the backtrace command 
can display the call trace .

But I'm not sure if my fix is a full one ? 
Anyone have full patch please tell me ...

                                      renc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gdb/insight 5.3 buggy   in kernel module debug
  2003-07-08  8:00 gdb/insight 5.3 buggy in kernel module debug renwei
@ 2003-07-09 12:36 ` Ralf Baechle
  2003-07-11  2:14   ` [patch]: " renwei
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2003-07-09 12:36 UTC (permalink / raw)
  To: renwei; +Cc: linux-mips

On Tue, Jul 08, 2003 at 04:00:08PM +0800, renwei wrote:

> new thead xxxxxx
>    0xffffffff83f28040 in ??()
> something like that.
> and the backtrace command can't work, also.
> but my gdb5.0 for mipsel is ok.
> 
> 
> I think that's the gdb get the pc as 64bit, but my 
> board's cpu is 32bit, so it can't get the correct pc ...
> The kernel addr is up to 0x80000000, so it's negative.

On 64-bit processors running 32-bit code the actual values in the
registers are sign-extended to 64-bit, so that behaviour of your gdb
seems right.  Fix whatever places do return a zero-extended values.

  Ralf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [patch]: gdb/insight 5.3 buggy   in kernel module debug
  2003-07-09 12:36 ` Ralf Baechle
@ 2003-07-11  2:14   ` renwei
  2003-07-11  2:31     ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: renwei @ 2003-07-11  2:14 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

Here's my patch to this problem, change the read pc on mips32 cpu.

Maybe someone want it.
change mips-tdep.c
///////////////////////////////////////////////////////////////////////////////////////
766c766,772
<   return read_signed_register_pid (PC_REGNUM, ptid);
---
>   /*add by renwei , if mips 32, the pc should be some positive number,
>    or the gdb can't lookup the backtrace in kernel*/
>   LONGEST lpc = read_signed_register_pid (PC_REGNUM, ptid);
>   if(REGISTER_RAW_SIZE(PC_REGNUM) < (int)sizeof(LONGEST))
>     lpc &= 0x00000000ffffffffLL;
>   
>   return lpc;
1703c1709,1714
< 
---
>   
>   /*add by renwei , if mips 32, the pc should be some positive number,
>    or the gdb can't lookup the backtrace in kernel*/
>   if(REGISTER_RAW_SIZE(PC_REGNUM) < (int)sizeof(LONGEST))
>     saved_pc &= 0x00000000ffffffffLL;
>   
/////////////////////////////////////////////////////////////////////////////////////////////




Another problem:   insight 5.3 compile error on cygwin.
fix  tclWin32Dll.c
/////////////////////////////////////////////////////////////////////////////////
121c121,122
< static Tcl_Encoding tclWinTCharEncoding;
---
> /*change this to global*/
> Tcl_Encoding tclWinTCharEncoding;
///////////////////////////////////////////////////////////////////////////////////


                                                          renc 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch]: gdb/insight 5.3 buggy   in kernel module debug
  2003-07-11  2:14   ` [patch]: " renwei
@ 2003-07-11  2:31     ` Ralf Baechle
  2003-07-11  2:43       ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2003-07-11  2:31 UTC (permalink / raw)
  To: renwei; +Cc: linux-mips

On Fri, Jul 11, 2003 at 10:14:44AM +0800, renwei wrote:

> Here's my patch to this problem, change the read pc on mips32 cpu.

Don't send GDB patches to me, I'm not maintaining GDB; drow@mvista.com is
probably a better address.

Also a standard rant - never ever send ed-style patches; any maintainer
will probably just drop them.

  Ralf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch]: gdb/insight 5.3 buggy   in kernel module debug
  2003-07-11  2:31     ` Ralf Baechle
@ 2003-07-11  2:43       ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-07-11  2:43 UTC (permalink / raw)
  To: renwei, linux-mips

On Fri, Jul 11, 2003 at 04:31:01AM +0200, Ralf Baechle wrote:
> On Fri, Jul 11, 2003 at 10:14:44AM +0800, renwei wrote:
> 
> > Here's my patch to this problem, change the read pc on mips32 cpu.
> 
> Don't send GDB patches to me, I'm not maintaining GDB; drow@mvista.com is
> probably a better address.
> 
> Also a standard rant - never ever send ed-style patches; any maintainer
> will probably just drop them.

Please don't send them to me either - send them to
gdb-patches@sources.redhat.com, where they belong.

Andrew will tell you that the 64-bit signed PC is correct.  The bug is
in whatever code is not sign extending, probably in the symbol reader. 
If you're using stabs try dwarf-2 instead.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-07-11  2:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-08  8:00 gdb/insight 5.3 buggy in kernel module debug renwei
2003-07-09 12:36 ` Ralf Baechle
2003-07-11  2:14   ` [patch]: " renwei
2003-07-11  2:31     ` Ralf Baechle
2003-07-11  2:43       ` Daniel Jacobowitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.