Skip to content

fix(plugin): make ida_compat.hpp self-contained (include <moves.hpp>)#38

Merged
0xeb merged 1 commit into
mainfrom
fix/ida-compat-moves-include
Jun 23, 2026
Merged

fix(plugin): make ida_compat.hpp self-contained (include <moves.hpp>)#38
0xeb merged 1 commit into
mainfrom
fix/ida-compat-moves-include

Conversation

@0xeb

@0xeb 0xeb commented Jun 23, 2026

Copy link
Copy Markdown
Member

Pre-existing build break (IDA SDK 9.3)

idasql_plugin failed to compile:

src/plugin/../lib/src/ida_compat.hpp:116: use of undeclared identifier 'bookmarks_t'

idasql_cli built fine, which is the tell.

Root cause

ida_compat.hpp's bookmarks shim (idasql_bookmarks_get_by_inode) uses bookmarks_t / lochist_entry_t / idaplace_t / tiplace_t from <moves.hpp>, but doesn't include it — it relied on ida_headers.hpp including moves.hpp (line 80) before ida_compat.hpp (line 102). The plugin (src/plugin/main.cpp:77) includes ida_compat.hpp directly with a curated header set (ida/idp/loader/kernwin/auto) that omits moves.hpp, so the type was undeclared. The CLI goes through ida_headers.hpp, so it never hit it.

Fix

#include <moves.hpp> at the top of ida_compat.hpp — the shim now includes what it uses and no longer depends on include ordering. Include guards make this free for the ida_headers.hpp path.

Verified

Full build clean: xsql, idasql, idasql_cli, idasql_plugin all built (IDA SDK 9.30). Unrelated to but discovered during #37.

The bookmarks shim references bookmarks_t/lochist_entry_t/idaplace_t/tiplace_t
from <moves.hpp> but didn't include it, relying on ida_headers.hpp pulling
moves.hpp in first. The plugin's main.cpp includes ida_compat.hpp directly with
a curated header set that omits moves.hpp, so the idasql_plugin target failed to
compile ('use of undeclared identifier bookmarks_t', ida_compat.hpp:116) on IDA
SDK 9.3 while idasql_cli (via ida_headers.hpp) built fine. Include <moves.hpp>
in the shim so it no longer depends on include ordering. (#35)
@0xeb
0xeb merged commit d4b4a9b into main Jun 23, 2026
6 checks passed
@0xeb
0xeb deleted the fix/ida-compat-moves-include branch June 23, 2026 17:46
0xeb added a commit that referenced this pull request Jun 23, 2026
… shim

bookmarks_t::get_by_inode() is 9.3-only; #35 emulated it on pre-9.3 SDKs by
scanning the store. But the collectors only ever need inode -> slot, and the
standard bookmark dirtrees key each leaf inode by the place's primary
coordinate (idaplace -> ea, tiplace -> ordinal). So invert the lookup: enumerate
the store with the stable size()/get() API and join folder info from the
dirtree inode->path map by coordinate. No get_by_inode call, no version gate --
one identical code path on every SDK (9.0-9.3).

- symbols_bookmarks: now store-driven (was dirtree-driven); also stops silently
  dropping idaplace bookmarks that lack a dirtree leaf (kNoLeafInode sentinel).
- types_bookmarks: drop the get_by_inode overlay loop; key inode_paths by ordinal.
- ida_compat.hpp: remove idasql_bookmarks_get_by_inode, the
  IDASQL_HAS_BOOKMARKS_GET_BY_INODE macro, and the now-unneeded <moves.hpp>
  include (added in #38 solely for that shim).

Verified on 9.3 (CLI + HTTP): bookmarks/local_type_bookmarks insert, folder set,
description update, delete; inode resolves to ea/ordinal exactly as get_by_inode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant