bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb hijacks my argument list


From: Tribhuwan Kandpal
Subject: Re: gdb hijacks my argument list
Date: Sun, 13 Dec 2009 18:07:30 +0530 (IST)

Hi Leslie,
I believe you want to pass the arguments to your program but you need to pass it within gdb. so give those arguments when you give run command
 
try this:
 
gdb your_program_name
 
now the gdb shell will open:
 
(gdb) run Write_the_arguments_of_your_program_here
 
 
I believe it will help you
 
Thanks,
Trib

--- On Fri, 4/12/09, Leslie Turriff <address@hidden> wrote:

From: Leslie Turriff <address@hidden>
Subject: gdb hijacks my argument list
To: address@hidden
Date: Friday, 4 December, 2009, 2:36 PM

Hi,

    I'm writing a package that accepts arbitrary character strings from the
command line, and I'm trying to debug it with gdb.

    When run without gdb the command line string is passed directly to my
program, but when I tell gdb to pass it, gdb insists on interpreting it as a
filename, and won't pass it through.

Example without gdb:
=================================================
./testtoken ' (name testtoken endchar \) < testtoken.adb | (trace) count
lines|cons '

Input string is:
....+....1....+....2....+....3....+....4....+....5....+....6
(name testtoken endchar \) < testtoken.adb | (trace) count lines|cons

    Before: TokenFrom =   1
            TextLeft  =  71

    After:  TokenFrom =   1
            TextLeft  =  71

Token  1 is: ' (name testtoken endchar \) < testtoken.adb | (trace) count
lines|cons '

End of tokens reached.

=================================================

Example with gdb:
=================================================
gdb testtoken --args ' (name testtoken endchar \) < testtoken.adb | (trace)
count lines|cons '
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-suse-linux"...
(name testtoken endchar \) < testtoken.adb | (trace) count lines|cons : No
such file or directory.
(gdb)
=================================================

    How do I make gdb pass this string through to the program under test?

Leslie


_______________________________________________
bug-gdb mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-gdb


The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]