Skip to main content

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

Hi, Eugene,

 

I noticed that my change lead to other problems when doing other symbol lookups.

My problem was that the behavior on Linux and Windows was different. Because during the Windows lookup I have two readers, one for ELF and one for PE. Even though I am reading an ELF file it enters the PE reader, then that fails because it cannot read memory. So I wanted the same behavior on Linux as on Windows. But you can probably ignore this, I will work around it in another way.

 

Thanks,

Andreas

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Eugene Tarassov
Sent: Thursday, November 3, 2016 7:20 PM
To: TCF Development <tcf-dev@xxxxxxxxxxx>
Subject: Re: [tcf-dev] Errors from get_regs_PC are not handled

 

Hi Andreas,

 

In some cases, we do want PC access error to be ignored. Planting a breakpoint would be one example – address of a sane breakpoint should be same regardless of current PC.

 

I cannot tell if such change would cause a regression. Why exactly this is a problem?

 

Regards,

Eugene

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Ragnerstam, Andreas
Sent: Thursday, November 03, 2016 5:49 AM
To: 'tcf-dev@xxxxxxxxxxx'
Subject: [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.



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

----------------------------------------------------------------------
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