epics-modules / devlib2

Helper library for memory mapped bus access
http://epics-modules.github.io/devlib2/
Other
4 stars 8 forks source link

pciread output can't be redirected in epics shell #12

Closed krmpotic closed 10 months ago

krmpotic commented 4 years ago

When I try to do: epics> pciread 32 0x0 32 > /tmp/file

There is nothing in the file, and output is still displayed at ioc shell.

Redirection would be a useful feature for doing bigger register dumps

dirk-zimoch commented 4 years ago

Looks like #include "epicsStdioRedirect.h" is missing.

mdavidsaver commented 4 years ago

Should be corrected with 1713cce65cf98f8c7a1482fb3b29d3a03384c398. Most of the changes are the ensure that error messages are not redirected by stdout.

Looks like #include "epicsStdioRedirect.h" is missing.

/* epicsStdioRedirect.h */

/* This file is now obselete, and is likely to be
 * deleted in a future release of EPICS Base.
 *
 * Use the epicsStdio.h header file instead.
 */
krmpotic commented 4 years ago

I tested it and it works with 5d28689a9. That was fast!

dirk-zimoch commented 4 years ago

Depending on your EPICS base version you may still need epicsStdioRedirect. Test with R3.14.12 please.

dirk-zimoch commented 4 years ago

Redirection does not work with 3.14.12.

dirk-zimoch commented 4 years ago

A change like this could solve the problem with redirection in 3.14.12 and with epicsStdioRedirect.h being obsolete in 3.15+

+#include <epicsVersion.h>
+#ifndef EPICS_VERSION_INT
+#include <epicsStdioRedirect.h>
+#endif
jerzyjamroz commented 10 months ago

Hi, is it still valid? Or can I close it?

krmpotic commented 10 months ago

I am not working on this anymore. Looks OK to close for me.