* arc argv problems
@ 2006-08-25 21:30 Lee
2006-08-25 21:37 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Lee @ 2006-08-25 21:30 UTC (permalink / raw)
To: gdb
I am doing all of this on linux gdb build
gdb-6.5.50.20060823
I dumbed down my script for demo purposes here
I even downloaded some sample .gdbinit files and they
did not work either
I am not sure if this is a bug, or user error
.gdbinit
#-----------------------------------------------
set prompt #
define alf
printf "%d\n", $argc
end
define u
if $argc == 0
x/10i $_
end
if $f $argc == 1
x/10i $_
end
if $argc == 1
x/10i $arg1
end
white
end
edircpr:/gdb/gdb-6.5.50.20060823/gdb # vi ~/.gdbinit
edircpr:/gdb/gdb-6.5.50.20060823/gdb # gdb
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
#: alf 1
1
#: alf 1 2
#: alf 1 2 3
2
#: alf 1 2 3 4
3
#: alf 1 2 3 4
4
#: alf 1 2 3 4
4
#: alf 1 2 3 4
4
#: alf 1 2 3 4 5
4
#: alf 1 2 3 4 5
5
#: u
Invalid type combination in equality test.
Notice how the $argc isnt correct, and even changes
sometimes
I also can not do anything like if $argc == 2 etc as I
get the invalid type errors.
my goal with the script here is that I can ofcourse
tell how may args were passed to my user defined
function and work with said args
I have also tried using $ARGC etc, but I think the
correct one to use is $argc $argv
Any suggestions ?
Also I have not found any good scripting references
specific to gdb. While it is very similar to other
things, there are things that work special like printf
that are close but not the same.
Thanks
Lee
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: arc argv problems
2006-08-25 21:30 arc argv problems Lee
@ 2006-08-25 21:37 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2006-08-25 21:37 UTC (permalink / raw)
To: Lee; +Cc: gdb
On Fri, Aug 25, 2006 at 02:30:13PM -0700, Lee wrote:
> I am doing all of this on linux gdb build
> gdb-6.5.50.20060823
>
> I dumbed down my script for demo purposes here
> I even downloaded some sample .gdbinit files and they
> did not work either
>
> I am not sure if this is a bug, or user error
Your GDB appears to be very, very broken. I get completely different
results using the same gdbinit, which look correct.
> edircpr:/gdb/gdb-6.5.50.20060823/gdb # vi ~/.gdbinit
> edircpr:/gdb/gdb-6.5.50.20060823/gdb # gdb
> GNU gdb 6.4
> Copyright 2005 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General
> Public License, and you are
> welcome to change it and/or distribute copies of it
> under certain conditions.
You appear to have edited out your platform. Where are you running
this?
> I have also tried using $ARGC etc, but I think the
> correct one to use is $argc $argv
$argc and $arg0 and $arg1.
> Also I have not found any good scripting references
> specific to gdb. While it is very similar to other
> things, there are things that work special like printf
> that are close but not the same.
It's all in the GDB manual. Search for $argc.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-25 21:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-25 21:30 arc argv problems Lee
2006-08-25 21:37 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox