poke-devel
[Top][All Lists]
Advanced

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

Re: Feature request: open file before running poke script


From: Jose E. Marchesi
Subject: Re: Feature request: open file before running poke script
Date: Sat, 06 Feb 2021 12:30:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi David.

> First, thank you all for developing such a great tool! I am using poke
> to debug some work I am doing with BTF and it is wonderfully useful :)
>
> One thing I have found that would be very convenient is the ability to
> open a specified file before running a script, when invoking poke with
> -s or --script=<script>
>
> For example, when invoked as
>   $ poke -s myscript foo.o
>
> Poke would execute:
>   .file foo.o
>   <all commands in myscript; which can do something with foo.o>
>
> As a motivating use case, I currently have a small poke script which
> collects BTF information in a file, and displays portions of it. But
> right now, I need to hardcode the filename (foo.o) into the script.
> Otherwise, the following happens:
>
>   $ poke -s myscript foo.o
>   unhandled no IOS exception
>   $ poke foo.o --script=myscript
>   unhandled no IOS exception
>
> With this improvement, it would be much easier to rapidly check multiple
> test cases:
>
>   $ poke -s myscript foo.o
>   (dump of relevant information in foo.o)
>   $ poke -s myscript bar.o
>   (dump of relevant information in bar.o)
>   ...
>
> Or maybe there is an existing way to do this, in which case the
> documentation around poke script usage could perhaps be improved?

As Mohammad said, what you want is to use a Poke program as a script.

I think the confusion here comes from the documentaion of the -s option:

@item -s
@itemx --script=@var{file}
Load @var{file} as a poke script.  Any number of @samp{-s} options may
be specified, and they are loaded in the given order.

The above is a reminiscence from before we introduced support for -L.
Back then, what we call today a "command file" was a script.

Nowadays, command files are documented in the manual in:

* Command Files::             Loading commands from files.

and scripts in:

* Scripts::                   Executing Poke programs in the command line.

It is clear that -s and --script are misleading.  Any suggestion for a
better one?



reply via email to

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