Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Invalid hex digit 59 - Linux MIPS kernel debugging
@ 2007-04-13 15:01 Alex Gonzalez
  2007-04-13 15:09 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Gonzalez @ 2007-04-13 15:01 UTC (permalink / raw)
  To: gdb

Hi,

I am trying to debug the Linux MIPS kernel using gdb.

I have the gdb stub in the kernel and gdb communicating through the
serial interface, I seem to be able to set a breakpoint but gdb never
hits it. It complains with a 'Reply contains invalid hex digit 59',
which  I guess refers to the semicolon character used in the response.

I enclose the session output in case someone can give me some pointers.

Thanks in advance,
Alex

------------------------------------------------------

root@euskadi:/tftpboot/pv-rootfs# bin/i386-linux-gdb
usr/src/repository/linux/vmlinux
GNU gdb 6.3
Copyright 2004 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-gnu"...
(gdb) set remotebaud 115200
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
0x3f0000001d in ?? ()
warning: shared library handler failed to enable breakpoint
(gdb) break calibrate_delay
Breakpoint 1 at 0x80323020: file init/calibrate.c, line 32.
(gdb) c
Continuing.
Reply contains invalid hex digit 59
(gdb) q
The program is running.  Exit anyway? (y or n) y
root@euskadi:/tftpboot/pv-rootfs# bin/i386-linux-gdb
usr/src/repository/linux/vmlinux
GNU gdb 6.3
Copyright 2004 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-gnu"...
(gdb) set remotebaud 115200
(gdb) set debug remote 1
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
Sending packet: $Hc-1#09...Ack
Packet received: T0525:8010b820;48:d8d1c7bf;1d:802f1f10;
Sending packet: $qC#b4...Ack
Packet received:
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $?#3f...Ack
Packet received: S05
Sending packet: $Hg0#df...Ack
Packet received:
Sending packet: $p25#d7...Ack
Packet received:
Sending packet: $g#67...Ack
Packet received:
000000009000800000000001000000010000002b8010a5e0000007f5803429f80000000a8020223400000000802f1afafffffffeffffffff0000000a00000005000a115080054b901fffffff0000005140000000000000019384424d280902ec802f1a15ffffffff802f1f10802f1f10802f0000802f1f10d8d1c7bf803236149000800301176b40013f5600c1004710000000248010b820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802f3128001001008012a4408012a3d8802f1c10000000000000003f0000003c03ec001703ec0057006080200000000000000000000000000000000000000000c1004000d8d1c7bf8012a4408012a3d88012a8a800003440
Sending packet: $m3c,4#63...Ack
Packet received: E03
Sending packet: $m38,4#38...Ack
Packet received: E03
Sending packet: $m3c,4#63...Ack
Packet received: E03
Sending packet: $m38,4#38...Ack
Packet received: E03
0x3f0000003c in ?? ()
warning: shared library handler failed to enable breakpoint
Sending packet: $qSymbol::#5b...Ack
Packet received:
Packet qSymbol (symbol-lookup) is NOT supported
(gdb) break calibrate_delay
Sending packet: $m80323020,4#5f...Ack
Packet received: 3c028034
Sending packet: $m80323024,4#63...Ack
Packet received: 8c42e570
Sending packet: $m80323028,4#67...Ack
Packet received: 27bdffe8
Breakpoint 1 at 0x80323020: file init/calibrate.c, line 32.
(gdb) c
Continuing.
Sending packet: $Z0,80323020,4#a8...Ack
Packet received:
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $m80323020,4#5f...Ack
Packet received: 3c028034
Sending packet: $X80323020,0:#80...Ack
Packet received: OK
binary downloading suppported by target
Sending packet: $X80323020,4:\000\005\000\r#96...Ack
Packet received: OK
Sending packet: $vCont?#49...Ack
Packet received:
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...Ack
Packet received:
Sending packet: $c#63...Ack
Packet received: T0525:80323020;48:d8d1c7bf;1d:802f1fa8;
Reply contains invalid hex digit 59
(gdb)


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

* Re: Invalid hex digit 59 - Linux MIPS kernel debugging
  2007-04-13 15:01 Invalid hex digit 59 - Linux MIPS kernel debugging Alex Gonzalez
@ 2007-04-13 15:09 ` Daniel Jacobowitz
  2007-04-13 16:40   ` Alex Gonzalez
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-04-13 15:09 UTC (permalink / raw)
  To: Alex Gonzalez; +Cc: gdb

On Fri, Apr 13, 2007 at 04:01:35PM +0100, Alex Gonzalez wrote:
> Hi,
> 
> I am trying to debug the Linux MIPS kernel using gdb.
> 
> I have the gdb stub in the kernel and gdb communicating through the
> serial interface, I seem to be able to set a breakpoint but gdb never
> hits it. It complains with a 'Reply contains invalid hex digit 59',
> which  I guess refers to the semicolon character used in the response.
> 
> I enclose the session output in case someone can give me some pointers.

