0

I am using c in eclipse to write a program. I need to use GDB to debug it step by step. However on a longjmp command (when i try to save the context of a stack) GDB crashes inside eclipse (because there is a breakpoint there?) Is there any way around this? I have scoured the internets for the past six hours and cannot seem to be able to find a solution. Here is the line of code where it is crashing

if(setjmp(p->jbContext) == 0)
    longjmp(context_buf,1);

I would be very very grateful to anyone that can help.

Thanks!

EDIT: After further searching I found this webpage but have no clue as to how to use it.

http://www.delorie.com/gnu/docs/gdb/gdb_271.html

Assistance would be appreciated!

caf
  • 233,326
  • 40
  • 323
  • 462
Falcata
  • 679
  • 1
  • 15
  • 23

1 Answers1

0

If it is really gdb which crashes, you could consider (after reporting the bug to them) install a newer version of it. Latest GDB is version 7.3.1 -you can compile it from its source code if needed. If you are brave and the bug persists with the latest version, try to find the bug and propose a patch.

My experience with gdb crashes (which are rare) is that getting and building the newest version helps a lot. Many Linux distributions don't ship a very recent GDB.

Of course, you might need to upgrade your GCC compiler also: the debugging information that is generated has also improved.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547