This is the mail archive of the
cygwin
mailing list for the Cygwin project.
no callstack after assert
- From: Mick Charles Beaver <m dot charles dot beaver at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 25 Nov 2014 14:49:33 -0600
- Subject: no callstack after assert
- Authentication-results: sourceware.org; auth=none
Hello,
I was poking around with gcc and gdb and found that when I hit an
assert, I did not have a valid callstack/backtrace. Is this expected?
A little info:
* I am using Windows 7 and 8, 64-bit.
* I used the latest gcc (4.8.3) and gdb (7.8) that a fresh cygwin installed.
* uname -a reports:
CYGWIN_NT-6.1 C-MICKB 1.7.33-2(0.280/5/3) 2014-11-13 15:47 x86_64 Cygwin
* I compiled my program like so: gcc -g test_asserts.c
* I get a valid backtrace before the assert hits.
Thanks for any pointers,
Mick
#include <assert.h>
#include <stdio.h>
void
print_positive_int(int value)
{
assert(value > 0);
printf("Your positive int is %d\n", value);
}
int
main(int argc, char *argv[])
{
print_positive_int(3);
print_positive_int(2);
print_positive_int(1);
print_positive_int(0);
return (0);
}
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple