From: Eli Zaretskii <eliz@gnu.org>
To: "Sérgio Durigan Júnior" <sergiodj@linux.vnet.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC 1/3] catch syscall -- try 6 -- Source-code modifications
Date: Sat, 12 Sep 2009 08:20:00 -0000 [thread overview]
Message-ID: <838wgk1smq.fsf@gnu.org> (raw)
In-Reply-To: <200909112127.41832.sergiodj@linux.vnet.ibm.com>
> From: Sérgio_Durigan_Júnior <sergiodj@linux.vnet.ibm.com>
> Date: Fri, 11 Sep 2009 21:27:41 -0300
> Cc: gdb-patches@sourceware.org
>
> On Friday 11 September 2009, Eli Zaretskii wrote:
> > I have one more small request:
> > > + /* Check if the user provided a syscall name or a number. */
> > > + syscall_number = (int) strtol (cur_name, &endptr, 10);
> >
> > This forces the user to specify the system call numbers in decimal.
> > However, sometimes it might be more convenient to use hex. For
> > example, I'm planning to add support for this to the DJGPP port, where
> > the various software interrupts and their functions are known to
> > people by their hex numbers, e.g. Interrupt 0x21 function 0x2a is the
> > DOS system call to get the system clock date. Asking the users to
> > translate those into decimal would be a nuisance.
> >
> > So can we use zero instead of 10 for the last argument of this call to
> > strtol?
>
> Sure, I should have used zero since the start. Sorry about that, it's fixed
> (and tested) now.
>
> > Finally, a minor nit:
> > > + while (*arg != '\0')
> > > + {
> > > + int i, syscall_number;
> > > + char *endptr;
> > > + char cur_name[128];
> > > + struct syscall s;
> > > +
> > > + /* Skip whitespace. */
> > > + while (isspace (*arg))
> > > + arg++;
> > > +
> > > + for (i = 0; arg[i] && !isspace (arg[i]); ++i)
> > > + cur_name[i] = arg[i];
> > > + cur_name[i] = '\0';
> > > + arg += i;
> >
> > The last loop does not take care not to overrun the 128-character
> > limit that cur_name[] imposes on the length of syscall names, and will
> > happily smash the stack if GDB is fed a very long string.
>
> Ops, sorry about that too :-)... Thank you for pointing this nit, I've fixed
> it too (and tested, of course).
Thanks, I am happy now.
> What about the patch now? Ok to check in?
I think everybody approved it, right? How about waiting one more day
and then checking it in?
next prev parent reply other threads:[~2009-09-12 8:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 19:01 Sérgio Durigan Júnior
2009-09-05 7:20 ` Eli Zaretskii
2009-09-05 7:24 ` Eli Zaretskii
2009-09-10 22:42 ` Sérgio Durigan Júnior
2009-09-11 8:09 ` Eli Zaretskii
2009-09-12 0:28 ` Sérgio Durigan Júnior
2009-09-12 8:20 ` Eli Zaretskii [this message]
2009-09-12 17:15 ` Sérgio Durigan Júnior
2009-09-13 17:18 ` Sérgio Durigan Júnior
2009-09-15 3:55 ` Sérgio Durigan Júnior
2009-09-15 4:13 ` Joel Brobecker
2009-09-15 4:30 ` Sérgio Durigan Júnior
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=838wgk1smq.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@linux.vnet.ibm.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