Issue |
135953
|
Summary |
[lldb] Issue with structure string
|
Labels |
lldb
|
Assignees |
|
Reporter |
DhruvSrivastavaX
|
As part of some of our general testing, identified the following issue:
Test case:
```
#include<stdio.h>
#include<string.h>
int main() {
enum empcats {management, research, clerical, sales};
struct
{
char name[30];
float salary;
enum empcats category;
} employee;
strcpy (employee.name, "Benjamin Franklin");
employee.salary = 118.50;
employee.category = research;
printf ("Name = %s\n", employee.name);
printf ("Salary = %6.2f \n", employee.salary);
printf ("Category = %d\n", employee.category);
if (employee.category == clerical)
printf ("Employee category is clerical \n");
else
{
printf ("Employee category is not clerical. \n");
if (employee.category == research)
{
printf ("PASSED! \n");
}
}
return (0);
}
```
Complied with clang:
`clang test2.c -o test2 -g`
And then this error is seen with the character array access:
```
(lldb) p employee
((unnamed struct)) (name = "Benjamin Franklin\0\xdfo\U00000001\0\0\0<<\U0000001c\x91\U00000001", salary = 118.5, category = research)
(lldb) p employee.name
(char[30]) "Benjamin Franklin\0\xdfo\U00000001\0\0\0<<\U0000001c\x91\U00000001"
(lldb) fr v --show-types employee
((unnamed struct)) employee = {
(char[30]) name = "Benjamin Franklin\0\xdfo\U00000001\0\0\0<<\U0000001c\x91\U00000001"
(float) salary = 118.5
(empcats) category = research
}
```
I see this issue with Mac, Linux as well as our Demo branch in AIX.
Please check.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs