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.