// "cmd:" line
VG_(strcpy)(buf, "cmd:");
VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
- if (VG_(args_the_exename)) {
- VG_(write)(fd, " ", 1);
- VG_(write)(fd, VG_(args_the_exename),
- VG_(strlen)( VG_(args_the_exename) ));
- }
+ VG_(write)(fd, " ", 1);
+ VG_(write)(fd, VG_(args_the_exename),
+ VG_(strlen)( VG_(args_the_exename) ));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_client), i );
if (arg) {
Int i,j,size = 0;
HChar* argv;
- if (VG_(args_the_exename)) {
- CLG_ASSERT( VG_(strlen)( VG_(args_the_exename) ) < BUF_LEN-1);
- size = VG_(sprintf)(cmdbuf, " %s", VG_(args_the_exename));
- }
+ CLG_ASSERT( VG_(strlen)( VG_(args_the_exename) ) < BUF_LEN-1);
+ size = VG_(sprintf)(cmdbuf, " %s", VG_(args_the_exename));
for(i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
argv = * (HChar**) VG_(indexXA)( VG_(args_for_client), i );
Addr client_SP; /* client stack base (initial SP) */
Addr clstack_start;
Int i;
- Bool have_exename;
vg_assert(VG_IS_PAGE_ALIGNED(clstack_end+1));
vg_assert( VG_(args_for_client) );
/* first of all, work out how big the client stack will be */
stringsize = 0;
auxsize = 0;
- have_exename = VG_(args_the_exename) != NULL;
/* paste on the extra args if the loader needs them (ie, the #!
interpreter and its argument) */
}
/* now scan the args we're given... */
- if (have_exename)
- stringsize += VG_(strlen)( VG_(args_the_exename) ) + 1;
+ stringsize += VG_(strlen)( VG_(args_the_exename) ) + 1;
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
argc++;
/* OK, now we know how big the client stack is */
stacksize =
sizeof(Word) + /* argc */
- (have_exename ? sizeof(HChar **) : 0) + /* argc[0] == exename */
+ sizeof(HChar **) + /* argc[0] == exename */
sizeof(HChar **)*argc + /* argv */
sizeof(HChar **) + /* terminal NULL */
sizeof(HChar **)*envc + /* envp */
if (info->dynamic) *ptr++ = info->text;
/* --- client argc --- */
- *ptr++ = (Addr)(argc + (have_exename ? 1 : 0));
+ *ptr++ = (Addr)(argc + 1);
/* --- client argv --- */
if (info->interp_name) {
VG_(free)(info->interp_args);
}
- if (have_exename)
- *ptr++ = (Addr)copy_str(&strtab, VG_(args_the_exename));
+ *ptr++ = (Addr)copy_str(&strtab, VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
*ptr++ = (Addr)copy_str(
Addr client_SP; /* client stack base (initial SP) */
Addr clstack_start;
Int i;
- Bool have_exename;
vg_assert(VG_IS_PAGE_ALIGNED(clstack_end+1));
vg_assert( VG_(args_for_client) );
/* first of all, work out how big the client stack will be */
stringsize = 0;
- have_exename = VG_(args_the_exename) != NULL;
/* paste on the extra args if the loader needs them (ie, the #!
interpreter and its argument) */
}
/* now scan the args we're given... */
- if (have_exename)
- stringsize += VG_(strlen)( VG_(args_the_exename) ) + 1;
+ stringsize += VG_(strlen)( VG_(args_the_exename) ) + 1;
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
argc++;
stringsize += VG_(strlen)(cauxv->u.a_ptr) + 1;
else if (cauxv->a_type == AT_RANDOM)
stringsize += 16;
- else if (cauxv->a_type == AT_EXECFN && have_exename)
+ else if (cauxv->a_type == AT_EXECFN)
stringsize += VG_(strlen)(VG_(args_the_exename)) + 1;
auxsize += sizeof(*cauxv);
}
/* OK, now we know how big the client stack is */
stacksize =
sizeof(Word) + /* argc */
- (have_exename ? sizeof(HChar **) : 0) + /* argc[0] == exename */
+ sizeof(HChar **) + /* argc[0] == exename */
sizeof(HChar **)*argc + /* argv */
sizeof(HChar **) + /* terminal NULL */
sizeof(HChar **)*envc + /* envp */
ptr = (Addr*)client_SP;
/* --- client argc --- */
- *ptr++ = argc + (have_exename ? 1 : 0);
+ *ptr++ = argc + 1;
/* --- client argv --- */
if (info->interp_name) {
VG_(free)(info->interp_args);
}
- if (have_exename)
- *ptr++ = (Addr)copy_str(&strtab, VG_(args_the_exename));
+ *ptr++ = (Addr)copy_str(&strtab, VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
*ptr++ = (Addr)copy_str(
// paste the command line (because of the "==pid==" prefixes), so we now
// favour utility and simplicity over aesthetics.
umsg_or_xml("%sCommand: ", xpre);
- if (VG_(args_the_exename))
- umsg_or_xml_arg(VG_(args_the_exename));
+ umsg_or_xml_arg(VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
HChar* s = *(HChar**)VG_(indexXA)( VG_(args_for_client), i );
VG_(printf_xml)(" </vargv>\n");
VG_(printf_xml)(" <argv>\n");
- if (VG_(args_the_exename))
- VG_(printf_xml)(" <exe>%pS</exe>\n",
+ VG_(printf_xml)(" <exe>%pS</exe>\n",
VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
VG_(printf_xml)(
VG_(err_config_error)("Can't create client cmdline file in %s\n", buf2);
nul[0] = 0;
- exename = VG_(args_the_exename) ? VG_(args_the_exename)
- : "unknown_exename";
+ exename = VG_(args_the_exename);
VG_(write)(fd, exename, VG_(strlen)( exename ));
VG_(write)(fd, nul, 1);
// Print "cmd:" line.
FP("cmd: ");
- if (VG_(args_the_exename)) {
- FP("%s", VG_(args_the_exename));
- for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
- HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_client), i );
- if (arg)
- FP(" %s", arg);
- }
- } else {
- FP(" ???");
+ FP("%s", VG_(args_the_exename));
+ for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
+ HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_client), i );
+ if (arg)
+ FP(" %s", arg);
}
FP("\n");