Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Hafiz Abid Qadeer <abid_qadeer@mentor.com>
Cc: <gdb-patches@sourceware.org>,  <jiangshuai_li@c-sky.com>
Subject: Re: [1/2] C-SKY Port
Date: Fri, 27 Jul 2018 15:49:00 -0000	[thread overview]
Message-ID: <87tvok65mf.fsf@tromey.com> (raw)
In-Reply-To: <d1611d83-3388-6a01-119d-efd64e9802c2@mentor.com> (Hafiz Abid	Qadeer's message of "Wed, 25 Jul 2018 11:54:01 +0100")

>>>>> ">" == Hafiz Abid Qadeer <abid_qadeer@mentor.com> writes:

>> Add support for new target 'csky'.

>> 2018-07-25  Jiangshuai Li  <jiangshuai_li@c-sky.com>
>> 	    Hafiz Abid Qadeer  <abidh@codesourcery.com>
>> 	    Don Breazeal  <donb@codesourcery.com>

I didn't check the copyright assignment situation, but for a patch of
this size, assignments are needed.  I assume codesourcery has some kind
of blanket assignment, but what about Jiangshuai Li?

>> diff --git a/gdb/configure.tgt b/gdb/configure.tgt

>> +csky*-linux*)

>> +csky*-*)

It's more normal to mention all the "-"s, so "csky*-*-linux*" and "csky*-*-*".

I don't know anything about C-SKY, so I didn't really look deeply at the
arch-specific bits.  I assume those pass your testing.

>> diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c

>> +struct stack_item
>> +{
>> +  int len;
>> +  struct stack_item *prev;
>> +  void *data;

Seems to me that this could be gdb_byte instead of void here, and in
push_stack_item and pop_stack_item.

>> +/* Implement the push_dummy_call gdbarch method.  */
>> +
>> +static CORE_ADDR
>> +csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
>> +		      struct regcache *regcache, CORE_ADDR bp_addr,
>> +		      int nargs, struct value **args, CORE_ADDR sp,
>> +		      int struct_return, CORE_ADDR struct_addr)
>> +{
[...]
>> +      arg_type = check_typedef (value_type (args[argnum]));
>> +      len = TYPE_LENGTH (arg_type);
>> +      val = value_contents (args[argnum]);

I wonder if this can ever throw.

In theory of course it can.  But maybe in practice it isn't possible?
I don't know.

The issue is, if it can throw, then the stack_items will be leaked.
A way around that is to redo the stack as self-managing C++ objects and
use a local std::vector or the like to hold them.

>> +  /* Transfer the dummy stack frame to the target.  */
>> +  while (si)
>> +    {
>> +      sp -= si->len;
>> +      write_memory (sp, (const bfd_byte *) si->data, si->len);

A similar consideration applies here.


This all seems pretty reasonable to me.

Tom


  reply	other threads:[~2018-07-27 15:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 10:43 [0/2] " Hafiz Abid Qadeer
2018-07-25 10:54 ` [1/2] " Hafiz Abid Qadeer
2018-07-27 15:49   ` Tom Tromey [this message]
2018-07-27 23:13     ` Hafiz Abid Qadeer
2018-08-08 10:53       ` Hafiz Abid Qadeer
2018-08-17  9:18       ` Abid, Hafiz
2018-08-24  9:15         ` Hafiz Abid Qadeer
2018-08-26  9:29       ` Joel Brobecker
2018-08-28 11:47         ` Hafiz Abid Qadeer
2018-10-21  2:55   ` Simon Marchi
2018-10-21  3:04     ` Hafiz Abid Qadeer
2018-10-21  3:22       ` Simon Marchi
2018-10-23 12:49         ` Hafiz Abid Qadeer
2018-10-23 16:42           ` Simon Marchi
2018-10-23 22:31             ` Hafiz Abid Qadeer
2018-07-25 10:55 ` [2/2] " Hafiz Abid Qadeer
2018-07-25 14:47   ` Eli Zaretskii

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=87tvok65mf.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=abid_qadeer@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jiangshuai_li@c-sky.com \
    /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