public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* automate gdb convenience var issue
@ 2019-06-26  7:00 queency3.yahoo.com via gdb
  2020-02-04 11:54 ` Matthew Malcomson
  0 siblings, 1 reply; 2+ messages in thread
From: queency3.yahoo.com via gdb @ 2019-06-26  7:00 UTC (permalink / raw)
  To: gdb

Hi all
I'm logging gdb output to files.
i'm after logging addersses output .

i read this log output with shell,grep,awk and i'm trying to get the input to convenience vars with no luck !!

is there any solution for my needs ?

if there is any way to use gdb output with grep awk and such within gdb ,its even preferable .

thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: automate gdb convenience var issue
  2019-06-26  7:00 automate gdb convenience var issue queency3.yahoo.com via gdb
@ 2020-02-04 11:54 ` Matthew Malcomson
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Malcomson @ 2020-02-04 11:54 UTC (permalink / raw)
  To: queency3, gdb; +Cc: nd

Resending without disclaimer so it gets to the mailing list.


On 26/06/2019 08:00, queency3.yahoo.com via gdb wrote:
> Hi all
> I'm logging gdb output to files.
> i'm after logging addersses output .
> 
> i read this log output with shell,grep,awk and i'm trying to get the input to convenience vars with no luck !!
> 
> is there any solution for my needs ?
> 
> if there is any way to use gdb output with grep awk and such within gdb ,its even preferable .
> 
> thanks.
> 

Hi there,

I do something similar in my plugin.

I don't know if there's some way to do this directly, but it's pretty 
easy with a python function.

The code here generates a gdb.Value for each address written in a file.
https://github.com/hardenedapple/gdb-walkers/blob/9a0e05d4b6925013ad97e10a4125332efb09e835/walker_defs.py#L1063-L1066

That uses a helper function `as_voidptr`, which would be replaced by

<the value>.cast(gdb.lookup_type('void').pointer())

You can assign a gdb.Value to a convenience variable with
`gdb.set_convenience_variable`.


Hopefully that would work for you.
MM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-04 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26  7:00 automate gdb convenience var issue queency3.yahoo.com via gdb
2020-02-04 11:54 ` Matthew Malcomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).