Issue 64855
Summary Python LLDB API: Process execution stuck on __sync_add_and_fetch system call
Labels new issue
Assignees
Reporter aadityasinha10
    I have written a python LLDB API code in which I am attaching LLDB debugger to a remote Android HAL process.

I have created a list of breakpoints by parsing all the function names in one of the folders of the source code and am adding each function name as `SBTarget.BreakpointCreateByName(breakpoint)`. In the api code, whenever a breakpoint is hit, I am doing some processing using the function stack and then calling `SBProcess.Continue()`. 

This is working fine for most of the folders in the source code, but for one particular folder, a particular breakpoint is being "hit" in a loop or rather it seems like the process execution gets stuck at that function call. This behavior is similar to the behavior I mentioned in a previous issue I had raised: [Issue 63923](https://github.com/llvm/llvm-project/issues/63923).

I observed two things:

1.) I looked at the contents of that function and its body is just `return (_sync_add_and_fetch(var,0));`. This function is apparently being "inlined" as well, as observed from listing the breakpoints set via the lldb command line tool in Ubuntu.
2.) This function is not a part of the list of function names that I generated from parsing the cpp files in that folder, and nor is it being listed as a function in one of the breakpoint locations after I've added all the breakpoints in the python lldb api code, but somehow, it is still being treated as a breakpoint.

```
for i in range(self.target.GetNumBreakpoints()):
            breakpoint = self.target.GetBreakpointAtIndex(i)
            numLocations = breakpoint.GetNumLocations()
            for l_i in range(numLocations):
                location = breakpoint.GetLocationAtIndex(l_i)
                function = location.GetAddress().GetFunction().GetName()
                if (function is not None and "Atomic" in function):
 print("Function",function,"found.")
```
For example, I thought the above code should print the name of that function, but it didn't.

What could be happening here and how should I deal with it? Any help would be greatly appreciated.
Thank you.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to