Comments (13)
Please close the issue if the macro work around works for you.
from capstone.
The installed version of libbpf is (I think) v1.3...the GitHub repo for libbpf still has the struct bpf_insn;
but at line 334
https://github.com/libbpf/libbpf/blob/6d3595d215b014d3eddb88038d686e1c20781534/src/libbpf.h#L334
from capstone.
@Rot127 sorry to tag you direct, just wondering if you had any thoughts on this?
from capstone.
There seems to be something off with the includes. Can you try to cherry-prick this commit: Rot127@7d746b5
from capstone.
Also possibly related: #2307
from capstone.
Just saw you use make
. Please use cmake
. The Makefile
method is considered deprecated. Also, please share a minimal example for me to test.
from capstone.
@grahamwoodward
Regarding #2307 (comment), yes, please try Rot127@7d746b5. But it likely doesn't work.
Your problem comes likely from including headers in an order which creates the conflict.
If you have one file where the CS header and the libbpf
header are included in the same file (or indirectly through other headers), you would need to change this.
Please write the result in this issue, not the PR.
Regarding #2307 (comment)
This is not an option for us, unfortunately. You can do it of course locally, but we can not change the name that easily.
from capstone.
hmm so how do we fix it? The perf tool I'm working on might be made public with a dependency on Capstone and BPF so this will need fixing somehow
from capstone.
Also
Regarding #2307 (comment)
This is not an option for us, unfortunately. You can do it of course locally, but we can not change the name that easily.
why can't this be done? Because of people using Capstone would need to update their code to accommodate the enum name change?
from capstone.
why can't this be done? Because of people using Capstone would need to update their code to accommodate the enum name change?
Yes, we would need to change the names for all the archs in the API. So we are consistent with naming. This in turn would force everyone to fix their code with the new names. And Capstone tries to be as stable as possible between versions.
hmm so how do we fix it?
As far as I can see, you will need to do something like this. So you can add the cs_
prefix with the macro when you need it.
from capstone.
why can't this be done? Because of people using Capstone would need to update their code to accommodate the enum name change?
Yes, we would need to change the names for all the archs in the API. So we are consistent with naming. This in turn would force everyone to fix their code with the new names. And Capstone tries to be as stable as possible between versions.
It's only the "bpf arch" that needs the change, i.e in include/capstone/bpf.h
hmm so how do we fix it?
As far as I can see, you will need to do something like this. So you can add the
cs_
prefix with the macro when you need it.
I'm not convinced this works...but going to play with it to see whether I can use this trick
from capstone.
I'm not convinced this works...but going to play with it to see whether I can use this trick
hhmm this might be working actually...
+ 8 #include <capstone/capstone.h>
+ 9 #define bpf_insn cs_bpf_insn
+ 10 #include <linux/bpf.h>
+ 11 #include <bpf/libbpf.h>
+ 12 #undef cs_bpf_insn
13
from capstone.
Closing as no fix planned. Workaround available as per #2316 (comment)
from capstone.
Related Issues (20)
- Ability to Generate Bitmasks for Specific Instruction Components? HOT 3
- x64 disassembler big endian bug
- Compiler warnings in the next branch HOT 2
- python bindings depends on setuptools HOT 3
- Remove python2 leftovers
- [AArch64] Instr. with groups `HasNEON`, don't have `HasNEONorSME` and similar assigned. HOT 25
- Release v4.0.3
- Wrong operand type for RISCV compressed instruction disassemble
- [5.0.1] Warning in Mapping.c module
- [Auto-Sync] Add `PatchFiles` and `WriteFiles` steps to `ASUpdater`
- [Auto-Sync] Smarter MC test generator
- Add documentation about LLVM imported `FEATURE` groups.
- ARM64_REG_Vx vs. ARM64_REG_Qx HOT 1
- Capstone v5 compile issues HOT 1
- Capstone Next Bug in code. modRMRequired has an invalid index read
- register accesses for Implicit operands
- Add "DIET" CI job
- Incorrect aarch64 umov decoding HOT 3
- ARM AArch32 instruction ADD may decode wrong in ADR situation HOT 3
- HPPA, ARM disassemblers "error: comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits]"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capstone.