• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision9c0b896ee1d4edfe30c783b027ed5c081845a63d (tree)
l'heure2018-01-23 21:37:43
AuteurPhilipp Rudo <prudo@linu...>
CommiterAndreas Arnez

Message de Log

s390: gdbarch_tdep add hook for syscall record

Most parts of s390_process_record are common for the architecture. Only
the system call handling differs between the OSes. In order to be able to
move s390_process_record to a common code file add a hook to record
syscalls to gdbarch_tdep. So every OS can implement their own handling.

gdb/ChangeLog:

* s390-linux-tdep.c (gdbarch_tdep.s390_syscall_record): New hook.
(s390_process_record, s390_gdbarch_tdep_alloc)
(s390_linux_init_abi_any): Use/set new hook.

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
11 2018-01-23 Philipp Rudo <prudo@linux.vnet.ibm.com>
22
3+ * s390-linux-tdep.c (gdbarch_tdep.s390_syscall_record): New hook.
4+ (s390_process_record, s390_gdbarch_tdep_alloc)
5+ (s390_linux_init_abi_any): Use/set new hook.
6+
7+2018-01-23 Philipp Rudo <prudo@linux.vnet.ibm.com>
8+
39 * s390-linux-tdep.c (osabi.h): New include.
410 (s390_linux_init_abi_31, s390_linux_init_abi_64)
511 (s390_linux_init_abi_any): New functions.
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -122,6 +122,9 @@ struct gdbarch_tdep
122122 bool have_tdb;
123123 bool have_vx;
124124 bool have_gs;
125+
126+ /* Hook to record OS specific systemcall. */
127+ int (*s390_syscall_record) (struct regcache *regcache, LONGEST svc_number);
125128 };
126129
127130
@@ -3808,6 +3811,7 @@ static int
38083811 s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
38093812 CORE_ADDR addr)
38103813 {
3814+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
38113815 uint16_t insn[3] = {0};
38123816 /* Instruction as bytes. */
38133817 uint8_t ibyte[6];
@@ -3964,8 +3968,16 @@ ex:
39643968
39653969 case 0x0a:
39663970 /* SVC - supervisor call */
3967- if (s390_linux_syscall_record (regcache, ibyte[1]))
3968- return -1;
3971+ if (tdep->s390_syscall_record != NULL)
3972+ {
3973+ if (tdep->s390_syscall_record (regcache, ibyte[1]))
3974+ return -1;
3975+ }
3976+ else
3977+ {
3978+ printf_unfiltered (_("no syscall record support\n"));
3979+ return -1;
3980+ }
39693981 break;
39703982
39713983 case 0x0b: /* BSM - branch and set mode */
@@ -7997,6 +8009,8 @@ s390_gdbarch_tdep_alloc ()
79978009 tdep->have_vx = false;
79988010 tdep->have_gs = false;
79998011
8012+ tdep->s390_syscall_record = NULL;
8013+
80008014 return tdep;
80018015 }
80028016
@@ -8195,6 +8209,10 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
81958209 static void
81968210 s390_linux_init_abi_any (struct gdbarch_info info, struct gdbarch *gdbarch)
81978211 {
8212+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
8213+
8214+ tdep->s390_syscall_record = s390_linux_syscall_record;
8215+
81988216 linux_init_abi (info, gdbarch);
81998217
82008218 /* Register handling. */