Wanyi
068e1796ba
[lldb][swig] Support SBFileSpec::GetPath (#162964)
# Summary
`SBFileSpec::GetPath(char *dst_path, size_t dst_len)` contains `char*`
type argument. Need to handle this for python. Fortunately there're
already similar definitions we can reuse.
# Test Plan
Start the freshly built lldb and run the following code
```
$ lldb
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> debugger = lldb.SBDebugger.Create()
>>> debugger.SetAsync (False)
>>> target = debugger.CreateTarget("~/tmp/hello")
>>> target.IsValid()
True
>>> breakpoint = target.BreakpointCreateByName('main', 'hello')
>>> breakpoint.GetNumLocations()
1
>>> process = target.LaunchSimple (None, None, os.getcwd())
>>> process.IsValid()
True
>>> thread = process.GetThreadAtIndex(0)
>>> frame = thread.GetFrameAtIndex(0)
>>> line = frame.GetLineEntry()
# Important line below
>>> file = line.GetFileSpec().GetPath(1024)
# Important line above
>>> print(file)
/home/wanyi/tmp/main.cpp
```
## Before this change
```
$ lldb
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> debugger = lldb.SBDebugger.Create()
>>> debugger.SetAsync (False)
>>> target = debugger.CreateTarget("~/tmp/hello")
>>> target.IsValid()
True
>>> breakpoint = target.BreakpointCreateByName('main', 'hello')
>>> breakpoint.GetNumLocations()
1
>>> process = target.LaunchSimple (None, None, os.getcwd())
>>> process.IsValid()
True
>>> thread = process.GetThreadAtIndex(0)
>>> frame = thread.GetFrameAtIndex(0)
>>> line = frame.GetLineEntry()
>>> file = line.GetFileSpec().GetPath(1024)
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: SBFileSpec.GetPath() missing 1 required positional argument: 'dst_len'
>>> print(file)
Traceback (most recent call last):
File "<console>", line 1, in <module>
NameError: name 'file' is not defined
```
2025-10-13 12:24:12 -06:00
..
2025-02-28 14:59:35 +00:00
2025-09-04 17:23:18 +05:00
2024-02-16 20:58:50 -08:00
2025-10-07 15:36:47 -04:00
2025-10-13 12:24:12 -06:00
2025-05-01 16:01:50 -07:00
2024-02-21 13:02:30 -06:00
2025-08-13 14:15:45 -07:00
2024-02-21 13:02:30 -06:00
2024-02-21 13:02:30 -06:00
2024-07-15 17:28:56 +02:00
2024-09-11 16:04:01 +03:00
2025-05-27 18:41:16 -07:00
2025-05-13 17:52:23 +02:00
2025-10-10 19:23:02 +01:00
2025-02-04 10:42:08 -08:00
2024-02-21 13:02:30 -06:00
2024-02-16 20:58:50 -08:00
2024-02-16 20:58:50 -08:00
2025-05-27 18:41:16 -07:00
2025-08-11 10:26:57 -07:00
2024-02-21 13:02:30 -06:00
2024-02-16 20:58:50 -08:00
2025-08-19 14:24:10 -07:00
2025-03-08 09:10:46 -08:00
2025-07-18 13:05:15 -07:00
2025-09-04 08:34:34 -07:00
2025-10-13 14:52:30 +01:00
2025-05-05 20:53:04 +05:00
2025-07-08 09:55:18 +01:00
2025-05-20 07:44:58 +02:00
2025-05-27 18:41:16 -07:00
2025-02-28 14:59:35 +00:00
2025-05-27 18:41:16 -07:00
2025-07-17 14:24:05 +00:00
2025-05-27 18:41:16 -07:00
2025-08-18 12:47:14 -05:00
2024-06-26 15:59:07 +01:00
2025-06-19 11:12:34 +04:00