Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GDB 4.16 - spaces in string arguments.

1 view
Skip to first unread message

Aubrey Jaffer

unread,
Feb 26, 1997, 3:00:00 AM2/26/97
to

I can't figure how to pass strings with spaces in them to my
User-defined command `eval'. Is this possible?

I have appended my ".gdbinit" file and a session transcript showing
the problem. In the transcript

eval "()"

works fine, but

eval "( )"

does not.

print scm_evstr("( )")

works, showing the problem must be with user-defined command argument
passing. Thanks in advance.

-=-=-=-

Current directory is ~/scm/
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i586-unknown-linux), Copyright 1996 Free Software Foundation, Inc...
(gdb) runscm
Breakpoint 1 at 0x8055723: file repl.c, line 1240.

to return to gdb, type: (abort)

warning: Unable to find dynamic linker breakpoint function.
warning: GDB will be unable to debug shared library initializers
warning: and track explicitly loaded dynamic code.
SCM version 5a0, Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation.
SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `(terms)' for details.
> (abort)

Breakpoint 1, abrt () at repl.c:1240
(gdb) eval "()"
$1 = 14708
()
(gdb) eval "( )"
Unterminated string in expression.
(gdb) print scm_evstr("( )")
$4 = 14708
(gdb) scm $
()
(gdb)

-=-=-=-

define runscm
break abrt
echo \nto return to gdb, type: (abort)\n\n
run
end

define verbose
output (prolixity(((($arg0)<<1)<<1)+2L))>>2
echo\n
end

define errobj
call iprin1(*loc_errobj, sys_protects[2], 1),(void)0
call newline(sys_protects[2]),(void)0
end

define scm
if (errjmp_bad)
echo sorry, errjmp_bad\n
else
call iprin1($arg0, sys_protects[2], 1),(void)0
call newline(sys_protects[2]),(void)0
end
end

define load
if (errjmp_bad)
echo sorry, errjmp_bad\n
else
call scm_ldfile($arg0),(void)0
end
end

define eval
if (errjmp_bad)
echo sorry, errjmp_bad\n
else
print scm_evstr($arg0)
scm $
end
end

0 new messages