Try a CVS snapshot of GDB.  What's probably going on is that your GDB
expects 64-bit registers, so it is confused to find a semicolon in the
middle of a register value.


-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: Invalid hex digit 59 - Linux MIPS kernel debugging
  2007-04-13 15:09 ` Daniel Jacobowitz
@ 2007-04-13 16:40   ` Alex Gonzalez
  2007-04-13 17:29     ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Gonzalez @ 2007-04-13 16:40 UTC (permalink / raw)
  To: Alex Gonzalez, gdb

Thanks, I'll try that.

If you don't mind me asking, why would gdb expect 64bits registers
when the target abi is set to o32?

On 4/13/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Fri, Apr 13, 2007 at 04:01:35PM +0100, Alex Gonzalez wrote:
> > Hi,
> >
> > I am trying to debug the Linux MIPS kernel using gdb.
> >
> > I have the gdb stub in the kernel and gdb communicating through the
> > serial interface, I seem to be able to set a breakpoint but gdb never
> > hits it. It complains with a 'Reply contains invalid hex digit 59',
> > which  I guess refers to the semicolon character used in the response.
> >
> > I enclose the session output in case someone can give me some pointers.
>
> Try a CVS snapshot of GDB.  What's probably going on is that your GDB
> expects 64-bit registers, so it is confused to find a semicolon in the
> middle of a register value.
>
>
> --
> Daniel Jacobowitz
> CodeSourcery
>


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

* Re: Invalid hex digit 59 - Linux MIPS kernel debugging
  2007-04-13 16:40   ` Alex Gonzalez
@ 2007-04-13 17:29     ` Daniel Jacobowitz
  2007-04-13 17:42       ` Alex Gonzalez
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-04-13 17:29 UTC (permalink / raw)
  To: Alex Gonzalez; +Cc: gdb

On Fri, Apr 13, 2007 at 05:40:25PM +0100, Alex Gonzalez wrote:
> Thanks, I'll try that.
> 
> If you don't mind me asking, why would gdb expect 64bits registers
> when the target abi is set to o32?

Because you can run o32 binaries on hardware with 64-bit registers,
and there are some ugly corner cases where the upper half of registers
can cause problems - e.g. for things which have undefined behavior if
the input registers are not correctly sign extended.  You've probably
built a 32-bit kernel for a processor that GDB knows is actually
64-bit.  But if your debug agent only supplies 32 bits, then GDB will
get along fine (once it knows that).

If you don't want to change GDB versions, an appropriate "set arch"
might work - but I recommend the current snapshots.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: Invalid hex digit 59 - Linux MIPS kernel debugging
  2007-04-13 17:29     ` Daniel Jacobowitz
@ 2007-04-13 17:42       ` Alex Gonzalez
  2007-04-13 18:09         ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Gonzalez @ 2007-04-13 17:42 UTC (permalink / raw)
  To: Alex Gonzalez, gdb

Thanks a lot, that was very helpful.

Setting the architecture to mips:isa32 indeed works. And you're right
in that the 32bits kernel is running on an RM9000 with 64 bits
architecture.

Will the CVS version work without having to set the architecture or
will I still have to do so?

Regards,
Alex

On 4/13/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Fri, Apr 13, 2007 at 05:40:25PM +0100, Alex Gonzalez wrote:
> > Thanks, I'll try that.
> >
> > If you don't mind me asking, why would gdb expect 64bits registers
> > when the target abi is set to o32?
>
> Because you can run o32 binaries on hardware with 64-bit registers,
> and there are some ugly corner cases where the upper half of registers
> can cause problems - e.g. for things which have undefined behavior if
> the input registers are not correctly sign extended.  You've probably
> built a 32-bit kernel for a processor that GDB knows is actually
> 64-bit.  But if your debug agent only supplies 32 bits, then GDB will
> get along fine (once it knows that).
>
> If you don't want to change GDB versions, an appropriate "set arch"
> might work - but I recommend the current snapshots.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>


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

* Re: Invalid hex digit 59 - Linux MIPS kernel debugging
  2007-04-13 17:42       ` Alex Gonzalez
@ 2007-04-13 18:09         ` Daniel Jacobowitz
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-04-13 18:09 UTC (permalink / raw)
  To: Alex Gonzalez; +Cc: gdb

On Fri, Apr 13, 2007 at 06:42:32PM +0100, Alex Gonzalez wrote:
> Thanks a lot, that was very helpful.
> 
> Setting the architecture to mips:isa32 indeed works. And you're right
> in that the 32bits kernel is running on an RM9000 with 64 bits
> architecture.
> 
> Will the CVS version work without having to set the architecture or
> will I still have to do so?

It will work automatically.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2007-04-13 18:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-13 15:01 Invalid hex digit 59 - Linux MIPS kernel debugging Alex Gonzalez
2007-04-13 15:09 ` Daniel Jacobowitz
2007-04-13 16:40   ` Alex Gonzalez
2007-04-13 17:29     ` Daniel Jacobowitz
2007-04-13 17:42       ` Alex Gonzalez
2007-04-13 18:09         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox