mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-25 16:57:52 +00:00
libctf: fix spurious error when rolling back to the first snapshot
The first ctf_snapshot called after CTF file creation yields a snapshot
handle that always yields a spurious ECTF_OVERROLLBACK error ("Attempt
to roll back past a ctf_update") on ctf_rollback(), even if ctf_update
has never been called.
The fix is to start with a ctf_snapshot value higher than the zero value
that ctf_snapshot_lu ("last update CTF snapshot value") is initialized
to.
libctf/
* ctf-create.c (ctf_create): Fix off-by-one error.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2019-06-28 Nick Alcock <nick.alcock@oracle.com>
|
||||||
|
|
||||||
|
* ctf-create.c (ctf_create): Fix off-by-one error.
|
||||||
|
|
||||||
2019-06-28 Nick Alcock <nick.alcock@oracle.com>
|
2019-06-28 Nick Alcock <nick.alcock@oracle.com>
|
||||||
|
|
||||||
* ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
|
* ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ ctf_create (int *errp)
|
|||||||
fp->ctf_dvhash = dvhash;
|
fp->ctf_dvhash = dvhash;
|
||||||
fp->ctf_dtnextid = 1;
|
fp->ctf_dtnextid = 1;
|
||||||
fp->ctf_dtoldid = 0;
|
fp->ctf_dtoldid = 0;
|
||||||
fp->ctf_snapshots = 0;
|
fp->ctf_snapshots = 1;
|
||||||
fp->ctf_snapshot_lu = 0;
|
fp->ctf_snapshot_lu = 0;
|
||||||
|
|
||||||
return fp;
|
return fp;
|
||||||
|
|||||||
Reference in New Issue
Block a user