poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH V2] pickles: ctf: add new pickle ctf-dump.pk for dumping CTF


From: Jose E. Marchesi
Subject: Re: [PATCH V2] pickles: ctf: add new pickle ctf-dump.pk for dumping CTF section
Date: Fri, 26 Feb 2021 09:55:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Indu.

Thanks for the updated patch.

> +/* Dump CTF information in the variable length number of bytes following the
> +   CTF Type.  */
> +
> +fun ctf_dump_vlen_data = (CTF_Dictionary ctf, CTF_Type t) void:
> +{
> +  try
> +    {
> +      ctf_dump_int (t.data.integer);
> +      return;
> +    }
> +  catch if E_elem {};
> +
> +  try
> +    {
> +      ctf_dump_array (t.data.array);
> +      return;
> +    }
> +  catch if E_elem {};
> +
> +  try
> +    {
> +      ctf_dump_slice (ctf, t.data.slice);
> +      return;
> +    }
> +  catch if E_elem {};
> +
> +  try
> +    {
> +      ctf_dump_sou_members (ctf,t.data.members);
> +      return;
> +    }
> +  catch if E_elem {};
> +
> +  try
> +    {
> +      ctf_dump_enum (ctf, t.data.enum);
> +      return;
> +    }
> +  catch if E_elem {};
> +
> +  /* XXX CTF_Func_Args declaration scoped within CTF_Type is not available.  
> */
> +  try
> +    {
> +      ctf_dump_func (ctf, t);
> +      return;
> +    }
> +  catch if E_elem {};
> +}

The union alternatives are exclusive.  This means you don't really need
to return every time.  This would work as well:

fun ctf_dump_vlen_data = (CTF_Dictionary ctf, CTF_Type t) void:
{
  try ctf_dump_int (t.data.integer);
  catch if E_elem {};

  try ctf_dump_array (t.data.array);
  catch if E_elem {};

  try ctf_dump_slice (ctf, t.data.slice);
  catch if E_elem {};

  try ctf_dump_sou_members (ctf,t.data.members);
  catch if E_elem {};

  try ctf_dump_enum (ctf, t.data.enum);
  catch if E_elem {};

  /* XXX CTF_Func_Args declaration scoped within CTF_Type is not available.  */
  try ctf_dump_func (ctf, t);
  catch if E_elem {};
}



reply via email to

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