Looking for hints on DC import debugging

Lutz Vieweg lvml at 5t9.de
Mon Dec 30 13:33:27 UTC 2013


On 12/30/2013 05:12 PM, Dirk Hohndel wrote:
> Look at this function in qt-ui/downloadfromdivecomputer.cpp:
>
> void DownloadFromDCWidget::onDownloadThreadFinished()
> {
> 	if (currentState == DOWNLOADING) {
> 		if (thread->error.isEmpty())
> 			updateState(DONE);

this is executed, inside updateState() this condition is met:
> 129             else if (currentState == DOWNLOADING && state == DONE) {
> (gdb) n
> 130                     timer->stop();
> (gdb) n
> 131                     ui.progressBar->setValue(100);
> (gdb) n
> 132                     markChildrenAsEnabled();
> (gdb) n
> 133                     ui.ok->setText(tr("OK"));
> (gdb) n
> 134                     accept();
> (gdb) step
> 155             currentState = state;

This last step, above, looks fishy to me: Despite me using "step" to
enter the "accept()" function, gdb proceeds to line 155. As if accept()
wasn't there. And indeed, when I say
> disass 'DownloadFromDCWidget::updateState(DownloadFromDCWidget::states)'
... there is no "accept" call in the whole assembler listing.

Further, the class DownloadFromDCWidget does not seem to have a member
function "accept()", the parent class QDialog does, but I've got no idea
why it is not "stepped into".

Later on, this is executed, too:
> 			process_dives(TRUE, preferDownloaded());

However, in

> process_dives (is_imported=true, prefer_imported=false) at divelist.c:936

both preexisting and dive_table.nr are == 0.

Which would be the function that would actually fill "dive_table" and
increment dive_table.nr during an import?

Regards,

Lutz Vieweg



More information about the subsurface mailing list