From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Resubmit reverse debugging [5/5]
Date: Wed, 08 Oct 2008 20:14:00 -0000 [thread overview]
Message-ID: <1223496839.19088.51.camel@localhost.localdomain> (raw)
In-Reply-To: <1223489663.19088.43.camel@localhost.localdomain>
El mié, 08-10-2008 a las 15:14 -0300, Thiago Jung Bauermann escribió:
> El mar, 07-10-2008 a las 19:20 -0700, Michael Snyder escribió:
> > +static void
> > +exec_reverse_once (char *cmd, char *args, int from_tty)
> > +{
> > + /* String buffer for command consing. */
> > + char reverse_command[512];
> <snip>
> > + sprintf (reverse_command, "%s %s", cmd, args ? args : "");
> > +
> > + execution_direction = EXEC_REVERSE;
> > + execute_command (reverse_command, from_tty);
> > + do_cleanups (old_chain);
>
> That fixed-length buffer being written with sprintf doesn't look good...
> What do you think about using xstrprintf instead? That will remove the
> possibility of buffer overflow, and also remove an arbitrary limit.
By the way, the string manipulation can be avoided if you pass a
function pointer to exec_reverse_once. Then you can call it passing
next_command, continue_command and all others. It seems cleaner to me,
what do you think?
Also, will there be anything added to reverse.c in the future? If not,
IMHO it's easier just to put these command definitions and setup in
infcmd.c, next to their forward counterparts.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
next prev parent reply other threads:[~2008-10-08 20:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 2:23 Michael Snyder
2008-10-08 18:15 ` Thiago Jung Bauermann
2008-10-08 19:16 ` Eli Zaretskii
2008-10-09 4:23 ` Pedro Alves
2008-10-09 8:41 ` Eli Zaretskii
2008-10-08 20:14 ` Thiago Jung Bauermann [this message]
2008-10-08 20:55 ` Michael Snyder
2008-10-08 20:27 ` Michael Snyder
2008-10-08 20:43 ` Thiago Jung Bauermann
2008-12-15 12:29 ` Tomas Holmberg
2008-10-08 21:06 ` Michael Snyder
2008-10-08 21:14 ` Thiago Jung Bauermann
2008-10-17 19:48 ` Michael Snyder
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=1223496839.19088.51.camel@localhost.localdomain \
--to=bauerman@br.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.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