[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gdb hijacks my argument list
From: |
Leslie Turriff |
Subject: |
Re: gdb hijacks my argument list |
Date: |
Sat, 19 Dec 2009 16:05:35 -0600 |
User-agent: |
KMail/1.9.9 |
Hi,
Sorry for the delayed response.
Yes, I have tried using the 'run PROGNAME ARGUMENTS...' method, but it
gives
me the same results. I'll append the source code and a terminal session
showing exactly what I have tried, so that you can (presumably) duplicate my
results. Perhaps I am misunderstanding somehow the proper gdb syntax to be
used, or have wrong versions of tools?
Leslie
On Sunday 13 December 2009 06:37:30 Tribhuwan Kandpal wrote:
> 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.
> http://in.yahoo.com/
testcmdline.adb
Description: Text Data
gdbSession.txt
Description: Text document