[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Aug 28 10:37:40 PDT 2025
DavidSpickett wrote:
There is also `lldb/test/API/functionalities/json/symbol-file/TestSymbolFileJSON.py` which is almost what we want.
I got this to work:
```
{
"triple": "aarch64--linux",
"uuid": "A2180C69-2DC0-DE61-3689-5CDC84D0AB63-A898EE40",
"sections": [
{
"name": "globals",
"type": "data",
"address": 1297224342667202580,
"size": 16
}
],
"symbols": [
{
"name": "a_global_tagged",
"size": 8,
"type": "data",
"address": 1297224342667202580
}
]
}
```
We can get all this info from the running program to build the file during the test.
```
(lldb) target symbol add ~/symbol.json
symbol file '/home/david.spickett/symbol.json' has been added to '/tmp/test.o'
(lldb) p &a_global
(void **) 0x0000aaaaaaab1014
(lldb) p &a_global_tagged
(void **) 0x1200aaaaaaab1014
(lldb) p (void*)return_ptr(&a_global)
(void *) 0x0000aaaaaaab1014
(lldb) p (void*)return_ptr(&a_global_tagged)
(void *) 0x1200aaaaaaab1014
```
I'm passing the address here otherwise we have no way to know the bits were or were not stripped.
I think that's not enough though right? We need some `function(variable_name)` where loading `variable_name` via an untagged pointer fails. Or via a tagged pointer?
Anyway you see the idea here. Tell me if that could be made to work.
https://github.com/llvm/llvm-project/pull/153585
More information about the lldb-commits
mailing list