Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

ERROR: MethodError: no method matching start(::Gallium.NativeStack) #182

Open
josefsachsconning opened this issue Dec 20, 2016 · 0 comments

Comments

@josefsachsconning
Copy link
Collaborator

AWS-Sachs-Ubuntu$ cat ~/lib/julia/JsonDeserialize.jl/src/JsonDeserialize.jl
using JSON

import Base.deserialize

deserialize{T}(::Type{T}, json::AbstractString) = deserialize(T, JSON.parse(json))
deserialize{T}(::Type{T}, json::Dict) = T(flatten([deserialize(T, f, json) for f in fieldnames(T)])...)
deserialize{Tf}(::Type{Tf}, field::AbstractString, json::Dict) = deserialize(Tf, json[field])
deserialize{Tf<:Nullable}(::Type{Tf}, field::AbstractString, json::Dict) = haskey(json, field) ? deserialize(Tf, json[field]) : Tf()
deserialize{T}(::Type{T}, field::Symbol, json::Dict) = deserialize(fieldtype(T,field), string(field), json)
deserialize{T<:Integer}(::Type{T}, i::Integer) = T(i)
deserialize{T<:Integer}(::Type{T}, i::AbstractString) = parse(T, i)
deserialize{T<:AbstractFloat}(::Type{T}, i::AbstractFloat) = T(i)
deserialize{T<:AbstractFloat}(::Type{T}, i::AbstractString) = parse(T, i)
deserialize{T}(::Type{Nullable{T}}, x) = deserialize(T, x)

flatten{T<:Array}(A::Array{T,1}) = vcat(flatten(A)...)
flatten{T}(A::Array{T,1}) = vcat(A...)
flatten(A) = A
AWS-Sachs-Ubuntu$ /opt/julia-0.5.0-no-GPL/bin/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> using Gallium

julia> Gallium.breakpoint_on_error()
Gallium.Hooking.Hook(Ptr{Void} @0x00007fe301cf3680,UInt8[0x55,0x48,0x89,0xe5,0x53,0x48,0x89,0xfb,0x48,0x83,0xec,0x08,0xe8,0xbf,0xb1,0xfc,0xff],Gallium.breakpoint_on_error_hit)

julia> using JsonDeserialize
WARNING: requiring "JsonDeserialize" in module "Main" did not define a corresponding module.

julia> input = "{ \"bar\": { \"baz\": 17 }, \"foo\": 3.14 }";

julia> immutable Bar
           baz::Int
       end

julia> immutable Foo
           bar::Bar
       end

julia> immutable Baz
           foo::Nullable{Float64}
           bar::Bar
       end

julia> immutable Qux
           baz::Nullable{String}
           bar::Bar
       end

julia> deserialize(Qux, input)
ERROR: MethodError: no method matching start(::Gallium.NativeStack)
Closest candidates are:
  start(::SimpleVector) at essentials.jl:170
  start(::Base.MethodList) at reflection.jl:258
  start(::IntSet) at intset.jl:184
  ...
 in collect(::Base.Generator{Gallium.NativeStack,Gallium.##104#108}) at ./array.jl:303
 in breakpoint_on_error_hit(::Gallium.Hooking.Hook, ::Gallium.X86_64.ExtendedRegs) at /home/sachs/.julia/v0.5/Gallium/src/Gallium.jl:947
 in _callback(::Ptr{Void}) at /home/sachs/.julia/v0.5/Gallium/src/Hooking/Hooking.jl:289
 in callback(::Ptr{Void}) at /home/sachs/.julia/v0.5/Gallium/src/Hooking/Hooking.jl:326
 in Qux(::Nullable{Any}, ::Nullable{Any}) at ./REPL[8]:2
 in deserialize(::Type{Qux}, ::Dict{String,Any}) at /home/sachs/lib/julia/JsonDeserialize.jl/src/JsonDeserialize.jl:6
 in deserialize(::Type{Qux}, ::String) at /home/sachs/lib/julia/JsonDeserialize.jl/src/JsonDeserialize.jl:5

julia>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant