public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* Group section
@ 2017-03-21 19:39 SASHA NICOLAS DA ROCHA PINHEIRO
  2017-03-21 19:53 ` Josh Stone
  0 siblings, 1 reply; 4+ messages in thread
From: SASHA NICOLAS DA ROCHA PINHEIRO @ 2017-03-21 19:39 UTC (permalink / raw)
  To: jistone, elfutils-devel


Hi Josh
I am getting error on the following code, and it looks like to be related to group sections.
As you can see I changed the dwarf_elf_init to dwarf_begin_elf, but passed NULL on the third parameter.
Do you know how should I actually deal with it? 

  91 bool DwarfHandle::init_dbg()                                                     
 92 {                                                                                
 93     //int status;                                                                
 94     //Dwarf_Error err;                                                           
 95     if (init_dwarf_status == dwarf_status_ok) {                                  
 96         return true;                                                             
 97     }                                                                            
 98                                                                                  
 99     if (init_dwarf_status == dwarf_status_error) {                               
100         return false;                                                            
101     }                                                                            
102                                                                                  
103     //status = dwarf_elf_init(file->e_elfp(), DW_DLC_READ,                       
104     //                       err_func, &file_data, &file_data, &err);            
105                                                                                  
106     file_data = dwarf_begin_elf(file->e_elfp(), DWARF_C_READ, NULL);             
107     cerr << "Error message:" << dwarf_errmsg(-1) << endl;                        
108     if (!file_data) {                                                            
109         init_dwarf_status = dwarf_status_error;                                  
110         return false;                                                            
111     } 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Group section
  2017-03-21 19:39 Group section SASHA NICOLAS DA ROCHA PINHEIRO
@ 2017-03-21 19:53 ` Josh Stone
  2017-03-21 20:46   ` SASHA NICOLAS DA ROCHA PINHEIRO
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Stone @ 2017-03-21 19:53 UTC (permalink / raw)
  To: SASHA NICOLAS DA ROCHA PINHEIRO, elfutils-devel

On 03/21/2017 12:38 PM, SASHA NICOLAS DA ROCHA PINHEIRO wrote:
> 
> Hi Josh
> I am getting error on the following code, and it looks like to be related to group sections.

What is the error?

> As you can see I changed the dwarf_elf_init to dwarf_begin_elf, but passed NULL on the third parameter.
> Do you know how should I actually deal with it? 
> 
>   91 bool DwarfHandle::init_dbg()                                                     
>  92 {                                                                                
>  93     //int status;                                                                
>  94     //Dwarf_Error err;                                                           
>  95     if (init_dwarf_status == dwarf_status_ok) {                                  
>  96         return true;                                                             
>  97     }                                                                            
>  98                                                                                  
>  99     if (init_dwarf_status == dwarf_status_error) {                               
> 100         return false;                                                            
> 101     }                                                                            
> 102                                                                                  
> 103     //status = dwarf_elf_init(file->e_elfp(), DW_DLC_READ,                       
> 104     //                       err_func, &file_data, &file_data, &err);            
> 105                                                                                  
> 106     file_data = dwarf_begin_elf(file->e_elfp(), DWARF_C_READ, NULL);             
> 107     cerr << "Error message:" << dwarf_errmsg(-1) << endl;                        
> 108     if (!file_data) {                                                            
> 109         init_dwarf_status = dwarf_status_error;                                  
> 110         return false;                                                            
> 111     } 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Group section
  2017-03-21 19:53 ` Josh Stone
@ 2017-03-21 20:46   ` SASHA NICOLAS DA ROCHA PINHEIRO
  2017-03-21 21:24     ` Mark Wielaard
  0 siblings, 1 reply; 4+ messages in thread
From: SASHA NICOLAS DA ROCHA PINHEIRO @ 2017-03-21 20:46 UTC (permalink / raw)
  To: Josh Stone, elfutils-devel

That's the problem. It says "no error" once, in another call it says "no reference value", and in another call "no DWARF information".
 
 
De: Josh Stone <jistone@redhat.com>
Enviado: terça-feira, 21 de março de 2017 14:53:12
Para: SASHA NICOLAS DA ROCHA PINHEIRO; elfutils-devel@sourceware.org
Assunto: Re: Group section
    
On 03/21/2017 12:38 PM, SASHA NICOLAS DA ROCHA PINHEIRO wrote:
> 
> Hi Josh
> I am getting error on the following code, and it looks like to be related to group sections.

What is the error?

> As you can see I changed the dwarf_elf_init to dwarf_begin_elf, but passed NULL on the third parameter.
> Do you know how should I actually deal with it? 
> 
>   91 bool DwarfHandle::init_dbg()                                                    
>  92 {                                                                               
>  93     //int status;                                                               
>  94     //Dwarf_Error err;                                                          
>  95     if (init_dwarf_status == dwarf_status_ok) {                                 
>  96         return true;                                                            
>  97     }                                                                           
>  98                                                                                 
>  99     if (init_dwarf_status == dwarf_status_error) {                              
> 100         return false;                                                           
> 101     }                                                                           
> 102                                                                                 
> 103     //status = dwarf_elf_init(file->e_elfp(), DW_DLC_READ,                      
> 104     //                       err_func, &file_data, &file_data, &err);           
> 105                                                                                 
> 106     file_data = dwarf_begin_elf(file->e_elfp(), DWARF_C_READ, NULL);            
> 107     cerr << "Error message:" << dwarf_errmsg(-1) << endl;                       
> 108     if (!file_data) {                                                           
> 109         init_dwarf_status = dwarf_status_error;                                 
> 110         return false;                                                           
> 111     } 
> 

    

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Group section
  2017-03-21 20:46   ` SASHA NICOLAS DA ROCHA PINHEIRO
@ 2017-03-21 21:24     ` Mark Wielaard
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2017-03-21 21:24 UTC (permalink / raw)
  To: SASHA NICOLAS DA ROCHA PINHEIRO; +Cc: Josh Stone, elfutils-devel

On Tue, Mar 21, 2017 at 08:46:25PM +0000, SASHA NICOLAS DA ROCHA PINHEIRO wrote:
> That's the problem. It says "no error" once, in another call it says
> "no reference value", and in another call "no DWARF information".
> [...]
> > 106     file_data = dwarf_begin_elf(file->e_elfp(), DWARF_C_READ, NULL);            
> > 107     cerr << "Error message:" << dwarf_errmsg(-1) << endl;                       
> > 108     if (!file_data) {                                                           
> > 109         init_dwarf_status = dwarf_status_error;                                 
> > 110         return false;                                                           
> > 111     } 

Note that if file_data != NULL then the result of dwarf_errmsg (-1)
is undefined. You should first check file_data == NULL before calling
dwarf_errmsg (-1).

Cheers,

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-21 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 19:39 Group section SASHA NICOLAS DA ROCHA PINHEIRO
2017-03-21 19:53 ` Josh Stone
2017-03-21 20:46   ` SASHA NICOLAS DA ROCHA PINHEIRO
2017-03-21 21:24     ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).