|
Bugzilla – Full Text Bug Listing |
| Summary: | gdb fails to retrieve "optarg" correctly | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE Linux 10.1 | Reporter: | Marcus Meissner <meissner> |
| Component: | Development | Assignee: | Andreas Schwab <schwab> |
| Status: | RESOLVED INVALID | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | pth |
| Version: | Beta 7 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | xx.c | ||
Created attachment 72258 [details]
xx.c
gdb is just reporting what the debug info delivers. The symbol you want is called 'optarg@@GLIBC_2.2.5'. What i want is that gdb shows me the right content of my variables. Do i understand that correctly that i had to type 'print optarg@@GLIBC_2.2.5' to see the value of what is called 'optarg' in my sources? Where in the docs can i read about that? |
gdb cannot show the content if "optarg", a global glibc variable, correctly. The following sample program shows this behaviour: (gdb) break main Breakpoint 1 at 0x4004ec: file xx.c, line 4. (gdb) r Starting program: /suse/meissner/xx Breakpoint 1, main () at xx.c:4 4 return optarg; (gdb) disp /i $eip Disabling display 1 to avoid infinite recursion. 1: x/i $eip Value can't be converted to integer. (gdb) disp /i $rip 2: x/i $rip 0x4004ec <main+4>: mov 1049517(%rip),%rax # 0x5008a0 <optarg@@GLIBC_2.2.5> (gdb) si 5 } 2: x/i $rip 0x4004f3 <main+11>: leaveq (gdb) print optarg $1 = 0x0 (gdb) print &optarg $2 = (char **) 0x2ae8237f9cc0 (gdb) print &optarg should have shown 0x5008a0.