public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* RE: GDB and gdbserver for CR16 target
@ 2012-01-30  4:33 Kaushik Phatak
  0 siblings, 0 replies; 6+ messages in thread
From: Kaushik Phatak @ 2012-01-30  4:33 UTC (permalink / raw)
  To: gdb

Hi,
>> PTRACE_CONT is killing the debugee with SIGKILL,
That looks like a false alarm. The kernel sources had a bug where a 'break;' was 
missing after the 'PCONT' switch case causing the code to fall into the next case
which was 'KILL'.

Another point which is slightly baffling is the implementation of breakpoint in
the gdbserver. The server.c file handles the Z0/Z1 command by calling 'insert_point'.
However, none of the target specific files 'linux-target-low.c' implement this
function. x86 and crisv32 has some code for this, but nothing in m68k which is used
as a base for some of the other uClinux implementations.
If anybody can throw some light on this, it would be much appreciated.

Thanks,
Kaushik

-----Original Message-----
From: Kaushik Phatak 
Sent: 27 January 2012 08:45
To: 'gdb@sourceware.org'
Subject: RE: GDB and gdbserver for CR16 target

Hi,
Making further progress with the gdbserver for CR16 target, it seems that the
PTRACE_CONT is killing the debugee with SIGKILL,
"Child terminated with signal = 9"
The ATTACH and other ptrace calls seem to work OK. Our Kernel is 2.6.19 (uClinux)
I did read in some discussions lists, issues related to PTRACE_CONT, however
could not conclude much from it.
The PTRACE_CONT implementation in the kernel is very similar to other targets like SH.

Any inputs in this regard would be highly appreciated.

Thanks,
Kaushik


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

* RE: GDB and gdbserver for CR16 target
@ 2012-01-27  3:17 Kaushik Phatak
  0 siblings, 0 replies; 6+ messages in thread
From: Kaushik Phatak @ 2012-01-27  3:17 UTC (permalink / raw)
  To: gdb

Hi,
Making further progress with the gdbserver for CR16 target, it seems that the
PTRACE_CONT is killing the debugee with SIGKILL,
"Child terminated with signal = 9"
The ATTACH and other ptrace calls seem to work OK. Our Kernel is 2.6.19 (uClinux)
I did read in some discussions lists, issues related to PTRACE_CONT, however
could not conclude much from it.
The PTRACE_CONT implementation in the kernel is very similar to other targets like SH.

Any inputs in this regard would be highly appreciated.

Thanks,
Kaushik


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

* RE: GDB and gdbserver for CR16 target
@ 2011-12-22 13:07 Kaushik Phatak
  0 siblings, 0 replies; 6+ messages in thread
From: Kaushik Phatak @ 2011-12-22 13:07 UTC (permalink / raw)
  To: gdb; +Cc: yao

Hi,
Continuing with our efforts on the addition of GDB and gdbserver for CR16.

The gdb, running on the host seems to be connecting to the gdbserver as expected.
However, the gdbserver terminates with "Signal 127".
I have added --debug to the gdbserver parameters and "set debug remote 1" to the
gdb host side which gives me some logs. My PC value reads 0xFFFFFFFF which may
be the problem but I am not sure.
Below are the logs from gdbserver side and gdb side. Any inputs as to why the
server exits would be very much appreciated.
Thanks!

gdbserver logs:
# ./gdbserver --debug :2345 test.out
Process test.out created; pid = 105
linux_wait: [Process 105]
linux_wait_for_lwp: <all threads>
my_waitpid (-1, 0x40000000)
blocking
sigchld_handler
my_waitpid (-1, 0x1): status(57f), 105
Got an event from 105 (57f)
stop pc is ffffffff
linux_wait_for_lwp: pc is 0xffffffff
stop pc is ffffffff
stop pc is 0xffffffff
Hit a non-gdbserver breakpoint.
linux_wait ret = LWP 105.105, 1, 5
Listening on port 2345
Remote debugging from host IPADDR
handling possible serial event
Signal 127
# exit

gdb host side log:
(gdb) set debug remote 1
(gdb) target remote IPADDR:2345
Remote debugging using IPADDR:2345
Sending packet: $qSupported#37...Ack
Packet received: PacketSize=3fff;QPassSignals+;qXfer:libraries:read+;qXfer:auxv:                                                                                        read+;qXfer:spu:read+;qXfer:spu:write+;qXfer:siginfo:read+;qXfer:siginfo:write+;                                                                                        qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;QNonStop+                                                                                    
;qXfer:threads:read+
Packet qSupported (supported-packets) is supported
Sending packet: $QStartNoAckMode#b0...Ack
Packet received: OK
Sending packet: $Hg0#df...Packet received: OK
Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Packet received: E00
Sending packet: $QNonStop:0#8c...Packet received: OK
Sending packet: $?#3f...Packet received: T050f:ffffffff;0e:ffffffff;10:ffffffff;                                                                                        
thread:69;core:0;
Sending packet: $Hc-1#09...Packet received: E01
Sending packet: $qC#b4...Packet received: QC69
Sending packet: $qAttached#8f...Packet received: 0
Packet qAttached (query-attached) is supported
Sending packet: $qOffsets#4b...Packet received: E01
warning: Remote failure reply: E01
0xffffffff in ?? ()
Sending packet: $qSymbol::#5b...Packet received: qSymbol:5f5f707468726561645f746                                                                                        
872656164735f6576656e7473
Packet qSymbol (symbol-lookup) is supported
Sending packet: $qSymbol::5f5f707468726561645f746872656164735f6576656e7473#47...                                                                                       
Packet received: OK
(gdb)


Thanks & Best Regards,
Kaushik Phatak

