Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Marcin Kościelnicki" <koriakin@0x04.net>
To: Andreas Arnez <arnez@linux.vnet.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/8] gdb/s390: Fill write_guessed_tracepoint_pc hook.
Date: Tue, 26 Jan 2016 19:26:00 -0000	[thread overview]
Message-ID: <56A7C855.6090806@0x04.net> (raw)
In-Reply-To: <m3vb6gdxbf.fsf@oc1027705133.ibm.com>

On 26/01/16 19:12, Andreas Arnez wrote:
> On Sun, Jan 24 2016, Marcin Kościelnicki wrote:
>
>> diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
>> index e827684..c4d25d2 100644
>> --- a/gdb/s390-linux-tdep.c
>> +++ b/gdb/s390-linux-tdep.c
>> @@ -167,6 +167,22 @@ s390_write_pc (struct regcache *regcache, CORE_ADDR pc)
>>       regcache_cooked_write_unsigned (regcache, S390_SYSTEM_CALL_REGNUM, 0);
>>   }
>>
>> +static void
>> +s390_write_guessed_tracepoint_pc (struct regcache *regcache, CORE_ADDR pc)
>
> Please add documentation for this function, as described here:
>
>    https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Document_Every_Subprogram
>
> Note that this was not always done in the past; thus there are still
> many undocumented functions in this file.  But for new functions we
> should stick to it.

