Open jreybert opened 6 years ago
I'm not quite sure how to fit it into the language. In duel one can easily print many values of different types, like
(gdb) dl 1,2.0,"foo"
or, more practical
(gdb) dl root-->next->(id, name)
So, may be something like
(gdb) dl root-->next->(id //x , name //s)
But if it's an operator, then it's not very clear what its precedence and how it applies to expressions, for example:
(gdb) dl root-->next->(id , name) //x
or even
(gdb) dl root-->next//x->(id , name)
Any news about this enhancement?
Today, gdb does not care about the granularity of /x operator: it's all members.
At least, such simple granularity is at least necessary in my point of view: I can't easily use dl to review a bunch of pointers. If you are able to define and implement a per-memeber operator, it would be a real plus.
Can I help you in something? If you don't have time to implement this, I can try to do a PR, but I have to dive into your the source code, and I certainly will need your support.
Thanks. It's not a question of time, it, probably, wouldn't need much time to implement.
It's just that I don't understand how to fit the concept of these /x formats into duel.
Simple dl/x
can be implemented quickly, though. /x
is parsed in the invoke
method in __init__.py
and it should set some kind of a flag that val2str
will use to print pointers as you like it.
I tried to dive into your parser, but I start from too far, and I don't really understand where I from where to start. Any hint on how to add a new parser entry?
There is no need to modify the parser as such. I'd do something like
if arg.startswith("/x"):
hex_mode=True
arg=arg[2:]
IMO, there is a fundamental printing behavior missing here, the support of print format:
Anyway, I can't wait the next bug to really test DUEL, thanks!