[Bug mi/20752] New: MI varobj-related crash when changing executable

simon.marchi at ericsson dot com sourceware-bugzilla@sourceware.org
Mon Oct 31 15:19:00 GMT 2016


https://sourceware.org/bugzilla/show_bug.cgi?id=20752

            Bug ID: 20752
           Summary: MI varobj-related crash when changing executable
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com
  Target Milestone: ---

When a new symbol file is loaded, variable objects are supposed to be
invalidated and re-evaluated, since they refer to old type objects that go away
with the old objfile.

When the new objfile doesn't have debug symbols, it seems like this
invalidation is not done, or not done properly.

Steps to reproduce:

1. Create source file test.c with:

static int foo[2] = {9,10};

int main() {
  return foo[1] + 1;
}

2. Generate test_debug, a binary with debug info (gcc -o test_debug test.c -g3
-O0), and test_nodebug, a binary without debug info (gcc -o test_nodebug test.c
-g0 -O3).
3. Start gdb with test_debug in MI (./gdb -i mi nx test_debug)
4. Run to main (start)
5. Create a varobj for the global variable foo (-var-create foo * foo)
6. Load test_nodebug (file test_nodebug)
7. Set format of the variable (-var-set-format foo hex)

gdb crashes at step 7.

I have the feeling that it's a corner case related to:
https://sourceware.org/ml/gdb-patches/2012-07/msg00551.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list