projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[gdb/testsuite] Move code from gdb_init to default_gdb_init
[deliverable/binutils-gdb.git]
/
gdbsupport
/
common-inferior.cc
diff --git
a/gdbsupport/common-inferior.cc
b/gdbsupport/common-inferior.cc
index aa8be14c742677f2ace41dea5f87cf2522d30c22..a67d1740a27d78f13c31b1b9658c96d5cdf7ca30 100644
(file)
--- a/
gdbsupport/common-inferior.cc
+++ b/
gdbsupport/common-inferior.cc
@@
-28,10
+28,8
@@
bool startup_with_shell = true;
/* See common-inferior.h. */
std::string
/* See common-inferior.h. */
std::string
-construct_inferior_arguments (
int argc, char * const *
argv)
+construct_inferior_arguments (
gdb::array_view<char * const>
argv)
{
{
- gdb_assert (argc >= 0);
-
std::string result;
if (startup_with_shell)
std::string result;
if (startup_with_shell)
@@
-48,7
+46,7
@@
construct_inferior_arguments (int argc, char * const *argv)
static const char special[] = "\"!#$&*()\\|[]{}<>?'`~^; \t\n";
static const char quote = '\'';
#endif
static const char special[] = "\"!#$&*()\\|[]{}<>?'`~^; \t\n";
static const char quote = '\'';
#endif
- for (int i = 0; i < arg
c
; ++i)
+ for (int i = 0; i < arg
v.size ()
; ++i)
{
if (i > 0)
result += ' ';
{
if (i > 0)
result += ' ';
@@
-103,19
+101,19
@@
construct_inferior_arguments (int argc, char * const *argv)
{
/* In this case we can't handle arguments that contain spaces,
tabs, or newlines -- see breakup_args(). */
{
/* In this case we can't handle arguments that contain spaces,
tabs, or newlines -- see breakup_args(). */
- for (
int i = 0; i < argc; ++i
)
+ for (
char *arg : argv
)
{
{
- char *cp = strchr (arg
v[i]
, ' ');
+ char *cp = strchr (arg, ' ');
if (cp == NULL)
if (cp == NULL)
- cp = strchr (arg
v[i]
, '\t');
+ cp = strchr (arg, '\t');
if (cp == NULL)
if (cp == NULL)
- cp = strchr (arg
v[i]
, '\n');
+ cp = strchr (arg, '\n');
if (cp != NULL)
error (_("can't handle command-line "
"argument containing whitespace"));
}
if (cp != NULL)
error (_("can't handle command-line "
"argument containing whitespace"));
}
- for (int i = 0; i < arg
c
; ++i)
+ for (int i = 0; i < arg
v.size ()
; ++i)
{
if (i > 0)
result += " ";
{
if (i > 0)
result += " ";
This page took
0.025013 seconds
and
4
git commands to generate.