* [RFA] Fix gdbserver on s390(x)
@ 2005-05-10 12:13 Ulrich Weigand
2005-05-10 13:53 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2005-05-10 12:13 UTC (permalink / raw)
To: gdb-patches
Hello,
this patch adds the missing members to the the_low_target struct
in linux-s390-low.c, getting gdbserver working again on s390(x).
Tested on s390-ibm-linux and s390x-ibm-linux.
OK?
Bye,
Ulrich
ChangeLog:
* linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
(s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
(the_low_target): Add new members.
Index: gdb/gdbserver/linux-s390-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-s390-low.c,v
retrieving revision 1.4
diff -c -p -r1.4 linux-s390-low.c
*** gdb/gdbserver/linux-s390-low.c 18 Feb 2004 03:42:51 -0000 1.4
--- gdb/gdbserver/linux-s390-low.c 6 May 2005 18:44:32 -0000
*************** s390_cannot_store_register (int regno)
*** 75,83 ****
--- 75,125 ----
return 0;
}
+
+ static const char s390_breakpoint[] = { 0, 1 };
+ #define s390_breakpoint_len 2
+
+ static CORE_ADDR
+ s390_get_pc ()
+ {
+ unsigned long pc;
+ collect_register_by_name ("pswa", &pc);
+ #ifndef __s390x__
+ pc &= 0x7fffffff;
+ #endif
+ return pc;
+ }
+
+ static void
+ s390_set_pc (CORE_ADDR newpc)
+ {
+ unsigned long pc = newpc;
+ #ifndef __s390x__
+ pc |= 0x80000000;
+ #endif
+ supply_register_by_name ("pswa", &pc);
+ }
+
+ static int
+ s390_breakpoint_at (CORE_ADDR pc)
+ {
+ unsigned char c[s390_breakpoint_len];
+ read_inferior_memory (pc, c, s390_breakpoint_len);
+ return memcmp (c, s390_breakpoint, s390_breakpoint_len) == 0;
+ }
+
+
struct linux_target_ops the_low_target = {
s390_num_regs,
s390_regmap,
s390_cannot_fetch_register,
s390_cannot_store_register,
+ s390_get_pc,
+ s390_set_pc,
+ s390_breakpoint,
+ s390_breakpoint_len,
+ NULL,
+ s390_breakpoint_len,
+ s390_breakpoint_at,
};
+
--
Dr. Ulrich Weigand
Linux on zSeries Development
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Fix gdbserver on s390(x)
2005-05-10 12:13 [RFA] Fix gdbserver on s390(x) Ulrich Weigand
@ 2005-05-10 13:53 ` Daniel Jacobowitz
2005-05-10 16:54 ` Ulrich Weigand
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-05-10 13:53 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: gdb-patches
On Tue, May 10, 2005 at 01:45:28PM +0200, Ulrich Weigand wrote:
> Hello,
>
> this patch adds the missing members to the the_low_target struct
> in linux-s390-low.c, getting gdbserver working again on s390(x).
>
> Tested on s390-ibm-linux and s390x-ibm-linux.
> OK?
>
> Bye,
> Ulrich
>
>
> ChangeLog:
>
> * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
> (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
> (the_low_target): Add new members.
Please update the copyright year in this file; otherwise, this is OK.
Thanks a lot!
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Fix gdbserver on s390(x)
2005-05-10 13:53 ` Daniel Jacobowitz
@ 2005-05-10 16:54 ` Ulrich Weigand
0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Weigand @ 2005-05-10 16:54 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz <drow@false.org> wrote on 10.05.2005 14:12:58:
> Please update the copyright year in this file; otherwise, this is OK.
> Thanks a lot!
Done, thanks!
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-10 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-10 12:13 [RFA] Fix gdbserver on s390(x) Ulrich Weigand
2005-05-10 13:53 ` Daniel Jacobowitz
2005-05-10 16:54 ` Ulrich Weigand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox