Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Frame issue with the debugger plugin

<< < (6/14) > >>

scarphin:
Test suite also has the failures for 64-bit:

--- Code: ---D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:20:1: error: Failure in match0_number: Expected 0 but was 1
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:51:1: error: Failure in match1_number: Expected 8 but was 1
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:58:1: error: Failure in match1_address: Expected 2010416948 but was 5029592
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:90:1: error: Failure in match2_number: Expected 9 but was 8
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:97:1: error: Failure in match2_address: Expected 1770750 but was 2292016
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:128:1: error: Failure in match3_number: Expected 30 but was 135
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:135:1: error: Failure in match3_address: Expected 4209674 but was 5029592
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:166:1: error: Failure in match4_number: Expected 31 but was 1
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:173:1: error: Failure in match4_address: Expected 4224714 but was 5029592
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:204:1: error: Failure in match5_number: Expected 50 but was 0
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:211:1: error: Failure in match5_address: Expected 4263052 but was 3437753
D:\coding\projects\sw\codeblocks\trunk\src\plugins\debuggergdb\debuggergdb_test_backtrace.cpp:246:1: error: Failure in match6_number: Expected 0 but was 2291536
FAILURE: 12 out of 116 tests failed (12 failures).
Test time: 0.10 seconds.
--- End code ---

No failures for 32-bit.

scarphin:
As an example following approach works for 64-bit:

--- Code: ---size_t number, address;
number = strtoull(reBT1.GetMatch(line, 1).mb_str(), nullptr, 10);
address = strtoull(reBT1.GetMatch(line, 2).mb_str(), nullptr, 16);
--- End code ---
I think it is also safe considering the regex pattern is ascii (to my understanding).

'strtoull' should be 'strtoll' for signed conversions. Is there a need for 'cbStackFrame::m_number' to be signed?

oBFusCATed:
I don't like the usage of size_t and ssize_t. If you think something should be a particular size then it is better to use int64_t or uint64_t.

About test suite - it is great that it fails, so testing will be a bit easier.
I don't think there is a reason to use 64bit number for the frame, but the address must be 64bit, probably it always has to be 64bit.

scarphin:
Attached patch fixes the 'ToULongLong' problem and the conversion problems between incompatible types. All debugger tests for both 32-bit and 64-bit pass with this patch. 'cdb' part needs testing though.

oBFusCATed:
@Morten: Do you have any idea why you've added calls to ToULongLong instead of ToULong for the Windows 64bit builds in revision 9038?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version