Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tcf-dev] Errors from get_regs_PC are not handled

Hi,

 

I  have run into a case when get_regs_PC goes wrong, but the get_sym_context in symbols_elf.c does not notice this error so code keeps on running. The problem I run into is running this function (which calls context_read_reg) with a context that is not active. This will make get_regs_PC return 0 with errno set to ERR_NOT_ACTIVE. After running a while errno will be cleared and this error will never be discovered.

 

The following patch for symbols_elf.c would solve my problem:

         }

         sym_ip = get_regs_PC(ctx);

+        if (errno != 0)

+                return -1;

         if (cache_miss_count() > cnt) {

             /* The value of the PC (0) is incorrect. */

 

But I see that everywhere get_regs_PC is used there is no error check. Is this intentional? Is this function supposed to always work correctly?

 

Thanks,

Andreas

 

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Back to the top