OK, will do.
>
>> +{
>> +  struct gdbarch *gdbarch = get_regcache_arch (regcache);
>> +  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
>> +  int sz = register_size (gdbarch, S390_PSWA_REGNUM);
>> +  gdb_byte *reg = (gdb_byte *) alloca (sz);
>> +
>> +  /* 31-bit PSWA needs high bit set.  */
>> +  if (tdep->abi == ABI_LINUX_S390)
>> +    pc |= 0x80000000;
>
> This is done differently in s390_pseudo_register_write: the high bit is
> copied from the original PSWA.  Of course, this only makes a difference
> if a program ever switches to 24-bit mode (yikes).  I just wonder
> whether both cases should be treated the same, or whether there's good
> reason not to.

If write_guessed_tracepoint_pc is called, we explicitely have no 
registers data other than PC itself - there's no original PSWA to speak 
of.  The state of PSWA high bit probably doesn't matter all that much, 
but since we want to mark PSWA as known, we'd better write the 
reasonable value to it.
>
>> +
>> +  store_unsigned_integer (reg, sz, gdbarch_byte_order (gdbarch), pc);
>> +  regcache_raw_supply (regcache, S390_PSWA_REGNUM, reg);
>> +}
>> +
>>
>>   /* DWARF Register Mapping.  */
>>
>> @@ -7857,6 +7873,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
>>   					    s390_iterate_over_regset_sections);
>>     set_gdbarch_cannot_store_register (gdbarch, s390_cannot_store_register);
>>     set_gdbarch_write_pc (gdbarch, s390_write_pc);
>> +  set_gdbarch_write_guessed_tracepoint_pc (gdbarch, s390_write_guessed_tracepoint_pc);
>>     set_gdbarch_pseudo_register_read (gdbarch, s390_pseudo_register_read);
>>     set_gdbarch_pseudo_register_write (gdbarch, s390_pseudo_register_write);
>>     set_tdesc_pseudo_register_name (gdbarch, s390_pseudo_register_name);
>


  reply	other threads:[~2016-01-26 19:26 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 12:12 [PATCH 0/8] gdb/s390: Add regular and fast tracepoint support Marcin Kościelnicki
2016-01-24 12:12 ` [PATCH 8/8] gdbserver/s390: Add support for compiled agent expressions Marcin Kościelnicki
2016-03-04 10:41   ` [PATCH v2] " Marcin Kościelnicki
2016-03-14 16:19     ` Andreas Arnez
2016-01-24 12:12 ` [PATCH 7/8] gdb.trace: Bump tspeed.exp timeout to 600 seconds Marcin Kościelnicki
2016-01-26 18:17   ` Andreas Arnez
2016-01-29  9:53     ` [PATCH] " Marcin Kościelnicki
2016-02-12 11:20       ` Yao Qi
2016-02-18 18:54       ` Marcin Kościelnicki
2016-01-24 12:12 ` [PATCH 2/8] gdb/s390: Fill write_guessed_tracepoint_pc hook Marcin Kościelnicki
2016-01-26 18:12   ` Andreas Arnez
2016-01-26 19:26     ` Marcin Kościelnicki [this message]
2016-01-29 18:57       ` Andreas Arnez
2016-02-07 14:00         ` [PATCH 2/8] gdb/s390: Fill supply_pseudo_pc hook Marcin Kościelnicki
2016-01-24 12:12 ` [PATCH 1/8] gdb: Add write_guessed_tracepoint_pc hook to gdbarch Marcin Kościelnicki
2016-01-26 14:58   ` Andreas Arnez
2016-02-07 13:59     ` [PATCH 1/8] gdb: Add supply_pseudo_pc " Marcin Kościelnicki
2016-02-16 18:28       ` Ulrich Weigand
2016-02-16 21:32         ` Marcin Kościelnicki
2016-02-18 10:35         ` [PATCH 1/2] gdb: Add guess_tracepoint_registers " Marcin Kościelnicki
2016-02-18 10:35           ` [PATCH 2/2] gdb/s390: Fill guess_tracepoint_registers hook Marcin Kościelnicki
2016-02-18 16:03             ` Ulrich Weigand
2016-02-18 16:36               ` [PATCH] " Marcin Kościelnicki
2016-02-18 16:48                 ` Ulrich Weigand
2016-02-18 16:58                   ` Marcin Kościelnicki
2016-02-18 11:38           ` [PATCH 1/2] gdb: Add guess_tracepoint_registers hook to gdbarch Luis Machado
2016-02-18 11:39             ` Marcin Kościelnicki
2016-02-18 11:45             ` [PATCH] " Marcin Kościelnicki
2016-02-18 15:40               ` Ulrich Weigand
2016-02-18 15:41                 ` Marcin Kościelnicki
2016-02-18 15:58                   ` Ulrich Weigand
2016-02-18 16:01                     ` Marcin Kościelnicki
2016-02-18 16:06                       ` Ulrich Weigand
2016-02-18 16:11                         ` Marcin Kościelnicki
2016-02-18 16:13                           ` Ulrich Weigand
2016-02-18 16:22                             ` Marcin Kościelnicki
2016-01-24 12:12 ` [PATCH 3/8] gdb/s390: Fill pseudo register agent expression hooks Marcin Kościelnicki
2016-02-07 14:01   ` Marcin Kościelnicki
2016-02-25 19:23     ` Marcin Kościelnicki
2016-03-04 10:42       ` Marcin Kościelnicki
2016-03-11  2:20         ` Marcin Kościelnicki
2016-03-11  9:58     ` Andreas Arnez
2016-03-11 10:04       ` Marcin Kościelnicki
2016-01-24 12:12 ` [PATCH 5/8] gdbserver/s390: Switch on tracepoint support Marcin Kościelnicki
2016-02-07 14:04   ` Marcin Kościelnicki
2016-02-22  7:38     ` [PATCH] " Marcin Kościelnicki
2016-03-04 10:39       ` [PATCH v3] " Marcin Kościelnicki
2016-03-15 18:41         ` [PATCH v4] " Marcin Kościelnicki
2016-03-22  9:16           ` Marcin Kościelnicki
2016-03-23 15:25           ` Andreas Arnez
2016-03-24  1:15             ` Marcin Kościelnicki
2016-03-29 18:31               ` Ulrich Weigand
2016-03-29 21:40                 ` Marcin Kościelnicki
2016-03-29 21:40             ` [PATCH obv] gdb/NEWS: Add mention of s390*-linux tracepoints Marcin Kościelnicki
2016-03-30  2:49               ` Eli Zaretskii
2016-01-24 12:12 ` [PATCH 4/8] gdb/s390: Fill gen_return_address hook Marcin Kościelnicki
2016-02-07 14:02   ` Marcin Kościelnicki
2016-02-25 19:23     ` Marcin Kościelnicki
2016-03-04 10:42       ` Marcin Kościelnicki
2016-03-11 11:20     ` Andreas Arnez
2016-03-11 11:35       ` Marcin Kościelnicki
2016-03-11 12:18         ` Andreas Arnez
2016-03-11 12:26           ` Marcin Kościelnicki
2016-03-11 15:31             ` Andreas Arnez
2016-03-11 15:44               ` Pedro Alves
2016-03-11 16:45                 ` Andreas Arnez
2016-03-11 17:02                   ` Pedro Alves
2016-03-11 18:17                     ` Eli Zaretskii
2016-03-11 18:37                       ` Pedro Alves
2016-03-11 19:34                         ` Eli Zaretskii
2016-03-15 11:11                           ` Pedro Alves
2016-03-15 11:23                             ` Andreas Arnez
2016-03-15 11:30                               ` Pedro Alves
2016-03-11 18:07                   ` Eli Zaretskii
2016-03-13  9:53               ` Marcin Kościelnicki
2016-03-14 10:07                 ` Andreas Arnez
2016-01-24 12:13 ` [PATCH 6/8] gdbserver/s390: Add fast tracepoint support Marcin Kościelnicki
2016-01-25 14:34   ` Antoine Tremblay
2016-02-19 13:41     ` Marcin Kościelnicki
2016-02-19 14:41       ` Antoine Tremblay
2016-03-04 10:40         ` [PATCH v2] " Marcin Kościelnicki
2016-03-14 16:19           ` Andreas Arnez
2016-03-14 16:25             ` Marcin Kościelnicki
2016-01-25 13:27 ` [PATCH 0/8] gdb/s390: Add regular and " Antoine Tremblay
2016-01-25 13:56 ` Pedro Alves
2016-01-25 14:28   ` Marcin Kościelnicki
2016-01-25 15:57     ` Pedro Alves
2016-01-25 16:03       ` Marcin Kościelnicki
2016-02-12 11:04 ` Marcin Kościelnicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A7C855.6090806@0x04.net \
    --to=koriakin@0x04.net \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox