473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to do partial matches in GDB using python scripts

Hi,
I have .cc code with singleton instances. Now I want to write a python script which runs on .cc code and does string match. The string to be matched is given outside the .py code by calling the function with the string. The script should then print the address of the string for me. I want to how do we do this in GDB. Also how to call functions of the .py script from outside the code. because I do something like below and it gives me error.
set x = methodname(foo::FooManager)
print $x

It gives me error saying x is not defined in the current context.

I have a function named methodname in my .py script.
Jun 17 '16 #1
3 1360
dwblas
626 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1. set x = methodname(foo::FooManager)
  2. print $x 
is not Python. Are you parsing this code using a Python program. If so, show how you read the file.
Jun 17 '16 #2
I am doing it in GDB from outside the python code. I have a python script which does the string match on .cc code. I am calling the function in .py from outside the code using the syntax above. I do all this in GDB. I am not sure if the syntax is right, as it doesn't work.
Jun 17 '16 #3
dwblas
626 Expert 512MB
The Python Wiki has a write up on GDB at https://wiki.python.org/moin/DebuggingWithGdb Other than that, "It gives me error saying x is not defined in the current context" is not enough info to do anything with.
Jun 17 '16 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Shufen | last post by:
Hi, Can someone please advice me on the differences between this: #!/usr/bin/env python and these: #!/usr/local/bin/python or #!/usr/bin/python? I know the first one locates the Python...
8
by: Ben Sizer | last post by:
I'd like to be able to drag a file onto a Python script in Windows Explorer, or send that file to the script via the Send To context-menu option, so I can then process that file via sys.argc. ...
1
by: DropIn | last post by:
Sheesh! I was doing research on using batch files as drop targets when I came across a python discussion thread on this site with the same topic. I thought I would share what I had learned (the...
20
by: Ramdas | last post by:
How do I add users using Python scripts on a Linux machine? Someone has a script?
0
by: P. Adhia | last post by:
Hello, I was wondering if anyone is successfully using using Python(2.5)+DB2+pydb2. I get an error in all situations. It seems that this problem might be limited to python 2.5. A quick Google...
0
by: davidj411 | last post by:
when does is make sense to use a ASP style Page (.psp) over a Python- based CGI script with IIS. ? http://support.microsoft.com/kb/276494 ASP requires registering the python engine. which...
0
by: chitras1984 | last post by:
Hi Could anyone help to get the log message using the python script And to stop the commit when the log message is empty Thanks Chitra
4
by: balnair | last post by:
I have a shell file in location /home/transfer/check.sh I need to excecute this shell file using python script
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.