<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62111>62111</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lldb adding range has a base that is less than the function's low PC
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yangyibiao
</td>
</tr>
</table>
<pre>
$ cat small.c
```C
volatile __PTRDIFF_TYPE__ v;
void
bar (char *p, char *q)
{
v = q - p;
v = p - q;
}
char global[10000] = {};
int
main ()
{
/* Heap allocated memory. */
char *p = (char *)__builtin_malloc (42);
bar (p, p + 20);
__builtin_free (p);
/* Global variable. */
bar (&global[0], &global[100]);
bar (&global[1000], &global[9000]);
bar (&global[500], &global[10]);
bar (&global[0], &global[10000]);
/* Stack variable. */
char stack[10000];
bar (&stack[0], &stack[100]);
bar (&stack[1000], &stack[9000]);
bar (&stack[500], &stack[10]);
return 0;
}
```
$ cat example.py
```python
#!/usr/bin/env python3
import lldb
ci = lldb.debugger.GetCommandInterpreter()
ro = lldb.SBCommandReturnObject()
while lldb.debugger.GetSelectedTarget().GetProcess().GetState() != lldb.eStateExited:
if lldb.debugger.GetSelectedTarget().GetProcess().GetState() == lldb.eStateStopped:
ci.HandleCommand('stepi', ro)
```
$ clang -O0 -g small.c
$ lldb --no-lldbinit -no-use-colors --file a.out --batch --one-line 'process launch --stop-at-entry' --one-line 'command script import example.py'
```
(lldb) target create "a.out"
Current executable set to '/root/devil/batch/a.out' (x86_64).
(lldb) process launch --stop-at-entry
Process 22141 launched: '/root/devil/batch/a.out' (x86_64)
(lldb) command script import example.py
warning: This version of LLDB has no plugin for the language "assembler". Inspection of frame variables will be limited.
error: ld-2.27.so 0x0000f808: adding range [0x0000000000007de2-0x0000000000007e53) which has a base that is less than the function's low PC 0x00000000000082e0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000f808: adding range [0x0000000000007e56-0x0000000000007e59) which has a base that is less than the function's low PC 0x00000000000082e0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000f808: adding range [0x0000000000007e5f-0x0000000000007fa2) which has a base that is less than the function's low PC 0x00000000000082e0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000d073: adding range [0x0000000000008a27-0x0000000000008a30) which has a base that is less than the function's low PC 0x0000000000008fb0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000d073: adding range [0x0000000000008b00-0x0000000000008b80) which has a base that is less than the function's low PC 0x0000000000008fb0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000d073: adding range [0x0000000000008bb0-0x0000000000008bc9) which has a base that is less than the function's low PC 0x0000000000008fb0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000d091: adding range [0x0000000000008a27-0x0000000000008a30) which has a base that is less than the function's low PC 0x0000000000008fb0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000d091: adding range [0x0000000000008b00-0x0000000000008b73) which has a base that is less than the function's low PC 0x0000000000008fb0. Please file a bug and attach the file at the start of this error message
error: ld-2.27.so 0x0000d091: adding range [0x0000000000008bb0-0x0000000000008bc9) which has a base that is less than the function's low PC 0x0000000000008fb0. Please file a bug and attach the file at the start of this error message
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWMFu2zgQ_Rr6MpAgUZZlH3yI47otUKBBk8ueDEoaSdylSJWknPjvF6Tk2LHdTVEEixYxglgkZ97Me5yhJDNjeC0RlyRdkXQ9Yb1tlF7umaz3POdMTXJV7peETqFgFkzLhAgLEq1JdENm0fB3O4x3SjDLBcJ2e_fwbf15s9k-_HX3YbuFHUlWo89oycvhKmcaCJ0Xjf--6Qi9hcPgO6GL0Ssb3QF2QJI1fIcAumfQw2wHAXw_hsrWpzE9ai1UzgRJV3EURRFJ197PwWfrsxy5tMNFy7h0OV7LhtANoTfwCVkHTAhVMIsltNgqvQ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