-----Original Message-----
From: Kaushik Phatak 
Sent: 19 December 2011 17:26
To: 'gdb@sourceware.org'
Cc: 'yao@codesourcery.com'
Subject: RE: GDB and gdbserver for CR16 target

Hi,
Thanks for the reply.

>> PTRACE_PEEKUSER is defined in <sys/ptrace.h>.
The default includes from sys seems to generate errors,
linux-low.c:545:15: error: 'PTRACE_ATTACH' undeclared (first use in this function)
linux-low.c:814:11: error: 'PTRACE_DETACH' undeclared (first use in this function)

Also, the ptrace.h that seemed to get included from "runtime/usr/include/asm/" 
contains definitions,
#define PTRACE_GETREGS   15
#define PTRACE_SETREGS   16
These were conflicting with /sys/ptrace.h definitions.
Commenting these out, and then including the <sys/ptrace.h> seemed to build 
the linux-low.c file.

However, at link time it tried to pass the options "-rdynamic". Can this be
removed safely as this toolchain does not understand this option?

Thanks and Best Regards,
Kaushik Phatak
www.kpitgnutools.com


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

* RE: GDB and gdbserver for CR16 target
@ 2011-12-19 11:56 Kaushik Phatak
  0 siblings, 0 replies; 6+ messages in thread
From: Kaushik Phatak @ 2011-12-19 11:56 UTC (permalink / raw)
  To: gdb; +Cc: yao

Hi,
Thanks for the reply.

>> PTRACE_PEEKUSER is defined in <sys/ptrace.h>.
The default includes from sys seems to generate errors,
linux-low.c:545:15: error: 'PTRACE_ATTACH' undeclared (first use in this function)
linux-low.c:814:11: error: 'PTRACE_DETACH' undeclared (first use in this function)

Also, the ptrace.h that seemed to get included from "runtime/usr/include/asm/" 
contains definitions,
#define PTRACE_GETREGS   15
#define PTRACE_SETREGS   16
These were conflicting with /sys/ptrace.h definitions.
Commenting these out, and then including the <sys/ptrace.h> seemed to build 
the linux-low.c file.

However, at link time it tried to pass the options "-rdynamic". Can this be
removed safely as this toolchain does not understand this option?

Thanks and Best Regards,
Kaushik Phatak
www.kpitgnutools.com

-----Original Message-----
From: Kaushik Phatak 
Sent: 13 December 2011 18:26
To: 'gdb@sourceware.org'
Subject: GDB and gdbserver for CR16 target

Hi,
We are currently adding a GDB port for the CR16 target architecture.
The run simulator port for CR16 is already present in the main line.
Currently, we have build a basic GDB that would work along with sim and we are trying
to build the GDB server for cr16-uclinux-gcc but I am facing some issues.

I have changed #include <sys/ptrace.h> to #include <linux/ptrace.h> which contains
defines for ptrace system calls.
I am getting following errors while compiling linux-low.c
linux-low.c:2171:10: error: 'PTRACE_PEEKUSER' undeclared (first use in this function)
linux-low.c:2244:12: error: 'PTRACE_POKEUSER' undeclared (first use in this function)

The ptrace.h file contains similar definitions,
#define PTRACE_PEEKUSR             3
#define PTRACE_POKEUSR             6
Is this like a typo or am I including the incorrect file?

Any pointers would be very much appreciated.

Thanks and Best Regards,
Kaushik Phatak
www.kpitgnutools.com


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

* Re: GDB and gdbserver for CR16 target
  2011-12-13 12:56 Kaushik Phatak
@ 2011-12-13 13:17 ` Yao Qi
  0 siblings, 0 replies; 6+ messages in thread
From: Yao Qi @ 2011-12-13 13:17 UTC (permalink / raw)
  To: gdb

On 12/13/2011 08:56 PM, Kaushik Phatak wrote:
> I have changed #include <sys/ptrace.h> to #include <linux/ptrace.h> which contains
> defines for ptrace system calls.

I don't understand why do you have to change <sys/ptrace.h> to
<linux/ptrace.h>?

PTRACE_PEEKUSER is defined in <sys/ptrace.h>.

-- 
Yao (齐尧)

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

* GDB and gdbserver for CR16 target
@ 2011-12-13 12:56 Kaushik Phatak
  2011-12-13 13:17 ` Yao Qi
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushik Phatak @ 2011-12-13 12:56 UTC (permalink / raw)
  To: gdb

Hi,
We are currently adding a GDB port for the CR16 target architecture.
The run simulator port for CR16 is already present in the main line.
Currently, we have build a basic GDB that would work along with sim and we are trying
to build the GDB server for cr16-uclinux-gcc but I am facing some issues.

I have changed #include <sys/ptrace.h> to #include <linux/ptrace.h> which contains
defines for ptrace system calls.
I am getting following errors while compiling linux-low.c
linux-low.c:2171:10: error: 'PTRACE_PEEKUSER' undeclared (first use in this function)
linux-low.c:2244:12: error: 'PTRACE_POKEUSER' undeclared (first use in this function)

The ptrace.h file contains similar definitions,
#define PTRACE_PEEKUSR             3
#define PTRACE_POKEUSR             6
Is this like a typo or am I including the incorrect file?

Any pointers would be very much appreciated.

Thanks and Best Regards,
Kaushik Phatak
www.kpitgnutools.com


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

end of thread, other threads:[~2012-01-30  4:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-30  4:33 GDB and gdbserver for CR16 target Kaushik Phatak
  -- strict thread matches above, loose matches on Subject: below --
2012-01-27  3:17 Kaushik Phatak
2011-12-22 13:07 Kaushik Phatak
2011-12-19 11:56 Kaushik Phatak
2011-12-13 12:56 Kaushik Phatak
2011-12-13 13:17 ` Yao Qi

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).