Comments (16)
That's a pretty good idea. Will add that.
Thanks!
from gef.
It should be working as expected. Let me know if you find bugs.
from gef.
Confirmed works on x86, ARM, PowerPC for gdb
> 7.9 (for gdb.find_pc_line()
)
from gef.
By >7.9 you mean it only works on 7.10? I re-enabled the exception printing and I get:
[!] in `context_source, exception raised: 'utf-8' codec can't decode byte 0xa9 in position 96: invalid start byte
ben@shitweasel:~/src/jxrlib$ gdb -version
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
from gef.
Which version of python are you using inside gdb ?
from gef.
I don't know how to check that. System python is 2.7 but I thought gdb always links against 3 now? I'll google tomorrow :P
from gef.
Open a python shell in gdb ("pi" command), then
import sys
sys.version
from gef.
@bnagy $ gdb -nx -ex 'python print (sys.version)' -ex quit
from gef.
'3.4.3 (default, Mar 26 2015, 22:07:14) \n[GCC 4.9.2]'
from gef.
I've setup an Ubuntu 14.04 with gdb 7.7 and python 3.4, could get your error triggered again.
Is it happening against all your bins ? Or just one ?
from gef.
It's just one, by the looks - AND the source file happens to have a non-utf-8 character in the source file, so that sounds like a good chance to be the problem. I tried a quick guess from @bsmt using return buf.decode("utf-8", "ignore")
in read_string
but that didn't work - maybe I missed something or that's the wrong place to try and ignore bad UTF-8.....
from gef.
Do you have a sample somewhere I can download so I try to reproduce locally ?
from gef.
Can't really, with this one... you should be able to put any non utf-8 char in the source though like from http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
For now, I think I can run the codebase through iconv, which solves my immediate issue as per http://superuser.com/a/49147 (which is a possible workaround for anyone else with the issue, but hopefully it's easy to fix ;)
from gef.
Have you tried changing the charset (https://sourceware.org/gdb/onlinedocs/gdb/Character-Sets.html#Character-Sets) ? (set target-charset
in gdb)
from gef.
I tried set target-charset WINDOWS-1252
with no luck. Fixing the source files via iconv still works. If you can't work out a way to clean / change the encoding in the plugin then it's probably OK to close this issue, or just open a new one for the encoding problem (since the enhancement is complete)
Thanks again for the tool :)
PS: Inplace fixing didn't seem to work for me. This script does.
#! /bin/sh
find . -name '*.c' -exec iconv --verbose -f windows-1252 -t utf-8 -o {}.fix {} \;
find . -name "*.c" -delete
find . -name "*.c.fix" -exec rename 's/\.fix$//' {} \;
from gef.
I haven't been able to find a clean so I guess I will do as you suggest and close the ticket keeping in mind your little script in case this issue happens again in the future.
Thanks for the feedbacks, always appreciated :)
from gef.
Related Issues (20)
- Question about pyenv HOT 6
- [Docs] Add `pre-commit` documentation
- sth. about function and UI HOT 1
- gef for windows HOT 4
- The Gef Frame Is small HOT 2
- [Bug] AssertionError HOT 5
- Possible GEF `dereference` issue with `gef-remote` HOT 7
- Add support for LLDB HOT 1
- [Bug] GEF supports Python 3.6+ but uses f-string debugging only introduced in Python 3.8+, breaking compatibility
- [Bug] vmmap command 'offset' column actually shows size HOT 1
- [Bug] SyntaxError: unterminated triple-quoted string literal HOT 1
- display bug , after some commands ,there will be a wrong display HOT 10
- Python Exception <class 'RuntimeError'>: No session started HOT 5
- Alpine dependencies HOT 2
- variable name causes problems
- General Maintenance HOT 2
- [Bug] 'gef-remote' failed to execute properly, reason: [Errno 17] File exists HOT 4
- can i only print selected thread in ctx? HOT 1
- Add support for registers in `target remote` post hook HOT 6
- Move GEF to Python 3.10 baseline
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 gef.