Quantcast

How to enter a file using gallium?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to enter a file using gallium?

chobbes158


Hi there,

I'm totally new to the new debuggers. What I'm aiming at is to go through a file (it's a file calling other packages and functions therein.) line by line, just like in matlab. The first step is to step in the file using gallium. I know how to traverse a function in terminal using Gallium. But it seems that I can't enter a file by doing the same thing like:

julia> @enter test.jl
ERROR
: BoundsError: attempt to access 0-element Array{Int64,1} at index [0]


How can I enter a file via Gallium? Is it possible at all? Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

Michele Zaffalon
You @enter the function, not the file. What function would you call once you include test.jl? That is the function to which you should prepend @enter.

On Fri, Nov 18, 2016 at 6:49 PM, <[hidden email]> wrote:


Hi there,

I'm totally new to the new debuggers. What I'm aiming at is to go through a file (it's a file calling other packages and functions therein.) line by line, just like in matlab. The first step is to step in the file using gallium. I know how to traverse a function in terminal using Gallium. But it seems that I can't enter a file by doing the same thing like:

julia> @enter test.jl
ERROR
: BoundsError: attempt to access 0-element Array{Int64,1} at index [0]


How can I enter a file via Gallium? Is it possible at all? Thanks.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

chobbes158
Thanks for the comments. I tried what you suggested by adding @enter at the beginning of a line where a function is called. But an error was thrown.

julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
ERROR
: LoadError: AssertionError: isa(arg,Expr) && arg.head == :call
 
in include_from_node1(::String) at ./loading.jl:488
while loading /home/calvin/Documents/git/codes/fc.jl/examples/test.jl, in expression starting on line 19

Am I missing anything? Thanks!


On Friday, November 18, 2016 at 8:11:45 PM UTC, Michele Zaffalon wrote:
You @enter the function, not the file. What function would you call once you include test.jl? That is the function to which you should prepend @enter.

On Fri, Nov 18, 2016 at 6:49 PM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="a5zL16vhBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">chobb...@...> wrote:


Hi there,

I'm totally new to the new debuggers. What I'm aiming at is to go through a file (it's a file calling other packages and functions therein.) line by line, just like in matlab. The first step is to step in the file using gallium. I know how to traverse a function in terminal using Gallium. But it seems that I can't enter a file by doing the same thing like:

julia> @enter test.jl
ERROR
: BoundsError: attempt to access 0-element Array{Int64,1} at index [0]


How can I enter a file via Gallium? Is it possible at all? Thanks.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

Michele Zaffalon
The @enter should be prepended to the function in the REPL, not in the
file itself. It should be something like this:

julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")

julia> @enter function_to_debug(args_to_function)

On Sat, Nov 19, 2016 at 11:43 AM,  <[hidden email]> wrote:

> Thanks for the comments. I tried what you suggested by adding @enter at the
> beginning of a line where a function is called. But an error was thrown.
>
> julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
> ERROR: LoadError: AssertionError: isa(arg,Expr) && arg.head == :call
>  in include_from_node1(::String) at ./loading.jl:488
> while loading /home/calvin/Documents/git/codes/fc.jl/examples/test.jl, in
> expression starting on line 19
>
> Am I missing anything? Thanks!
>
>
> On Friday, November 18, 2016 at 8:11:45 PM UTC, Michele Zaffalon wrote:
>>
>> You @enter the function, not the file. What function would you call once
>> you include test.jl? That is the function to which you should prepend
>> @enter.
>>
>> On Fri, Nov 18, 2016 at 6:49 PM, <[hidden email]> wrote:
>>>
>>>
>>>
>>> Hi there,
>>>
>>> I'm totally new to the new debuggers. What I'm aiming at is to go through
>>> a file (it's a file calling other packages and functions therein.) line by
>>> line, just like in matlab. The first step is to step in the file using
>>> gallium. I know how to traverse a function in terminal using Gallium. But it
>>> seems that I can't enter a file by doing the same thing like:
>>>
>>> julia> @enter test.jl
>>> ERROR: BoundsError: attempt to access 0-element Array{Int64,1} at index
>>> [0]
>>>
>>>
>>> How can I enter a file via Gallium? Is it possible at all? Thanks.
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

chobbes158
Thanks! It now works for me. Two more quick questions:

1. Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A?

A = ...
function_to_debug
(A)
...
...
A
= ...
function_to_debug
(A)


2. As I'm step through the function_to_debug(), how can I print the value of some variables. I know that I can use 'fr v' which prints everything. How can I print just a single variable that I'm looking at?

Thanks!!


On Saturday, November 19, 2016 at 12:26:38 PM UTC, Michele Zaffalon wrote:
The @enter should be prepended to the function in the REPL, not in the
file itself. It should be something like this:

julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")

julia> @enter function_to_debug(args_to_function)

On Sat, Nov 19, 2016 at 11:43 AM,  <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="7PSa6d4WCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">chobb...@...> wrote:

> Thanks for the comments. I tried what you suggested by adding @enter at the
> beginning of a line where a function is called. But an error was thrown.
>
> julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
> ERROR: LoadError: AssertionError: isa(arg,Expr) && arg.head == :call
>  in include_from_node1(::String) at ./loading.jl:488
> while loading /home/calvin/Documents/git/codes/fc.jl/examples/test.jl, in
> expression starting on line 19
>
> Am I missing anything? Thanks!
>
>
> On Friday, November 18, 2016 at 8:11:45 PM UTC, Michele Zaffalon wrote:
>>
>> You @enter the function, not the file. What function would you call once
>> you include test.jl? That is the function to which you should prepend
>> @enter.
>>
>> On Fri, Nov 18, 2016 at 6:49 PM, <[hidden email]> wrote:
>>>
>>>
>>>
>>> Hi there,
>>>
>>> I'm totally new to the new debuggers. What I'm aiming at is to go through
>>> a file (it's a file calling other packages and functions therein.) line by
>>> line, just like in matlab. The first step is to step in the file using
>>> gallium. I know how to traverse a function in terminal using Gallium. But it
>>> seems that I can't enter a file by doing the same thing like:
>>>
>>> julia> @enter test.jl
>>> ERROR: BoundsError: attempt to access 0-element Array{Int64,1} at index
>>> [0]
>>>
>>>
>>> How can I enter a file via Gallium? Is it possible at all? Thanks.
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

Michele Zaffalon
I don't know the answer to the first question.

For the second, you should check
https://github.com/Keno/ASTInterpreter.jl and in particular the
command `stuff.

On Sat, Nov 19, 2016 at 4:08 PM,  <[hidden email]> wrote:

> Thanks! It now works for me. Two more quick questions:
>
> 1. Suppose I have the following code where the variable A is defined
> multiple times and after each definition it is used by the same function
> function_to_debug. How can I step in function_to_debug with the first
> definition/instantiation of A?
>
> A = ...
> function_to_debug(A)
> ...
> ...
> A = ...
> function_to_debug(A)
>
>
> 2. As I'm step through the function_to_debug(), how can I print the value of
> some variables. I know that I can use 'fr v' which prints everything. How
> can I print just a single variable that I'm looking at?
>
> Thanks!!
>
>
> On Saturday, November 19, 2016 at 12:26:38 PM UTC, Michele Zaffalon wrote:
>>
>> The @enter should be prepended to the function in the REPL, not in the
>> file itself. It should be something like this:
>>
>> julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
>>
>> julia> @enter function_to_debug(args_to_function)
>>
>> On Sat, Nov 19, 2016 at 11:43 AM,  <[hidden email]> wrote:
>> > Thanks for the comments. I tried what you suggested by adding @enter at
>> > the
>> > beginning of a line where a function is called. But an error was thrown.
>> >
>> > julia>
>> > include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
>> > ERROR: LoadError: AssertionError: isa(arg,Expr) && arg.head == :call
>> >  in include_from_node1(::String) at ./loading.jl:488
>> > while loading /home/calvin/Documents/git/codes/fc.jl/examples/test.jl,
>> > in
>> > expression starting on line 19
>> >
>> > Am I missing anything? Thanks!
>> >
>> >
>> > On Friday, November 18, 2016 at 8:11:45 PM UTC, Michele Zaffalon wrote:
>> >>
>> >> You @enter the function, not the file. What function would you call
>> >> once
>> >> you include test.jl? That is the function to which you should prepend
>> >> @enter.
>> >>
>> >> On Fri, Nov 18, 2016 at 6:49 PM, <[hidden email]> wrote:
>> >>>
>> >>>
>> >>>
>> >>> Hi there,
>> >>>
>> >>> I'm totally new to the new debuggers. What I'm aiming at is to go
>> >>> through
>> >>> a file (it's a file calling other packages and functions therein.)
>> >>> line by
>> >>> line, just like in matlab. The first step is to step in the file using
>> >>> gallium. I know how to traverse a function in terminal using Gallium.
>> >>> But it
>> >>> seems that I can't enter a file by doing the same thing like:
>> >>>
>> >>> julia> @enter test.jl
>> >>> ERROR: BoundsError: attempt to access 0-element Array{Int64,1} at
>> >>> index
>> >>> [0]
>> >>>
>> >>>
>> >>> How can I enter a file via Gallium? Is it possible at all? Thanks.
>> >>
>> >>
>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

chobbes158
Thanks for the comments on my second question. I missed the acute prepended before 'stuff'.



On Saturday, November 19, 2016 at 3:14:13 PM UTC, Michele Zaffalon wrote:
I don't know the answer to the first question.

For the second, you should check
<a href="https://github.com/Keno/ASTInterpreter.jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FKeno%2FASTInterpreter.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE1i2ayojPJHSY97_qSkiNs72FLoA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FKeno%2FASTInterpreter.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE1i2ayojPJHSY97_qSkiNs72FLoA&#39;;return true;">https://github.com/Keno/ASTInterpreter.jl and in particular the
command `stuff.

On Sat, Nov 19, 2016 at 4:08 PM,  <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="SJm6DQQgCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">chobb...@...> wrote:

> Thanks! It now works for me. Two more quick questions:
>
> 1. Suppose I have the following code where the variable A is defined
> multiple times and after each definition it is used by the same function
> function_to_debug. How can I step in function_to_debug with the first
> definition/instantiation of A?
>
> A = ...
> function_to_debug(A)
> ...
> ...
> A = ...
> function_to_debug(A)
>
>
> 2. As I'm step through the function_to_debug(), how can I print the value of
> some variables. I know that I can use 'fr v' which prints everything. How
> can I print just a single variable that I'm looking at?
>
> Thanks!!
>
>
> On Saturday, November 19, 2016 at 12:26:38 PM UTC, Michele Zaffalon wrote:
>>
>> The @enter should be prepended to the function in the REPL, not in the
>> file itself. It should be something like this:
>>
>> julia> include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
>>
>> julia> @enter function_to_debug(args_to_function)
>>
>> On Sat, Nov 19, 2016 at 11:43 AM,  <[hidden email]> wrote:
>> > Thanks for the comments. I tried what you suggested by adding @enter at
>> > the
>> > beginning of a line where a function is called. But an error was thrown.
>> >
>> > julia>
>> > include("/home/calvin/Documents/git/codes/fc.jl/examples/test.jl")
>> > ERROR: LoadError: AssertionError: isa(arg,Expr) && arg.head == :call
>> >  in include_from_node1(::String) at ./loading.jl:488
>> > while loading /home/calvin/Documents/git/codes/fc.jl/examples/test.jl,
>> > in
>> > expression starting on line 19
>> >
>> > Am I missing anything? Thanks!
>> >
>> >
>> > On Friday, November 18, 2016 at 8:11:45 PM UTC, Michele Zaffalon wrote:
>> >>
>> >> You @enter the function, not the file. What function would you call
>> >> once
>> >> you include test.jl? That is the function to which you should prepend
>> >> @enter.
>> >>
>> >> On Fri, Nov 18, 2016 at 6:49 PM, <[hidden email]> wrote:
>> >>>
>> >>>
>> >>>
>> >>> Hi there,
>> >>>
>> >>> I'm totally new to the new debuggers. What I'm aiming at is to go
>> >>> through
>> >>> a file (it's a file calling other packages and functions therein.)
>> >>> line by
>> >>> line, just like in matlab. The first step is to step in the file using
>> >>> gallium. I know how to traverse a function in terminal using Gallium.
>> >>> But it
>> >>> seems that I can't enter a file by doing the same thing like:
>> >>>
>> >>> julia> @enter test.jl
>> >>> ERROR: BoundsError: attempt to access 0-element Array{Int64,1} at
>> >>> index
>> >>> [0]
>> >>>
>> >>>
>> >>> How can I enter a file via Gallium? Is it possible at all? Thanks.
>> >>
>> >>
>> >
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

chobbes158
Bump up for the following question:

Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A?
A = ...
function_to_debug
(A)
...
...
A
= ...
function_to_debug
(A)

Seems that the only choice is to use breakpoint. Any other means without resorting to breakpoints??
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

Isaiah Norton
Any other means without resorting to breakpoints??

Use `@enter function_to_debug( ... )` with the value of A that you are interested in. 

On Mon, Nov 21, 2016 at 6:30 AM, <[hidden email]> wrote:
Bump up for the following question:

Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A?
A = ...
function_to_debug
(A)
...
...
A
= ...
function_to_debug
(A)

Seems that the only choice is to use breakpoint. Any other means without resorting to breakpoints??

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

chobbes158
Well, if A is a complicated object/structure, it'll be almost impossible to first make up an A and call @enter function_to_debug(A).



On Monday, November 21, 2016 at 2:32:16 PM UTC, Isaiah wrote:
Any other means without resorting to breakpoints??

Use `@enter function_to_debug( ... )` with the value of A that you are interested in. 

On Mon, Nov 21, 2016 at 6:30 AM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ga77MuO6CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">chobb...@...> wrote:
Bump up for the following question:

Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A?
A = ...
function_to_debug
(A)
...
...
A
= ...
function_to_debug
(A)

Seems that the only choice is to use breakpoint. Any other means without resorting to breakpoints??

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

Isaiah Norton
If breakpoints aren't working, I would suggest to your push object(s) of interest into a global Vector{Any} and then debug with `@enter`.

On Mon, Nov 21, 2016 at 11:00 AM, <[hidden email]> wrote:
Well, if A is a complicated object/structure, it'll be almost impossible to first make up an A and call @enter function_to_debug(A).



On Monday, November 21, 2016 at 2:32:16 PM UTC, Isaiah wrote:
Any other means without resorting to breakpoints??

Use `@enter function_to_debug( ... )` with the value of A that you are interested in. 

On Mon, Nov 21, 2016 at 6:30 AM, <[hidden email]> wrote:
Bump up for the following question:

Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A?
A = ...
function_to_debug
(A)
...
...
A
= ...
function_to_debug
(A)

Seems that the only choice is to use breakpoint. Any other means without resorting to breakpoints??


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

Michele Zaffalon
In reply to this post by chobbes158
How would you do that in MATLAB?

On Mon, Nov 21, 2016 at 5:00 PM,  <[hidden email]> wrote:

> Well, if A is a complicated object/structure, it'll be almost impossible to
> first make up an A and call @enter function_to_debug(A).
>
>
>
> On Monday, November 21, 2016 at 2:32:16 PM UTC, Isaiah wrote:
>>>
>>> Any other means without resorting to breakpoints??
>>
>>
>> Use `@enter function_to_debug( ... )` with the value of A that you are
>> interested in.
>>
>> On Mon, Nov 21, 2016 at 6:30 AM, <[hidden email]> wrote:
>>>
>>> Bump up for the following question:
>>>
>>> Suppose I have the following code where the variable A is defined
>>> multiple times and after each definition it is used by the same function
>>> function_to_debug. How can I step in function_to_debug with the first
>>> definition/instantiation of A?
>>> A = ...
>>> function_to_debug(A)
>>> ...
>>> ...
>>> A = ...
>>> function_to_debug(A)
>>>
>>> Seems that the only choice is to use breakpoint. Any other means without
>>> resorting to breakpoints??
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to enter a file using gallium?

chobbes158
In reply to this post by Isaiah Norton
That's a good stopgap, if there's better options. Thanks!!

On Monday, November 21, 2016 at 8:19:50 PM UTC, Isaiah wrote:
If breakpoints aren't working, I would suggest to your push object(s) of interest into a global Vector{Any} and then debug with `@enter`.

On Mon, Nov 21, 2016 at 11:00 AM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="kAMfo9rNCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">chobb...@...> wrote:
Well, if A is a complicated object/structure, it'll be almost impossible to first make up an A and call @enter function_to_debug(A).



On Monday, November 21, 2016 at 2:32:16 PM UTC, Isaiah wrote:
Any other means without resorting to breakpoints??

Use `@enter function_to_debug( ... )` with the value of A that you are interested in. 

On Mon, Nov 21, 2016 at 6:30 AM, <[hidden email]> wrote:
Bump up for the following question:

Suppose I have the following code where the variable A is defined multiple times and after each definition it is used by the same function function_to_debug. How can I step in function_to_debug with the first definition/instantiation of A?
A = ...
function_to_debug
(A)
...
...
A
= ...
function_to_debug
(A)

Seems that the only choice is to use breakpoint. Any other means without resorting to breakpoints??


Loading...