Comments (10)
for example, i am usingthe following command
print *(struct list_head *)0xffff800009b7ccc8
then the out put will be
_print *(_print *(struct list_head *)0xffff800009b7ccc8
print *(
is the wrong output by debuger or cef
everytime , the first len("print *(") of letters will be added to the front of the command you typed
also the wrongly added letters will be highlighted.
from gef.
It seems like the problem comes from the boldify
line 11237 (and we should have the same issue on the other cases I guess)
Can you try this patch just to check that I'm right, please?
from gef.
diff --git a/gef.py b/gef.py
index ce95e20..4d49b2d 100644
--- a/gef.py
+++ b/gef.py
@@ -11234,7 +11234,7 @@ class GefRemoteSessionManager(GefSessionManager):
if self == GefRemoteSessionManager.RemoteMode.RR:
return Color.boldify("(rr) ")
if self == GefRemoteSessionManager.RemoteMode.GDBSERVER:
- return Color.boldify("(remote) ")
+ return "(remote) "
raise AttributeError("Unknown value")
def __init__(self, host: str, port: int, pid: int =-1, qemu: Optional[pathlib.Path] = None) -> None:
from gef.
Hm, our colorify
makes sure to use normal
at the end, and all our codes start with \033
, so I don't understand why this would happen. I also don't see it myself. What terminal emulator are you using?
from gef.
It is not related to the terminal emulator but to the readline library (which is used by gdb).
You can see it by using the up arrow to go to the previous command multiple times when having a remote connection.
What happens is that ANSI escape codes are counted by the readline library as taking actual columns in the output, while it doesn't. We need to tell it that those chars are special chars that take no place in the output so that when it computes the length of the prompt, it does not take those chars into account.
from gef.
That's exactly what the \033[xxxm is supposed to do. I've dealt with this before and never see those codes.
from gef.
I think it's \[
and \]
around each code. Can you try that?
from gef.
I think you don't understand what the issue is. You can check this thread to understand:
https://stackoverflow.com/questions/50470933/readline-confused-by-ansi-escape-sequences
That's actually what I did, by just copying what is already done on the gef>
part of the prompt.
from gef.
I understand the issue. I have \[
and \]
in my bashrc prompt to remediate it. Anyway, we'd probably only need it on the gef>
part, as well as (remote)
and the other prompts we do.
from gef.
Closing as #1103 was merged
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
- 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 1
- 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.